30 #ifndef SAFE_INITIALIZE
47 int jmin=
admax(2,i-bw+1);
48 for (j=jmin;j<=i-1;j++)
51 int kmin=
max(1,j-bw+1,i-bw+1);
52 for (k=kmin;k<=j-1;k++)
59 int kmin=
admax(i-bw+1,1);
60 for (k=kmin;k<=i-1;k++)
70 cout <<
"fpen = " << fpen <<
endl;
133 #ifndef SAFE_INITIALIZE
138 ptmp(1)=
posfun(
M(1,1),eps,fpen);
139 L(1,1)=
sqrt(ptmp(1));
143 L(i,1)=
M(i,1)/L(1,1);
148 int jmin=
admax(2,i-bw+1);
149 for (j=jmin;j<=i-1;j++)
152 int kmin=
max(1,j-bw+1,i-bw+1);
153 for (k=kmin;k<=j-1;k++)
155 tmp1(i,j)-=L(i,k)*L(j,k);
157 L(i,j)=tmp1(i,j)/L(j,j);
160 int kmin=
admax(i-bw+1,1);
161 for (k=kmin;k<=i-1;k++)
163 tmp(i)-=L(i,k)*L(i,k);
166 ptmp(i)=
posfun(tmp(i),eps,pen);
167 L(i,i)=
sqrt(ptmp(i));
175 dfptmp(i)+=dfL(i,i)/(2.0*L(i,i));
178 dftmp(i)=dfptmp(i)*
dfposfun(tmp(i),eps);
182 int kmin=
admax(i-bw+1,1);
183 for (k=i-1;k>=kmin;k--)
186 dfL(i,k)-=2.*dftmp(i)*L(i,k);
191 int jmin=
admax(2,i-bw+1);
192 for (j=i-1;j>=jmin;j--)
195 double linv=1./L(j,j);
196 dftmp1(i,j)+=dfL(i,j)*linv;
197 dfL(j,j)-=dfL(i,j)*tmp1(i,j)*linv*linv;
199 kmin=
max(1,j-bw+1,i-bw+1);
200 for (k=j-1;k>=kmin;k--)
203 dfL(i,k)-=dftmp1(i,j)*L(j,k);
204 dfL(j,k)-=dftmp1(i,j)*L(i,k);
207 dfM(i,j)+=dftmp1(i,j);
211 double linv=1./L(1,1);
215 dfM(i,1)+=dfL(i,1)*linv;
216 dfL(1,1)-=dfL(i,1)*
M(i,1)*linv*linv;
223 dfptmp(1)+=dfL(1,1)/(2.*L(1,1));
226 dfM(1,1)+=dfptmp(1)*
dfposfun(
M(1,1),eps);
void save_dmatrix_derivatives(const dvar_matrix_position &) const
Description not yet available.
double restore_prevariable_derivative(const prevariable_position &_pos)
Description not yet available.
Description not yet available.
Description not yet available.
banded_lower_triangular_dmatrix restore_banded_lower_triangular_dvar_matrix_derivatives(const dvar_matrix_position &_pos)
Description not yet available.
Description not yet available.
double dfposfun(const double &x, const double eps)
Adjoint code for posfun; possibly not used.
void dfcholeski_decomp_banded_positive(void)
Description not yet available.
Vector of double precision numbers.
Description not yet available.
int bandwidth(void) const
double & elem_value(int i, int j)
void initialize(void)
Description not yet available.
double dfposfun1(const double &x, const double eps)
Adjoint code for posfun; possibly not used.
dvar_vector posfun(const dvar_vector &x, double eps, const prevariable &pen)
Description not yet available.
void verify_identifier_string(const char *)
Verifies gradient stack string.
void set_gradient_stack(void(*func)(void), double *dep_addr, double *ind_addr1=NULL, double mult1=0, double *ind_addr2=NULL, double mult2=0)
Description not yet available.
prnstream & endl(prnstream &)
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
prevariable_position restore_prevariable_position()
void save_prevariable_position(const prevariable &v)
void initialize(void)
Description not yet available.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
double restore_double_value()
void initialize(void)
Initialze all elements of dvector to zero.
int save_identifier_string(const char *)
Writes a gradient stack verification string.
dvar_matrix_position restore_dvar_matrix_position()
static _THREAD DF_FILE * fp
void save_dvar_matrix_position(const dvar_matrix &m)
Stores the adjoint gradient data that will be processed by gradcalc.
void save_dvar_matrix_value(const dvar_matrix &m)
void save_double_value(double x)
dvector value(const df1_one_vector &v)
static _THREAD grad_stack * GRAD_STACK1
Fundamental data type for reverse mode automatic differentiation.
dmatrix choleski_decomp_positive(const dmatrix &MM, double bound)
Description not yet available.
banded_symmetric_dmatrix restore_banded_symmetric_dvar_matrix_value(const dvar_matrix_position &mpos)
Description not yet available.
Description not yet available.
int bandwidth(void) const
void initialize(void)
Description not yet available.
Description not yet available.