28 double df_x,
double df_y,
double df_z,
29 double df_xx,
double df_xy,
double df_xz,
double df_yy,
30 double df_yz,
double df_zz,
45 #if defined(CHECK_COUNT)
46 if (
ncount >= ncount_check)
52 +(3*nvar+22)*
sizeof(
double);
87 size_t sizeofdouble =
sizeof(double);
111 memcpy(
list,px->get_u_dot(),nvar*sizeofdouble);
112 memcpy(
list,py->get_u_dot(),nvar*sizeofdouble);
144 cerr <<
"illegal value for df1b2variable::pass = "
173 #if defined(SAFE_ARRAYS)
188 double df1=*(
double*) bptr;
189 bptr+=
sizeof(double);
191 double df2=*(
double*) bptr;
192 bptr+=
sizeof(double);
194 double df3=*(
double*) bptr;
195 bptr+=
sizeof(double);
197 double d2f11=*(
double*) bptr;
198 bptr+=
sizeof(double);
200 double d2f12=*(
double*) bptr;
201 bptr+=
sizeof(double);
203 double d2f13=*(
double*) bptr;
204 bptr+=
sizeof(double);
206 double d2f22=*(
double*) bptr;
207 bptr+=
sizeof(double);
209 double d2f23=*(
double*) bptr;
210 bptr+=
sizeof(double);
212 double d2f33=*(
double*) bptr;
213 bptr+=
sizeof(double);
215 #if defined(PRINT_DERS)
216 double d3f111=*(
double*) bptr;
218 bptr+=
sizeof(double);
220 #if defined(PRINT_DERS)
221 double d3f112=*(
double*) bptr;
223 bptr+=
sizeof(double);
225 #if defined(PRINT_DERS)
226 double d3f113=*(
double*) bptr;
228 bptr+=
sizeof(double);
230 #if defined(PRINT_DERS)
231 double d3f122=*(
double*) bptr;
233 bptr+=
sizeof(double);
235 #if defined(PRINT_DERS)
236 double d3f123=*(
double*) bptr;
238 bptr+=
sizeof(double);
240 #if defined(PRINT_DERS)
241 double d3f133=*(
double*) bptr;
243 bptr+=
sizeof(double);
245 #if defined(PRINT_DERS)
246 double d3f222=*(
double*) bptr;
248 bptr+=
sizeof(double);
250 #if defined(PRINT_DERS)
251 double d3f223=*(
double*) bptr;
253 bptr+=
sizeof(double);
255 #if defined(PRINT_DERS)
256 double d3f233=*(
double*) bptr;
258 bptr+=
sizeof(double);
260 #if defined(PRINT_DERS)
261 double d3f333=*(
double*) bptr;
263 bptr+=
sizeof(double);
265 memcpy(&xu,bptr,
sizeof(
double));
266 bptr+=
sizeof(double);
267 memcpy(&yu,bptr,
sizeof(
double));
268 bptr+=
sizeof(double);
269 memcpy(&wu,bptr,
sizeof(
double));
270 bptr+=
sizeof(double);
271 double * xdot=(
double*)bptr;
272 bptr+=nvar*
sizeof(double);
273 double * ydot=(
double*)bptr;
274 bptr+=nvar*
sizeof(double);
275 double * wdot=(
double*)bptr;
288 size_t total_bytes=2*nvar*
sizeof(double);
290 #if defined(SAFE_ALL)
292 int slen=strlen(ids);
297 void * tmpptr=list2.
bptr;
298 #if defined(SAFE_ALL)
303 size_t sizeofdouble =
sizeof(double);
311 #if defined(PRINT_DERS)
313 (df2),(d2f11),(d2f12),(d2f22),
314 (d3f111),(d3f112),(d3f122),
320 #if defined(__DERCHECK__)
322 if (derchecker->node_number)
324 if (derchecker->counter == derchecker->node_number)
326 switch (derchecker->pass_number)
329 switch(derchecker->vartype)
332 if (!derchecker->dotflag)
333 px->
u_bar[derchecker->index-1]+=derchecker->delta;
335 px->
u_dot_bar[derchecker->index-1]+=derchecker->delta;
338 if (!derchecker->dotflag)
339 py->
u_bar[derchecker->index-1]+=derchecker->delta;
341 py->
u_dot_bar[derchecker->index-1]+=derchecker->delta;
344 if (!derchecker->dotflag)
345 pz->
u_bar[derchecker->index-1]+=derchecker->delta;
347 pz->
u_dot_bar[derchecker->index-1]+=derchecker->delta;
350 cerr <<
"Invalid index value for dercheck_index was "
351 << derchecker->index <<
endl;
356 switch(derchecker->vartype)
359 if (!derchecker->dotflag)
360 px->
u_bar[derchecker->index-1]-=derchecker->delta;
362 px->
u_dot_bar[derchecker->index-1]-=derchecker->delta;
365 if (!derchecker->dotflag)
366 py->
u_bar[derchecker->index-1]-=derchecker->delta;
368 py->
u_dot_bar[derchecker->index-1]-=derchecker->delta;
371 if (!derchecker->dotflag)
372 pz->
u_bar[derchecker->index-1]-=derchecker->delta;
374 pz->
u_dot_bar[derchecker->index-1]-=derchecker->delta;
377 cerr <<
"Invalid index value for dercheck_index was "
378 << derchecker->index <<
endl;
388 for (
size_t i=0;i<nvar;i++)
392 for (
size_t i=0;i<nvar;i++)
396 for (
size_t i=0;i<nvar;i++)
400 for (
size_t i=0;i<nvar;i++)
406 for (
size_t i=0;i<nvar;i++)
413 for (
size_t i=0;i<nvar;i++)
419 for (
size_t i=0;i<nvar;i++)
423 for (
size_t i=0;i<nvar;i++)
427 for (
size_t i=0;i<nvar;i++)
432 for (
size_t i=0;i<nvar;i++)
436 for (
size_t i=0;i<nvar;i++)
457 +2*(nvar+1)*
sizeof(
double);
459 #if defined(SAFE_ALL)
461 int slen=strlen(ids);
480 int num_bytes2=*nlist2.
bptr;
494 #if defined(SAFE_ARRAYS)
525 double df1=*(
double*) list.
bptr;
526 list.
bptr+=
sizeof(
double);
528 double df2=*(
double*) list.
bptr;
529 list.
bptr+=
sizeof(
double);
531 double df3=*(
double*) list.
bptr;
532 list.
bptr+=
sizeof(
double);
534 double d2f11=*(
double*) list.
bptr;
535 list.
bptr+=
sizeof(
double);
537 double d2f12=*(
double*) list.
bptr;
538 list.
bptr+=
sizeof(
double);
540 double d2f13=*(
double*) list.
bptr;
541 list.
bptr+=
sizeof(
double);
543 double d2f22=*(
double*) list.
bptr;
544 list.
bptr+=
sizeof(
double);
546 double d2f23=*(
double*) list.
bptr;
547 list.
bptr+=
sizeof(
double);
549 double d2f33=*(
double*) list.
bptr;
550 list.
bptr+=
sizeof(
double);
552 double d3f111=*(
double*) list.
bptr;
553 list.
bptr+=
sizeof(
double);
555 double d3f112=*(
double*) list.
bptr;
556 list.
bptr+=
sizeof(
double);
558 double d3f113=*(
double*) list.
bptr;
559 list.
bptr+=
sizeof(
double);
561 double d3f122=*(
double*) list.
bptr;
562 list.
bptr+=
sizeof(
double);
564 double d3f123=*(
double*) list.
bptr;
565 list.
bptr+=
sizeof(
double);
567 double d3f133=*(
double*) list.
bptr;
568 list.
bptr+=
sizeof(
double);
570 double d3f222=*(
double*) list.
bptr;
571 list.
bptr+=
sizeof(
double);
573 double d3f223=*(
double*) list.
bptr;
574 list.
bptr+=
sizeof(
double);
576 double d3f233=*(
double*) list.
bptr;
577 list.
bptr+=
sizeof(
double);
579 double d3f333=*(
double*) list.
bptr;
580 list.
bptr+=
sizeof(
double);
583 list.
bptr+=
sizeof(double);
585 list.
bptr+=
sizeof(double);
587 list.
bptr+=
sizeof(double);
588 double * xdot=(
double*)list.
bptr;
589 list.
bptr+=nvar*
sizeof(
double);
590 double * ydot=(
double*)list.
bptr;
591 list.
bptr+=nvar*
sizeof(
double);
592 double * wdot=(
double*)list.
bptr;
600 zbar=(
double*)list2.
bptr;
601 zdotbar=(
double*)(list2.
bptr+nvar*
sizeof(double));
619 #if defined(PRINT_DERS)
621 (df2),(d2f11),(d2f12),(d2f22),
622 (d3f111),(d3f112),(d3f122),
630 for (
size_t i=0;i<nvar;i++)
633 z_dot_bar_tilde[i]=0;
636 for (
size_t i=0;i<nvar;i++)
638 *x_tilde+=(d2f11)*zbar[i]*x_bar_tilde[i];
639 *y_tilde+=(d2f12)*zbar[i]*x_bar_tilde[i];
640 *w_tilde+=(d2f13)*zbar[i]*x_bar_tilde[i];
642 *x_tilde+=(d2f12)*zbar[i]*y_bar_tilde[i];
643 *y_tilde+=(d2f22)*zbar[i]*y_bar_tilde[i];
644 *w_tilde+=(d2f23)*zbar[i]*y_bar_tilde[i];
646 *x_tilde+=(d2f13)*zbar[i]*w_bar_tilde[i];
647 *y_tilde+=(d2f23)*zbar[i]*w_bar_tilde[i];
648 *w_tilde+=(d2f33)*zbar[i]*w_bar_tilde[i];
651 for (
size_t i=0;i<nvar;i++)
653 *x_tilde+=(d2f11)*zdotbar[i]*x_dot_bar_tilde[i];
654 *y_tilde+=(d2f12)*zdotbar[i]*x_dot_bar_tilde[i];
655 *w_tilde+=(d2f13)*zdotbar[i]*x_dot_bar_tilde[i];
657 *x_tilde+=(d2f12)*zdotbar[i]*y_dot_bar_tilde[i];
658 *y_tilde+=(d2f22)*zdotbar[i]*y_dot_bar_tilde[i];
659 *w_tilde+=(d2f23)*zdotbar[i]*y_dot_bar_tilde[i];
661 *x_tilde+=(d2f13)*zdotbar[i]*w_dot_bar_tilde[i];
662 *y_tilde+=(d2f23)*zdotbar[i]*w_dot_bar_tilde[i];
663 *w_tilde+=(d2f33)*zdotbar[i]*w_dot_bar_tilde[i];
666 for (
size_t i=0;i<nvar;i++)
668 *x_tilde+=(d3f111)*xdot[i]*zdotbar[i]*x_bar_tilde[i];
669 *y_tilde+=(d3f112)*xdot[i]*zdotbar[i]*x_bar_tilde[i];
670 *w_tilde+=(d3f113)*xdot[i]*zdotbar[i]*x_bar_tilde[i];
672 *x_tilde+=(d3f112)*xdot[i]*zdotbar[i]*y_bar_tilde[i];
673 *y_tilde+=(d3f122)*xdot[i]*zdotbar[i]*y_bar_tilde[i];
674 *w_tilde+=(d3f123)*xdot[i]*zdotbar[i]*y_bar_tilde[i];
676 *x_tilde+=(d3f113)*xdot[i]*zdotbar[i]*w_bar_tilde[i];
677 *y_tilde+=(d3f123)*xdot[i]*zdotbar[i]*w_bar_tilde[i];
678 *w_tilde+=(d3f133)*xdot[i]*zdotbar[i]*w_bar_tilde[i];
680 *x_tilde+=(d3f112)*ydot[i]*zdotbar[i]*x_bar_tilde[i];
681 *y_tilde+=(d3f122)*ydot[i]*zdotbar[i]*x_bar_tilde[i];
682 *w_tilde+=(d3f123)*ydot[i]*zdotbar[i]*x_bar_tilde[i];
684 *x_tilde+=(d3f122)*ydot[i]*zdotbar[i]*y_bar_tilde[i];
685 *y_tilde+=(d3f222)*ydot[i]*zdotbar[i]*y_bar_tilde[i];
686 *w_tilde+=(d3f223)*ydot[i]*zdotbar[i]*y_bar_tilde[i];
688 *x_tilde+=(d3f123)*ydot[i]*zdotbar[i]*w_bar_tilde[i];
689 *y_tilde+=(d3f223)*ydot[i]*zdotbar[i]*w_bar_tilde[i];
690 *w_tilde+=(d3f233)*ydot[i]*zdotbar[i]*w_bar_tilde[i];
692 *x_tilde+=(d3f113)*wdot[i]*zdotbar[i]*x_bar_tilde[i];
693 *y_tilde+=(d3f123)*wdot[i]*zdotbar[i]*x_bar_tilde[i];
694 *w_tilde+=(d3f133)*wdot[i]*zdotbar[i]*x_bar_tilde[i];
696 *x_tilde+=(d3f123)*wdot[i]*zdotbar[i]*y_bar_tilde[i];
697 *y_tilde+=(d3f223)*wdot[i]*zdotbar[i]*y_bar_tilde[i];
698 *w_tilde+=(d3f233)*wdot[i]*zdotbar[i]*y_bar_tilde[i];
700 *x_tilde+=(d3f133)*wdot[i]*zdotbar[i]*w_bar_tilde[i];
701 *y_tilde+=(d3f233)*wdot[i]*zdotbar[i]*w_bar_tilde[i];
702 *w_tilde+=(d3f333)*wdot[i]*zdotbar[i]*w_bar_tilde[i];
705 for (
size_t i=0;i<nvar;i++)
707 z_bar_tilde[i]+=(df1)*x_bar_tilde[i];
708 z_bar_tilde[i]+=(df2)*y_bar_tilde[i];
709 z_bar_tilde[i]+=(df3)*w_bar_tilde[i];
712 for (
size_t i=0;i<nvar;i++)
714 z_dot_bar_tilde[i]+=(df1)*x_dot_bar_tilde[i];
715 z_dot_bar_tilde[i]+=(df2)*y_dot_bar_tilde[i];
716 z_dot_bar_tilde[i]+=(df3)*w_dot_bar_tilde[i];
719 for (
size_t i=0;i<nvar;i++)
721 x_dot_tilde[i]+=(d2f11)*zdotbar[i]*x_bar_tilde[i];
722 y_dot_tilde[i]+=(d2f12)*zdotbar[i]*x_bar_tilde[i];
723 w_dot_tilde[i]+=(d2f13)*zdotbar[i]*x_bar_tilde[i];
725 x_dot_tilde[i]+=(d2f12)*zdotbar[i]*y_bar_tilde[i];
726 y_dot_tilde[i]+=(d2f22)*zdotbar[i]*y_bar_tilde[i];
727 w_dot_tilde[i]+=(d2f23)*zdotbar[i]*y_bar_tilde[i];
729 x_dot_tilde[i]+=(d2f13)*zdotbar[i]*w_bar_tilde[i];
730 y_dot_tilde[i]+=(d2f23)*zdotbar[i]*w_bar_tilde[i];
731 w_dot_tilde[i]+=(d2f33)*zdotbar[i]*w_bar_tilde[i];
734 for (
size_t i=0;i<nvar;i++)
736 z_dot_bar_tilde[i]+=(d2f11)*xdot[i]*x_bar_tilde[i];
737 z_dot_bar_tilde[i]+=(d2f12)*xdot[i]*y_bar_tilde[i];
738 z_dot_bar_tilde[i]+=(d2f13)*xdot[i]*w_bar_tilde[i];
740 z_dot_bar_tilde[i]+=(d2f12)*ydot[i]*x_bar_tilde[i];
741 z_dot_bar_tilde[i]+=(d2f22)*ydot[i]*y_bar_tilde[i];
742 z_dot_bar_tilde[i]+=(d2f23)*ydot[i]*w_bar_tilde[i];
744 z_dot_bar_tilde[i]+=(d2f13)*wdot[i]*x_bar_tilde[i];
745 z_dot_bar_tilde[i]+=(d2f23)*wdot[i]*y_bar_tilde[i];
746 z_dot_bar_tilde[i]+=(d2f33)*wdot[i]*w_bar_tilde[i];
750 #if defined(__DERCHECK__)
751 if (derchecker->node_number)
753 if (derchecker->counter == derchecker->node_number)
755 if (derchecker->pass_number==1)
757 switch(derchecker->vartype)
760 if (!derchecker->dotflag)
761 derchecker->der_value=
764 derchecker->der_value=
768 if (!derchecker->dotflag)
769 derchecker->der_value=
772 derchecker->der_value=
776 if (!derchecker->dotflag)
777 derchecker->der_value=
780 derchecker->der_value=
784 cerr <<
"Invalid index value for dercheck_index was "
785 << derchecker->index <<
endl;
791 #if defined(PRINT_DERS)
825 #if defined(SAFE_ARRAYS)
838 double df1=*(
double*) list.
bptr;
839 list.
bptr+=
sizeof(
double);
841 double df2=*(
double*) list.
bptr;
842 list.
bptr+=
sizeof(
double);
844 double df3=*(
double*) list.
bptr;
845 list.
bptr+=
sizeof(
double);
847 double d2f11=*(
double*) list.
bptr;
848 list.
bptr+=
sizeof(
double);
850 double d2f12=*(
double*) list.
bptr;
851 list.
bptr+=
sizeof(
double);
853 double d2f13=*(
double*) list.
bptr;
854 list.
bptr+=
sizeof(
double);
856 double d2f22=*(
double*) list.
bptr;
857 list.
bptr+=
sizeof(
double);
859 double d2f23=*(
double*) list.
bptr;
860 list.
bptr+=
sizeof(
double);
862 double d2f33=*(
double*) list.
bptr;
863 list.
bptr+=
sizeof(
double);
865 #if defined(PRINT_DERS)
866 double d3f111=*(
double*) list.
bptr;
868 list.
bptr+=
sizeof(
double);
870 #if defined(PRINT_DERS)
871 double d3f112=*(
double*) list.
bptr;
873 list.
bptr+=
sizeof(
double);
875 #if defined(PRINT_DERS)
876 double d3f113=*(
double*) list.
bptr;
878 list.
bptr+=
sizeof(
double);
880 #if defined(PRINT_DERS)
881 double d3f122=*(
double*) list.
bptr;
883 list.
bptr+=
sizeof(
double);
885 #if defined(PRINT_DERS)
886 double d3f123=*(
double*) list.
bptr;
888 list.
bptr+=
sizeof(
double);
890 #if defined(PRINT_DERS)
891 double d3f133=*(
double*) list.
bptr;
893 list.
bptr+=
sizeof(
double);
895 #if defined(PRINT_DERS)
896 double d3f222=*(
double*) list.
bptr;
898 list.
bptr+=
sizeof(
double);
900 #if defined(PRINT_DERS)
901 double d3f223=*(
double*) list.
bptr;
903 list.
bptr+=
sizeof(
double);
905 #if defined(PRINT_DERS)
906 double d3f233=*(
double*) list.
bptr;
908 list.
bptr+=
sizeof(
double);
910 #if defined(PRINT_DERS)
911 double d3f333=*(
double*) list.
bptr;
913 list.
bptr+=
sizeof(
double);
916 list.
bptr+=
sizeof(double);
918 list.
bptr+=
sizeof(double);
920 list.
bptr+=
sizeof(double);
921 double * xdot=(
double*)list.
bptr;
922 list.
bptr+=nvar*
sizeof(
double);
923 double * ydot=(
double*)list.
bptr;
924 list.
bptr+=nvar*
sizeof(
double);
925 double * wdot=(
double*)list.
bptr;
928 #if defined(PRINT_DERS)
930 (df2),(d2f11),(d2f12),(d2f22),
931 (d3f111),(d3f112),(d3f122),
943 for (
size_t i=0;i<nvar;i++)
957 for (
size_t i=0;i<nvar;i++)
964 for (
size_t i=0;i<nvar;i++)
970 #if defined(PRINT_DERS)
void check_buffer_size(const size_t)
Description not yet available.
df1b2_gradlist * f1b2gradlist
void memcpy(test_smartlist &dest, void *source, const size_t nsize)
memcpy for test_smartlist
Description not yet available.
void read_pass2_1_dvdvdv(void)
Description not yet available.
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
void read_pass2_3_dvdvdv(void)
Description not yet available.
int adptr_diff(void *x, void *y)
void ncount_checker(int ncount, int ncount_check)
void read_pass2_2_dvdvdv(void)
Description not yet available.
void restoreposition(void)
Description not yet available.
Description not yet available.
Description not yet available.
prnstream & endl(prnstream &)
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 ad_read_pass2_dvdvdv(void)
Description not yet available.