19 #include <iostream.hpp>
40 return ch_m*
trans(ch_m);
55 cerr <<
"Error in chol_decomp. Matrix not square" <<
endl;
68 #ifndef SAFE_INITIALIZE
144 cerr <<
"Error in chol_decomp. Matrix not square" <<
endl;
168 #ifndef SAFE_INITIALIZE
174 ptmp(1)=
posfun(
M(1,1),eps,fpen);
175 L(1,1)=
sqrt(ptmp(1));
178 L(i,1)=
M(i,1)/L(1,1);
188 tmp1(i,j)-=L(i,k)*L(j,k);
190 L(i,j)=tmp1(i,j)/L(j,j);
195 tmp(i)-=L(i,k)*L(i,k);
198 ptmp(i)=
posfun(tmp(i),eps,pen);
199 L(i,i)=
sqrt(ptmp(i));
210 dfptmp(i)+=dfL(i,i)/(2.0*L(i,i));
213 dftmp(i)=dfptmp(i)*
dfposfun(tmp(i),eps);
220 dfL(i,k)-=2.*dftmp(i)*L(i,k);
228 double linv=1./L(j,j);
229 dftmp1(i,j)+=dfL(i,j)*linv;
230 dfL(j,j)-=dfL(i,j)*tmp1(i,j)*linv*linv;
235 dfL(i,k)-=dftmp1(i,j)*L(j,k);
236 dfL(j,k)-=dftmp1(i,j)*L(i,k);
239 dfM(i,j)+=dftmp1(i,j);
243 double linv=1./L(1,1);
247 dfM(i,1)+=dfL(i,1)*linv;
248 dfL(1,1)-=dfL(i,1)*
M(i,1)*linv*linv;
252 dfptmp(1)+=dfL(1,1)/(2.*L(1,1));
255 dfM(1,1)+=dfptmp(1)*
dfposfun(
M(1,1),eps);
double restore_prevariable_derivative(const prevariable_position &_pos)
Description not yet available.
Description not yet available.
Description not yet available.
double dfposfun(const double &x, const double eps)
Adjoint code for posfun; possibly not used.
dvar_matrix positive_definite_matrix(const dvar_matrix &MM, double eps, dvariable &fpen)
Description not yet available.
dmatrix trans(const dmatrix &m1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Vector of double precision numbers.
dmatrix restore_dvar_matrix_derivatives(const dvar_matrix_position &_pos)
Description not yet available.
dvar_vector nograd_assign(dvector tmp)
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.
unsigned int colsize() const
void dfcholeski_decomp_positive(void)
Description not yet available.
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.
dmatrix restore_dvar_matrix_value(const dvar_matrix_position &mpos)
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)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double restore_double_value()
void save_dmatrix_derivatives(const dvar_matrix_position &pos) const
Description not yet available.
Description not yet available.
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)
void rowshift(int min)
Changes the range of valid indices for the rows.
Class definition of matrix with derivitive information .
Stores the adjoint gradient data that will be processed by gradcalc.
void colshift(int min)
Description not yet available.
void save_dvar_matrix_value(const dvar_matrix &m)
unsigned int rowsize() const
void save_double_value(double x)
dvector value(const df1_one_vector &v)
static _THREAD grad_stack * GRAD_STACK1
void initialize(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Fundamental data type for reverse mode automatic differentiation.
dmatrix choleski_decomp_positive(const dmatrix &MM, double bound)
Description not yet available.
Description not yet available.