ADOL-C: Automatic Differentiation in C/C++ 2.7.3
Loading...
Searching...
No Matches
odedrivers.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------------
2 ADOL-C -- Automatic Differentiation by Overloading in C++
3 File: drivers/odedrivers.h
4 Revision: $Id$
5 Contents: Easy to use drivers for ordinary differential equations (ODE)
6 (with C and C++ callable interfaces including Fortran
7 callable versions).
8
9 Copyright (c) Andrea Walther, Andreas Griewank, Andreas Kowarz,
10 Hristo Mitev, Sebastian Schlenkrich, Jean Utke, Olaf Vogel
11
12 This file is part of ADOL-C. This software is provided as open source.
13 Any use, reproduction, or distribution of the software constitutes
14 recipient's acceptance of the terms of the accompanying license file.
15
16----------------------------------------------------------------------------*/
17#if !defined(ADOLC_DRIVERS_ODEDRIVERS_H)
18#define ADOLC_DRIVERS_ODEDRIVERS_H 1
19
20#include <adolc/adolcexport.h>
21#include <adolc/interfaces.h>
23
25
26/****************************************************************************/
27/* DRIVERS FOR ODEs */
28
29/*--------------------------------------------------------------------------*/
30/* forodec */
31/* forodec(tag, n, tau, dold, dnew, X[n][d+1]) */
32ADOLC_API int forodec(short, int, double, int, int, double **);
34
35/*--------------------------------------------------------------------------*/
36/* accodec */
37/* accodec(n, tau, d, Z[n][n][d+1], B[n][n][d+1], nz[n][n]) */
38ADOLC_API void accodec(int, double, int, double ***, double ***, short **);
40
42
43/****************************************************************************/
44/****************************************************************************/
45/* Now the C++ THINGS */
46#if defined(__cplusplus)
47
48/****************************************************************************/
49/* DRIVERS FOR ODEs, overloaded calls */
50
51/*--------------------------------------------------------------------------*/
52/* forode */
53/* forode(tag, n, tau, dold, dnew, X[n][d+1]) */
54ADOLC_API inline int forode(short tag, // tape identifier
55 int n, // space dimension
56 double tau, // scaling
57 int dold, // previous degree defaults to zero
58 int dnew, // New degree of consistency
59 double **X) // Taylor series
60{
61 return forodec(tag, n, tau, dold, dnew, X);
62}
63
64/*--------------------------------------------------------------------------*/
65/* forode */
66/* the scaling tau defaults to 1 */
67/* */
68/* forode(tag, n, dold, dnew, X[n][d+1]) */
69ADOLC_API inline int forode(short tag, int n, int dold, int dnew, double **X) {
70 return forodec(tag, n, 1.0, dold, dnew, X);
71}
72
73/*--------------------------------------------------------------------------*/
74/* forode */
75/* previous order defaults to 0 */
76/* */
77/* forode(tag, n, tau, dnew, X[n][d+1]) */
78ADOLC_API inline int forode(short tag, int n, double tau, int deg, double **X) {
79 return forodec(tag, n, tau, 0, deg, X);
80}
81
82/*--------------------------------------------------------------------------*/
83/* forode */
84/* both tau and dold default */
85/* */
86/* forode(tag, n, dnew, X[n][d+1]) */
87ADOLC_API inline int forode(short tag, int n, int deg, double **X) {
88 return forode(tag, n, 1.0, 0, deg, X);
89}
90
91/*--------------------------------------------------------------------------*/
92/* accode */
93/* accode(n, tau, d, Z[n][n][d+1], B[n][n][d+1], nz[n][n]) */
94ADOLC_API inline void
95accode(int n, // space dimension
96 double tau, // scaling defaults to 1.0
97 int deg, // highest degree
98 double ***A, // input tensor of "partial" Jacobians
99 double ***B, // output tensor of "total" Jacobians
100 short **nonzero = 0) // optional sparsity characterization
101{
102 accodec(n, tau, deg, A, B, nonzero);
103}
104
105/*--------------------------------------------------------------------------*/
106/* accode */
107/* scaling defaults to 1 */
108/* */
109/* accode(n, d, Z[n][n][d+1], B[n][n][d+1], nz[n][n]) */
110ADOLC_API inline void
111accode(int n, // space dimension
112 int deg, // highest degree
113 double ***A, // input tensor of "partial" Jacobians
114 double ***B, // output tensor of "total" Jacobians
115 short **nonzero = 0) // optional sparsity characterization
116{
117 accodec(n, 1.0, deg, A, B, nonzero);
118}
119
120#endif
121
122/****************************************************************************/
123#endif
#define ADOLC_API
Definition adolcexport.h:16
#define BEGIN_C_DECLS
Definition common.h:115
#define END_C_DECLS
Definition common.h:116
ADOLC_API fint forodec_(fint *, fint *, fdouble *, fint *, fint *, fdouble *)
BEGIN_C_DECLS ADOLC_API int forodec(short, int, double, int, int, double **)
ADOLC_API void accodec(int, double, int, double ***, double ***, short **)
ADOLC_API fint accodec_(fint *, fdouble *, fint *, fdouble *, fdouble *)
#define fint
Definition usrparms.h:38
#define fdouble
Definition usrparms.h:39