18 #include <iomanip.hpp>
40 #if !defined(OPT_LIB) && (__cplusplus >= 201103L)
41 int n = [](
unsigned int colsize) ->
int
43 assert(colsize <= INT_MAX);
44 return static_cast<int>(colsize);
47 int n =
static_cast<int>(aa.
colsize());
54 cerr <<
"Error matrix not square in det()"<<
endl;
60 double big,dum,
sum,temp;
80 cerr <<
"Error in matrix inverse -- matrix singular in inv(dmatrix)\n";
92 sum = sum - bb.
elem(i,k)*bb.
elem(k,j);
104 sum = sum - bb(i,k)*bb(k,j);
127 int itemp=indx.
elem(imax);
134 if (bb.
elem(j,j) == 0.0)
142 for (i=j+1;i<=ub;i++)
153 part_prod(lb) = d*bb(lb,lb);
155 for (j=lb+1;j<=ub;j++)
157 part_prod(j)=part_prod(j-1)*bb(j,j);
159 double det=part_prod(ub);
211 #ifndef SAFE_INITIALIZE
217 dfpart_prod(ub)=dfdet;
219 for (j=ub;j>=lb+1;j--)
222 dfpart_prod(j-1)+=dfpart_prod(j)*b(j,j);
223 dfb(j,j)+=dfpart_prod(j)*part_prod(j-1);
227 dfb(lb,lb)+=dfpart_prod(lb)*d;
233 for (
int i=ub;i>=lb;i--)
244 dfsum+=dfb(i,j)/b(j,j);
245 dfb(j,j)-=dfb(i,j)*b(i,j)/b(j,j);
249 for (
int k=
min(i-1,j-1);k>=lb;k--)
252 dfb(i,k)-=dfsum*b(k,j);
253 dfb(k,j)-=dfsum*b(i,k);
Description not yet available.
double restore_prevariable_derivative()
void save_ivector_position(const ivector &v)
void dfinvpret(void)
Adjoint code for dvar_matrix inv(const dvar_matrix& aa).
Vector of double precision numbers.
ivector_position restore_ivector_position()
void save_dmatrix_position(const dmatrix &m)
dvar_vector nograd_assign(dvector tmp)
Description not yet available.
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
df1_two_variable fabs(const df1_two_variable &x)
dmatrix_position restore_dmatrix_position()
Description not yet available.
void save_dmatrix_value(const dmatrix &m)
void verify_identifier_string(const char *)
Verifies gradient stack string.
void fill_seqadd(int, int)
Fills ivector elements with values starting from base and incremented by offset.
dvector restore_dvector_value(const dvector_position &tmp)
dmatrix restore_dmatrix_value(const dmatrix_position &mpos)
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.
double det(const dmatrix &m1)
Compute determinant of a constant matrix.
void save_dvector_position(const dvector &v)
prnstream & endl(prnstream &)
Array of integers(int) with indexes from index_min to indexmax.
void save_prevariable_position(const prevariable &v)
void save_dvector_value(const dvector &v)
Description not yet available.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void df_xdet(void)
Adjoint code for dvariable det(const dvar_matrix& aa)
double restore_double_value()
static _THREAD gradient_structure * _instance
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.
dvector_position restore_dvector_position()
dvar_matrix_position restore_dvar_matrix_position()
static _THREAD DF_FILE * fp
void save_dvar_matrix_position(const dvar_matrix &m)
ivector restore_ivector_value(const ivector_position &tmp)
Description not yet available.
Class definition of matrix with derivitive information .
Stores the adjoint gradient data that will be processed by gradcalc.
void save_double_value(double x)
dvector value(const df1_one_vector &v)
static _THREAD grad_stack * GRAD_STACK1
class for things related to the gradient structures, including dimension of arrays, size of buffers, etc.
void save_dmatrix_derivatives(const dvar_matrix_position &_pos, const double x, const int &i, int &j)
Description not yet available.
void initialize(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Fundamental data type for reverse mode automatic differentiation.
void save_ivector_value(const ivector &v)
Description not yet available.
unsigned int colsize() const