26 int mmin=v.indexmin();
27 int mmax=v.indexmax();
30 for (
int i=mmin;i<=mmax;i++) tmp(i)=
pow(v(i),x);
44 int mmin=v.indexmin();
45 int mmax=v.indexmax();
48 for (
int i=mmin;i<=mmax;i++) tmp(i)=
pow(
x(i),v(i));
60 int mmin=v.indexmin();
61 int mmax=v.indexmax();
64 for (
int i=mmin;i<=mmax;i++)
79 int mmin=
x.indexmin();
80 int mmax=
x.indexmax();
83 for (
int i=mmin;i<=mmax;i++)
97 int mmin=
x.indexmin();
98 int mmax=
x.indexmax();
101 for (
int i=mmin;i<=mmax;i++)
174 for (
int i=mmin;i<=mmax;i++) tmp(i)=
pow(
x(i),v(i));
187 int mmin=
x.indexmin();
188 int mmax=
x.indexmax();
189 for (
int i=mmin;i<=mmax;i++)
191 *tmp.
get_u() += *
x(i).get_u() * *y(i).get_u();
200 for (
int i=mmin;i<=mmax;i++)
203 double * xd=
x(i).get_u_dot();
204 double * yd=y(i).get_u_dot();
205 double xu= *
x(i).get_u();
206 double yu= *y(i).get_u();
210 *zd++ += yu * *xd++ + xu * *yd++;
232 #if defined(CHECK_COUNT)
233 if (
ncount >= ncount_check)
238 int mmin=px->indexmin();
239 int mmax=px->indexmax();
241 assert(mmax >= mmin);
243 size_t size = (size_t)(mmax - mmin + 1);
244 constexpr
size_t sizeofdouble =
sizeof(double);
247 size_t total_bytes= 2*
sizeof(int) + 2 * size *
sizeof(
df1b2_header)
249 + 2 * size * nvar * sizeofdouble;
251 #if defined(SAFE_ALL)
253 size_t slen=strlen(ids);
260 #if defined(SAFE_ALL)
267 for (
int i=mmin;i<=mmax;i++)
274 for (
int i=mmin;i<=mmax;i++)
279 for (
int i=mmin;i<=mmax;i++)
281 memcpy(
list,(*px)(i).get_u_dot(),nvar*sizeofdouble);
282 memcpy(
list,(*py)(i).get_u_dot(),nvar*sizeofdouble);
314 cerr <<
"illegal value for df1b2variable::pass = "
328 constexpr
size_t sizeofdouble =
sizeof(double);
329 size_t size = nvar * sizeofdouble;
336 #if defined(SAFE_ALL)
340 int& mmin = *(
int *) bptr;
342 int& mmax = *(
int *) bptr;
353 for (
int i=mmin;i<=mmax;i++)
368 double* pxui = xu.
get_v() + mmin;
369 double* pyui = yu.
get_v() + mmin;
370 for (
int i=mmin;i<=mmax;i++)
372 memcpy(pxui, bptr, sizeofdouble);
374 memcpy(pyui, bptr, sizeofdouble);
380 size_t nvarsizeofdouble = nvar * sizeofdouble;
381 for (
int i=mmin;i<=mmax;i++)
384 xdot(i)=(
double*)bptr;
385 bptr += nvarsizeofdouble;
387 ydot(i)=(
double*)bptr;
388 bptr += nvarsizeofdouble;
401 size_t total_bytes=2*nvar*
sizeof(double);
403 #if defined(SAFE_ALL)
405 size_t slen=strlen(ids);
411 void * tmpptr=list2.
bptr;
412 #if defined(SAFE_ALL)
426 double* pyu = yu.
get_v() + mmin;
427 double* pxu = xu.
get_v() + mmin;
428 for (
int i=mmin;i<=mmax;i++)
431 double* pz_u_bar = pz->
u_bar;
432 double* pxi_u_bar = (*ppxi)->u_bar;
433 for (
size_t j = 0; j < nvar; ++j)
435 *pxi_u_bar += yui * *pz_u_bar;
443 pz_u_bar = pz->
u_bar;
444 double* pyi_u_bar = (*ppyi)->u_bar;
445 for (
size_t j = 0; j < nvar; ++j)
447 *pyi_u_bar += xui * *pz_u_bar;
459 pyu = yu.
get_v() + mmin;
460 pxu = xu.
get_v() + mmin;
461 for (
int i=mmin;i<=mmax;i++)
463 double* pydoti = ydot(i);
465 double* pxi_u_bar = (*ppxi)->u_bar;
466 for (
size_t j=0;j<nvar;j++)
468 *pxi_u_bar += *pydoti * *pz_u_dot_bar;
476 double* pxdoti = xdot(i);
477 double* pyi_u_bar = (*ppyi)->u_bar;
478 for (
size_t j=0;j<nvar;j++)
480 *pyi_u_bar += *pxdoti * *pz_u_dot_bar;
489 double* pxi_u_dot_bar = (*ppxi)->u_dot_bar;
490 for (
size_t j=0;j<nvar;j++)
492 *pxi_u_dot_bar += yui * *pz_u_dot_bar;
501 double* pyi_u_dot_bar = (*ppyi)->u_dot_bar;
502 for (
size_t j=0;j<nvar;j++)
504 *pyi_u_dot_bar += xui * *pz_u_dot_bar;
515 memset(pz->
u_bar, 0, size);
538 #if defined(SAFE_ALL)
559 int num_bytes2=*nlist2.
bptr;
572 #if defined(SAFE_ALL)
576 int mmin = *(
int *) list.
bptr;
577 list.
bptr+=
sizeof(
int);
578 int mmax = *(
int *) list.
bptr;
579 list.
bptr+=
sizeof(
int);
590 for (
int i=mmin;i<=mmax;i++)
606 constexpr
size_t sizeofdouble =
sizeof(double);
607 double* pxui = xu.
get_v() + mmin;
608 double* pyui = yu.
get_v() + mmin;
609 for (
int i=mmin;i<=mmax;i++)
612 list.
bptr += sizeofdouble;
614 list.
bptr += sizeofdouble;
620 size_t nvarsizeofdouble = nvar * sizeofdouble;
621 for (
int i=mmin;i<=mmax;i++)
623 xdot(i)=(
double*)list.
bptr;
624 list.
bptr += nvarsizeofdouble;
625 ydot(i)=(
double*)list.
bptr;
626 list.
bptr += nvarsizeofdouble;
630 double* zbar=(
double*)list2.
bptr;
631 double* zdotbar=(
double*)(list2.
bptr + nvarsizeofdouble);
637 memset(z_bar_tilde, 0, nvarsizeofdouble);
638 memset(z_dot_bar_tilde, 0, nvarsizeofdouble);
642 double* pyu = yu.
get_v() + mmin;
643 double* pxu = xu.
get_v() + mmin;
644 for (
int i=mmin;i<=mmax;i++)
646 double* x_tilde= (*ppxi)->get_u_tilde();
647 double* x_dot_tilde= (*ppxi)->get_u_dot_tilde();
648 double* x_bar_tilde= (*ppxi)->get_u_bar_tilde();
649 double* x_dot_bar_tilde= (*ppxi)->get_u_dot_bar_tilde();
650 double* y_tilde= (*ppyi)->get_u_tilde();
651 double* y_dot_tilde= (*ppyi)->get_u_dot_tilde();
652 double* y_bar_tilde= (*ppyi)->get_u_bar_tilde();
653 double* y_dot_bar_tilde= (*ppyi)->get_u_dot_bar_tilde();
657 double* px_bar_tilde = x_bar_tilde;
658 for (
size_t j=0;j<nvar;j++)
660 z_bar_tilde[j]+= yui * *px_bar_tilde;
661 *y_tilde+=zbar[j]* *px_bar_tilde;
665 double* px_dot_bar_tilde = x_dot_bar_tilde;
666 for (
size_t j=0;j<nvar;j++)
668 *y_tilde+=zdotbar[j]* *px_dot_bar_tilde;
669 z_dot_bar_tilde[j]+= yui * *px_dot_bar_tilde;
676 double* py_bar_tilde = y_bar_tilde;
677 for (
size_t j=0;j<nvar;j++)
679 *x_tilde+=zbar[j]* *py_bar_tilde;
680 z_bar_tilde[j]+= xui * *py_bar_tilde;
684 double* py_dot_bar_tilde = y_dot_bar_tilde;
685 for (
size_t j=0;j<nvar;j++)
687 *x_tilde+=zdotbar[j]* *py_dot_bar_tilde;
688 z_dot_bar_tilde[j]+= xui * *py_dot_bar_tilde;
693 px_bar_tilde = x_bar_tilde;
694 for (
size_t j=0;j<nvar;j++)
696 y_dot_tilde[j]+=zdotbar[j]* *px_bar_tilde;
697 z_dot_bar_tilde[j]+=ydot(i)[j]* *px_bar_tilde;
700 py_bar_tilde = y_bar_tilde;
701 for (
size_t j=0;j<nvar;j++)
703 x_dot_tilde[j]+=zdotbar[j]* *py_bar_tilde;
704 z_dot_bar_tilde[j]+=xdot(i)[j]* *py_bar_tilde;
737 #if defined(SAFE_ALL)
740 int& mmin = *(
int *) list.
bptr;
741 list.
bptr+=
sizeof(
int);
742 int& mmax = *(
int *) list.
bptr;
743 list.
bptr+=
sizeof(
int);
753 for (i=mmin;i<=mmax;i++)
768 constexpr
size_t sizeofdouble =
sizeof(double);
770 double* pxui = xu.
get_v() + mmin;
771 double* pyui = yu.
get_v() + mmin;
772 for (i=mmin;i<=mmax;i++)
775 list.
bptr+=sizeofdouble;
777 list.
bptr+=sizeofdouble;
783 size_t nvarsizeofdouble = nvar * sizeofdouble;
784 for (i=mmin;i<=mmax;i++)
787 xdot(i)=(
double*)list.
bptr;
788 list.
bptr += nvarsizeofdouble;
790 ydot(i)=(
double*)list.
bptr;
791 list.
bptr += nvarsizeofdouble;
796 pxui = xu.
get_v() + mmin;
797 pyui = yu.
get_v() + mmin;
800 for (i=mmin;i<=mmax;i++)
802 *((*ppxi)->u_tilde) += *pyui * *(pz->
u_tilde);
803 *((*ppyi)->u_tilde) += *pxui * *(pz->
u_tilde);
806 for (
size_t j=0;j<nvar;j++)
808 *((*ppyi)->u_tilde) += xdot(i)[j]* *pz_u_dot_tildej;
809 *((*ppxi)->u_tilde) += ydot(i)[j]* *pz_u_dot_tildej;
814 double* ppxi_u_dot_tildej = (*ppxi)->u_dot_tilde;
815 double* ppyi_u_dot_tildej = (*ppyi)->u_dot_tilde;
817 for (
size_t j=0;j<nvar;j++)
819 *ppxi_u_dot_tildej += *pyui * *pz_u_dot_tildej;
820 *ppyi_u_dot_tildej += *pxui * *pz_u_dot_tildej;
void check_buffer_size(const size_t)
Description not yet available.
df1b2_gradlist * f1b2gradlist
void read_pass2_3_prod_vector(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.
Vector of double precision numbers.
int indexmin() const
Get minimum valid index.
Description not yet available.
int adptr_diff(void *x, void *y)
Description not yet available.
void ad_read_pass2_prod_vector(void)
Description not yet available.
void restoreposition(void)
Description not yet available.
Description not yet available.
dmatrix operator*(const d3_array &t, const dvector &v)
Description not yet available.
int write_pass1_prod(double x, const df1b2variable *py, df1b2variable *pz)
Description not yet available.
Description not yet available.
prnstream & endl(prnstream &)
void noallocate(int lib, int ub)
Description not yet available.
void RETURN_ARRAYS_INCREMENT()
static int no_derivatives
int indexmax() const
Get maximum valid index.
static _THREAD gradient_structure * _instance
Description not yet available.
void read_pass2_1_prod_vector(void)
Description not yet available.
Description not yet available.
void RETURN_ARRAYS_DECREMENT()
void checkidentiferstring(const char *ids, test_smartlist &list)
Description not yet available.
void read_pass2_2_prod_vector(void)
Description not yet available.
class for things related to the gradient structures, including dimension of arrays, size of buffers, etc.
d3_array pow(const d3_array &m, int e)
Description not yet available.