amino  1.0-beta2
Lightweight Robot Utility Library
diffeq.h
Go to the documentation of this file.
1 /* -*- mode: C; c-basic-offset: 4 -*- */
2 /* ex: set shiftwidth=4 tabstop=4 expandtab: */
3 /*
4  * Copyright (c) 2019, Colorado School of Mines
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or
8  * without modification, are permitted provided that the following
9  * conditions are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  */
34 #ifndef AA_DIFFEQ_H
35 #define AA_DIFFEQ_H
36 
44 #include "mat.h"
45 
46 typedef double aa_de_scalar_field_fun(void *cx, const struct aa_dvec *x);
47 
48 typedef void aa_de_vector_field_fun(void *cx, const struct aa_dvec *x, struct aa_dvec *y);
49 
50 
55 AA_API void aa_de_grad_fd( aa_de_scalar_field_fun *fun, void *cx,
56  const struct aa_dvec *x, double eps, struct aa_dvec *y );
57 
58 
63 AA_API void aa_de_jac_fd( aa_de_vector_field_fun *fun, void *cx,
64  const struct aa_dvec *x, double eps, struct aa_dmat *J );
65 
66 #endif //AA_DIFFEQ_H
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:95
AA_API void aa_de_jac_fd(aa_de_vector_field_fun *fun, void *cx, const struct aa_dvec *x, double eps, struct aa_dmat *J)
Estimate the Jacobian by finite difference.
AA_API void aa_de_grad_fd(aa_de_scalar_field_fun *fun, void *cx, const struct aa_dvec *x, double eps, struct aa_dvec *y)
Estimate the gradient by finite difference.
Block matrix descriptors and linear algebra operations.
Descriptor for a block matrix.
Definition: mat.h:72
Descriptor for a vector.
Definition: mat.h:63