19 #include <iostream.hpp>
39 cerr <<
"Error in chol_decomp. Matrix not square" <<
endl;
48 cerr <<
"Error matrix not positive definite in choleski_decomp"
53 vc(mmin,mmin)=
sqrt(MM(mmin,mmin));
67 #ifndef SAFE_INITIALIZE
75 cerr <<
"Error matrix not positive definite in choleski_decomp"
136 cerr <<
"Error matrix not positive definite in choleski_decomp"
185 cerr <<
"Error in chol_decomp. Matrix not square" <<
endl;
207 #ifndef SAFE_INITIALIZE
214 cerr <<
"Error matrix not positive definite in choleski_decomp"
221 L(i,1)=
M(i,1)/L(1,1);
231 tmp1(i,j)-=L(i,k)*L(j,k);
233 L(i,j)=tmp1(i,j)/L(j,j);
238 tmp(i)-=L(i,k)*L(i,k);
242 cerr <<
"Error matrix not positive definite in choleski_decomp"
254 dftmp(i)+=dfL(i,i)/(2.0*L(i,i));
259 dfL(i,k)-=2.*dftmp(i)*L(i,k);
267 double linv=1./L(j,j);
268 dftmp1(i,j)+=dfL(i,j)*linv;
269 dfL(j,j)-=dfL(i,j)*tmp1(i,j)*linv*linv;
274 dfL(i,k)-=dftmp1(i,j)*L(j,k);
275 dfL(j,k)-=dftmp1(i,j)*L(i,k);
278 dfM(i,j)+=dftmp1(i,j);
282 double linv=1./L(1,1);
286 dfM(i,1)+=dfL(i,1)*linv;
287 dfL(1,1)-=dfL(i,1)*
M(i,1)*linv*linv;
291 dfM(1,1)+=dfL(1,1)/(2.*L(1,1));
Description not yet available.
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.
void verify_identifier_string(const char *)
Verifies gradient stack string.
unsigned int colsize() const
df1_one_matrix choleski_decomp(const df1_one_matrix &MM)
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.
void dfcholeski_decomp(void)
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.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
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.
unsigned int rowsize() const
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
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.
Description not yet available.
unsigned int colsize() const