ADOL-C: Automatic Differentiation in C/C++ 2.7.3
Loading...
Searching...
No Matches
externfcts2.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------------
2 ADOL-C -- Automatic Differentiation by Overloading in C++
3 File: externfcts.h
4 Revision: $Id$
5 Contents: public functions and data types for extern (differentiated)
6 functions.
7
8 Copyright (c) Kshitij Kulshreshtha
9
10 This file is part of ADOL-C. This software is provided as open source.
11 Any use, reproduction, or distribution of the software constitutes
12 recipient's acceptance of the terms of the accompanying license file.
13
14----------------------------------------------------------------------------*/
15
16#if !defined(ADOLC_EXTERNFCTS2_H)
17#define ADOLC_EXTERNFCTS2_H 1
18
19#include <adolc/adolcexport.h>
21
22using ADOLC_ext_fct_v2 = int(short tapeId, size_t iArrLen, size_t *iArr,
23 size_t nin, size_t nout, size_t *insz, double **x,
24 size_t *outsz, double **y, void *ctx);
25using ADOLC_ext_fct_v2_fos_forward = int(short tapeId, size_t iArrLen,
26 size_t *iArr, size_t nin, size_t nout,
27 size_t *insz, double **x, double **xp,
28 size_t *outsz, double **y, double **yp,
29 void *ctx);
30using ADOLC_ext_fct_v2_fov_forward = int(short tapeId, size_t iArrLen,
31 size_t *iArr, size_t nin, size_t nout,
32 size_t *insz, double **x, size_t ndir,
33 double ***Xp, size_t *outsz,
34 double **y, double ***Yp, void *ctx);
35using ADOLC_ext_fct_v2_fos_reverse = int(short tapeId, size_t iArrLen,
36 size_t *iArr, size_t nout, size_t nin,
37 size_t *outsz, double **up,
38 size_t *insz, double **zp, double **x,
39 double **y, void *ctx);
40using ADOLC_ext_fct_v2_fov_reverse = int(short tapeId, size_t iArrLen,
41 size_t *iArr, size_t nout, size_t nin,
42 size_t *outsz, size_t dir,
43 double ***Up, size_t *insz,
44 double ***Zp, double **x, double **y,
45 void *ctx);
46
47/* The following two aren't implemented */
48using ADOLC_ext_fct_v2_hos_forward = int(short tapeId, size_t iArrLen,
49 size_t *iArr, size_t nin, size_t nout,
50 size_t *insz, double **x,
51 size_t degree, double ***Xp,
52 size_t *outsz, double **y,
53 double ***Yp, void *ctx);
54using ADOLC_ext_fct_v2_hov_forward = int(short tapeId, size_t iArrLen,
55 size_t *iArr, size_t nin, size_t nout,
56 size_t *insz, double **x,
57 size_t degree, size_t ndir,
58 double ****Xp, size_t *outsz,
59 double **y, double ****Yp, void *ctx);
60
69 // This is the id of the outer tape that calls the external differentiated
70 // function later
71 short tapeId{0};
72
73 // tape that stores the external differentiated function.
74 short extTapeId{0};
82 locint index{0};
83
100
107
114
120
126
136 double **x{nullptr};
137
141 double **xp{nullptr};
142
147 double ***Xp{nullptr};
148
153 double **y{nullptr};
154
158 double **yp{nullptr};
159
164 double ***Yp{nullptr};
165
169 double **up{nullptr};
170
175 double ***Up{nullptr};
176
180 double **zp{nullptr};
181
186 double ***Zp{nullptr};
187
191 size_t max_nin{0}, max_nout{0}, max_insz{0}, max_outsz{0};
192
196 int p{0};
197
201 int q{0};
209 char nestedAdolc{0};
210
215 char dp_x_changes{1};
216
222 char dp_y_priorRequired{1};
227 void *context{nullptr};
232 char *allmem{nullptr};
237 void *obj{nullptr};
242 char user_allocated_mem{0};
243};
244
245ADOLC_API ext_diff_fct_v2 *reg_ext_fct(short tapeId, short extTapeId,
246 ADOLC_ext_fct_v2 ext_fct);
247ADOLC_API ext_diff_fct_v2 *get_ext_diff_fct_v2(short tapeId, size_t index);
248ADOLC_API int call_ext_fct(ext_diff_fct_v2 *edfct, size_t iArrLen, size_t *iArr,
249 size_t nin, size_t out, size_t *insz, adouble **x,
250 size_t *outsz, adouble **y);
251
253
255 void *ctx) {
256 edfct->context = ctx;
257}
258
259#endif
#define ADOLC_API
Definition adolcexport.h:16
Taped active scalar for reusable forward and reverse differentiation.
Definition adtb_types.h:211
BEGIN_C_DECLS ADOLC_API int function(short, int, int, const double *, double *)
ADOLC_API void edf_zero(ext_diff_fct_v2 *edfct)
int(short tapeId, size_t iArrLen, size_t *iArr, size_t nin, size_t nout, size_t *insz, double **x, size_t degree, size_t ndir, double ****Xp, size_t *outsz, double **y, double ****Yp, void *ctx) ADOLC_ext_fct_v2_hov_forward
Definition externfcts2.h:59
ADOLC_API ext_diff_fct_v2 * get_ext_diff_fct_v2(short tapeId, size_t index)
ADOLC_API ext_diff_fct_v2 * reg_ext_fct(short tapeId, short extTapeId, ADOLC_ext_fct_v2 ext_fct)
ADOLC_API int call_ext_fct(ext_diff_fct_v2 *edfct, size_t iArrLen, size_t *iArr, size_t nin, size_t out, size_t *insz, adouble **x, size_t *outsz, adouble **y)
int(short tapeId, size_t iArrLen, size_t *iArr, size_t nin, size_t nout, size_t *insz, double **x, size_t ndir, double ***Xp, size_t *outsz, double **y, double ***Yp, void *ctx) ADOLC_ext_fct_v2_fov_forward
Definition externfcts2.h:34
ADOLC_API void edf_set_opaque_context(ext_diff_fct_v2 *edfct, void *ctx)
Definition externfcts2.h:254
int(short tapeId, size_t iArrLen, size_t *iArr, size_t nout, size_t nin, size_t *outsz, double **up, size_t *insz, double **zp, double **x, double **y, void *ctx) ADOLC_ext_fct_v2_fos_reverse
Definition externfcts2.h:39
int(short tapeId, size_t iArrLen, size_t *iArr, size_t nout, size_t nin, size_t *outsz, size_t dir, double ***Up, size_t *insz, double ***Zp, double **x, double **y, void *ctx) ADOLC_ext_fct_v2_fov_reverse
Definition externfcts2.h:45
int(short tapeId, size_t iArrLen, size_t *iArr, size_t nin, size_t nout, size_t *insz, double **x, double **xp, size_t *outsz, double **y, double **yp, void *ctx) ADOLC_ext_fct_v2_fos_forward
Definition externfcts2.h:29
int(short tapeId, size_t iArrLen, size_t *iArr, size_t nin, size_t nout, size_t *insz, double **x, size_t degree, double ***Xp, size_t *outsz, double **y, double ***Yp, void *ctx) ADOLC_ext_fct_v2_hos_forward
Definition externfcts2.h:53
int(short tapeId, size_t iArrLen, size_t *iArr, size_t nin, size_t nout, size_t *insz, double **x, size_t *outsz, double **y, void *ctx) ADOLC_ext_fct_v2
Definition externfcts2.h:24
ADOLC_API int fos_forward(short, int, int, int, const double *, const double *, double *, double *)
ADOLC_API int fos_reverse(short, int, int, const double *, double *)
ADOLC_API int fov_forward(short, int, int, int, const double *, const double *const *, double *, double **)
ADOLC_API int fov_reverse(short, int, int, int, const double *const *, double **)
BEGIN_C_DECLS ADOLC_API int zos_forward(short, int, int, int, const double *, double *)
Callback descriptor for a block-structured external function.
Definition externfcts2.h:68
void * context
Definition externfcts2.h:227