81 for (
int i=mmin;i<=mmax;i++)
95 for (
int i = mmin; i <= mmax; ++i)
129 static_cast<unsigned int>(max < min ? 0 : max - min + 1)];
132 cerr <<
"error allocating memory in df3_two_vector\n";
137 cerr <<
"Error trying to allocate memory for df3_two_vector\n";
162 for (
int i=rmin;i<=rmax;i++)
167 for (
int j=cmin;j<=cmax;j++)
169 cm(i,j)=
value(v(i,j));
225 for (
int i=mmin;i<=mmax;i++)
245 static_cast<unsigned int>(rmax < rmin ? 0 : rmax - rmin + 1)];
248 cerr <<
"error allocating memory in df3_two_matrix" <<
endl;
253 cerr <<
"Error trying to allocate memory for df3_two_vector\n";
257 for (
int i = rmin; i <= rmax; ++i)
400 return value(x) >= n;
418 return value(x) == n;
427 return x ==
value(n);
453 double zp,
double zp2,
double zp3)
496 double f_u,
double f_v,
double f_uu,
double f_uv,
double f_vv,
double f_uuu,
497 double f_uuv,
double f_uvv,
double f_vvv)
594 double xinv=1.0/(*x.
get_u());
596 double zp2=-0.5*zp*xinv;
597 double zp3=-1.5*zp2*xinv;
613 double d=1.0/(1+
square(cx));
618 double zp2=-2.0*cx*d2;
619 double zp3=-2.0*d2+8*cx*cx*d*d2;
655 double zp2=2.0*w*v2*v;
656 double zp3=(4.0*w*w+2.0)*v2*v2;
725 double zp=1/(*x.
get_u());
727 double zp3=-2.0*zp*zp2;
769 double xinv=1.0/(*x.
get_u());
771 double zp=-xinv*xinv;
772 double zp2=-2.0*zp*xinv;
773 double zp3=-3.0*zp2*xinv;
828 double f_u=*y.
get_u();
829 double f_v=*x.
get_u();
840 f_uuu, f_uuv, f_uvv, f_vvv);
1061 cerr <<
"can only have 2 independent_variables in df3_two_variable"
1062 " function" <<
endl;
1082 cerr <<
"illegal num_ind_var value of " <<
num_ind_var
1083 <<
" in df3_two_variable function" <<
endl;
1127 int cmin=
M(rmin).indexmin();
1129 int cmax=
M(rmin).indexmax();
1130 if (rmin !=1 || cmin !=1)
1132 cerr <<
"minimum row and column inidices must equal 1 in "
1133 "df1b2matrix choleski_decomp(const df3_two_atrix& MM)"
1139 cerr <<
"Error in df1b2matrix choleski_decomp(const df3_two_matrix& MM)"
1140 " Matrix not square" <<
endl;
1146 #ifndef SAFE_INITIALIZE
1155 cerr <<
"Error matrix not positive definite in choleski_decomp"
1160 L(1,1)=
sqrt(
M(1,1));
1163 L(i,1)=
M(i,1)/L(1,1);
1168 for (j=2;j<=i-1;j++)
1171 for (k=1;k<=j-1;k++)
1178 for (k=1;k<=i-1;k++)
1185 cerr <<
"Error matrix not positive definite in choleski_decomp"
1206 cerr <<
"unequal shape in "
1207 "df1b2matrix& df1b2matrix::operator = (const df3_two_matrix& M)"
1212 for (
int i=rmin;i<=rmax;i++)
1229 cerr <<
"unequal shape in "
1230 "df1b2vector& df1b2vector::operator = (const df3_two_vector& M)"
1235 for (
int i=rmin;i<=rmax;i++)
1251 df3_two_variable::ind_var[0]=0;
1252 df3_two_variable::ind_var[1]=0;
1262 *zd++ = dfx * *xd++ + dfy * *yd++;
1285 double xu=*x.
get_u();
1286 double yu=*y.
get_u();
1291 double dfy= -xu*yinv*yinv;
1293 double dfxy=-yinv*yinv;
1294 double dfyy=2.0*xu*yinv*yinv*yinv;
1297 double dfxyy=2.0*yinv*yinv*yinv;
1298 double dfyyy=-6.0*xu*yinv*yinv*yinv*yinv;
1306 *zd++ = dfx * *xd++ + dfy * *yd++;
1313 dfxxx,dfxxy,dfxyy,dfyyy);
1324 double xu=*x.
get_u();
1327 double dfx= y*
::pow(xu,y-1.0);
1328 double dfxx= y*(y-1.0)*
::pow(xu,y-2.0);
1329 double dfxxx= y*(y-1.0)*(y-2.0)*
::pow(xu,y-3.0);
1335 *zd++ = dfx * *xd++ ;
d3_array tan(const d3_array &arr3)
Returns d3_array results with computed tan from elements in arr3.
~df3_two_vector()
Destructor.
df1b2_gradlist * f1b2gradlist
void * trueptr
Address of first element in the vector.
Description not yet available.
double * get_u_xy(void) const
void allocate(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
df1b2variable & operator=(const df3_one_variable &v)
Description not yet available.
d3_array operator-(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Vector of double precision numbers.
void initialize(void)
Initialize df3_two_vector to zero.
Description not yet available.
d3_array operator+(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
df1_one_variable atan(const df1_one_variable &x)
d3_array sin(const d3_array &arr3)
Returns d3_array results with computed sin from elements in arr3.
df1_two_variable fabs(const df1_two_variable &x)
void set_derivatives(df1_one_variable &z, const df1_one_variable &x, double u, double zp)
double * get_u(void) const
d3_array cube(const d3_array &m)
Description not yet available.
int operator<(double v0, const prevariable &v1)
Description not yet available.
df3_two_vector(void)
Default constructor.
df3_two_variable & operator*=(const df3_two_variable &v)
Multiply df3_two_variable and v which calls set_derivatives.
Description not yet available.
df1b2matrix & operator=(const df3_one_matrix &)
df1_one_matrix choleski_decomp(const df1_one_matrix &MM)
dmatrix operator*(const d3_array &t, const dvector &v)
Description not yet available.
double * get_u_y(void) const
int operator==(double v0, const prevariable &v1)
Description not yet available.
double * get_u_xx(void) const
double * get_u_x(void) const
void allocate(void)
Does NOT allocate, but initializes empty df3_two_vector.
double * get_u_xyy(void) const
df1b2vector & operator=(const df3_one_vector &)
prnstream & endl(prnstream &)
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
df3_two_variable & operator=(const df3_two_variable &v)
Description not yet available.
static df1b2variable * ind_var[]
df3_two_variable & operator+=(const df3_two_variable &v)
Add values from _v to df3_two_variable.
double * get_u_xxy(void) const
Description not yet available.
double * get_u_yyy(void) const
~df3_two_matrix()
Destructor.
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
df1b2variable mypow(const df1b2variable &x, double y)
Description not yet available.
df3_two_variable & operator-=(double v)
Subtract value _v from only df3_two_variable u with the rest of the values unchanged.
void initialize(void)
Description not yet available.
Description not yet available.
df3_two_matrix(int rmin, int rmax, int cmin, int cmax)
Construct matrix of df3_two_variable with dimension [rmin to rmax] x [cmin to cmax].
unsigned int ncopies
Copy counter to enable shallow copies.
double * get_u_yy(void) const
int write_pass1(const df1b2variable *px, const df1b2variable *py, df1b2variable *pz, df1b2function2 *pf)
Description not yet available.
Holds "shape" information for vector objects.
d3_array cos(const d3_array &arr3)
Returns d3_array results with computed cos from elements in arr3.
Description not yet available.
int operator>(double v0, const prevariable &v1)
Description not yet available.
Description not yet available.
Description not yet available.
d3_array operator/(const d3_array &m, const double d)
Author: David Fournier.
init_df3_two_variable(const df1b2variable &)
Description not yet available.
dvector value(const df1_one_vector &v)
void deallocate(void)
Deallocate df3_two_vector, then set to empty.
void deallocate(void)
Deallocate df3_two_vector, then set to empty.
df3_two_variable & operator/=(const df3_two_variable &v)
Description not yet available.
int operator>=(double v0, const prevariable &v1)
Description not yet available.
double square(const double value)
Return square of value; constant object.
df1_one_variable inv(const df1_one_variable &x)
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double * get_u_xxx(void) const
df1b2variable div(const df1b2variable &x, const df1b2variable &y)
Description not yet available.
d3_array pow(const d3_array &m, int e)
Description not yet available.