11 #if defined(CHECK_COUNT)
33 #if defined(CHECK_COUNT)
34 if (
ncount >= ncount_check)
41 +
sizeof(
double)+nvar*
sizeof(double);
64 memcpy(
list,px->get_u_dot(),nvar*(int)
sizeof(
double));
91 cerr <<
"illegal value for df1b2variable::pass = "
123 #if defined(SAFE_ALL)
126 constexpr
size_t sizeofdouble =
sizeof(double);
132 list.
bptr+=
sizeof(
char*);
134 list.
bptr+=sizeofdouble;
135 double* xdot=(
double*)list.
bptr;
149 size_t total_bytes=2*nvar*sizeofdouble;
151 #if defined(SAFE_ALL)
153 size_t slen=strlen(ids);
158 void * tmpptr2=list2.
bptr;
160 #if defined(SAFE_ALL)
171 #if defined(PRINT_DERS)
178 double df=(pf->
df)(xu);
179 double d2f=(pf->
d2f)(xu);
182 double* px_u_bari = px->
u_bar;
183 double* pz_u_bari = pz->
u_bar;
184 for (
size_t i=0;i<nvar;i++)
187 *px_u_bari += df * *pz_u_bari;
192 px_u_bari = px->
u_bar;
193 double* xdoti = xdot;
195 for (
size_t i=0;i<nvar;i++)
198 *px_u_bari += d2f * *xdoti * *pz_u_dot_bari;
206 for (
size_t i=0;i<nvar;i++)
209 *px_u_dot_bari += df * *pz_u_dot_bari;
216 memset(pz->
u_bar, 0, nvar * sizeofdouble);
217 memset(pz->
u_dot_bar, 0, nvar * sizeofdouble);
219 #if defined(PRINT_DERS)
240 +
sizeof(
double)+nvar*
sizeof(double);
242 #if defined(SAFE_ALL)
244 int slen=strlen(ids);
263 int num_bytes2=*nlist2.
bptr;
277 #if defined(SAFE_ALL)
286 list.
bptr+=
sizeof(
char*);
288 list.
bptr+=
sizeof(double);
289 double* xdot=(
double*)list.
bptr;
292 double* zbar=(
double*)list2.
bptr;
293 double* zdotbar=(
double*)(list2.
bptr+nvar*
sizeof(double));
301 #if defined(PRINT_DERS)
309 constexpr
size_t sizeofdouble =
sizeof(double);
310 memset(z_bar_tilde, 0, nvar * sizeofdouble);
311 memset(z_dot_bar_tilde, 0, nvar * sizeofdouble);
313 double df=(pf->
df)(xu);
314 double d2f=(pf->
d2f)(xu);
315 double d3f=(pf->
d3f)(xu);
317 double* px_bar_tildei = x_bar_tilde;
318 double* pzbari = zbar;
319 double* pz_bar_tildei = z_bar_tilde;
320 for (
size_t i=0;i<nvar;i++)
323 *x_tilde += d2f * *pzbari * *px_bar_tildei;
325 *pz_bar_tildei += df * *px_bar_tildei;
332 double* pzdotbari = zdotbar;
333 double* pz_dot_bar_tildei = z_dot_bar_tilde;
334 double* px_dot_bar_tildei = x_dot_bar_tilde;
335 for (
size_t i=0;i<nvar;i++)
338 *x_tilde+=d2f * *pzdotbari * *px_dot_bar_tildei;
340 *pz_dot_bar_tildei += df * *px_dot_bar_tildei;
347 px_bar_tildei = x_bar_tilde;
349 double* pxdoti = xdot;
350 double* px_dot_tildei = x_dot_tilde;
351 pz_dot_bar_tildei = z_dot_bar_tilde;
352 for (
size_t i=0;i<nvar;i++)
357 *px_dot_tildei += d2f * *pzdotbari * *px_bar_tildei;
358 *pz_dot_bar_tildei += d2f * *pxdoti * *px_bar_tildei;
359 *x_tilde += d3f * *pxdoti * *pzdotbari * *px_bar_tildei;
368 #if defined(PRINT_DERS)
398 #if defined(SAFE_ALL)
406 list.
bptr+=
sizeof(
char*);
408 list.
bptr+=
sizeof(double);
409 double* xdot=(
double*)list.
bptr;
412 #if defined(PRINT_DERS)
419 double df=(pf->
df)(xu);
420 double d2f=(pf->
d2f)(xu);
425 double* pxdoti = xdot;
426 for (
size_t i=0;i<nvar;i++)
429 *(px->
u_tilde) += d2f * *pxdoti * *pz_u_dot_tildei;
437 for (
size_t i=0;i<nvar;i++)
440 *px_u_dot_tildei += df * *pz_u_dot_tildei;
446 constexpr
size_t sizeofdouble =
sizeof(double);
448 #if defined(PRINT_DERS)
void ad_read_pass2(void)
Description not yet available.
void check_buffer_size(const size_t)
Description not yet available.
df1b2_gradlist * f1b2gradlist
void read_pass1_1(void)
Description not yet available.
void memcpy(test_smartlist &dest, void *source, const size_t nsize)
memcpy for test_smartlist
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
int adptr_diff(void *x, void *y)
void ncount_checker(int ncount, int ncount_check)
void ad_read_pass1(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void restoreposition(void)
Description not yet available.
Description not yet available.
This is a function object for a function of one variable which stores the functions which calculate t...
Description not yet available.
prnstream & endl(prnstream &)
void read_pass1_3(void)
Description not yet available.
void print_derivatives(const adstring &s, double f, double df, double d2f, double d3f, int bflag)
Description not yet available.
Description not yet available.
int write_pass1(const df1b2variable *px, const df1b2variable *py, df1b2variable *pz, df1b2function2 *pf)
Description not yet available.
Description not yet available.
void checkidentiferstring(const char *ids, test_smartlist &list)
Description not yet available.
void read_pass1_2(void)
Description not yet available.