ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_ma7.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
11 #include "fvar.hpp"
12 
13 /*
14 void dvar_matrix::initialize(void)
15 {
16  if (!(!(*this))) // only initialize allocated objects
17  {
18  for (int i=rowmin();i<=rowmax();i++)
19  {
20  elem(i).initialize();
21  }
22  }
23 }
24 */
25 
31 void dfmatinit(void)
32 {
34 
35  //verify_identifier_string("q");
37  //verify_identifier_string("p");
38  dmatrix tmp(tmp_pos);
39  tmp.initialize();
40  tmp.save_dmatrix_derivatives_na(tmp_pos);
41 }
49 {
50  if (!(!(*this))) // only initialize allocated objects
51  {
52  int imin = indexmin();
53  int imax = indexmax();
54  dvar_vector* pmi = m + imin;
55  for (int i = imin; i <= imax; ++i)
56  {
57  if (allocated(*pmi))
58  {
59  int jmin = pmi->indexmin();
60  int jmax = pmi->indexmax();
61 
62  double_and_int* pmij = pmi->get_va() + jmin;
63  for (int j = jmin; j <= jmax; ++j)
64  {
65  pmij->x = 0.0;
66 
67  ++pmij;
68  }
69  }
70  ++pmi;
71  }
74  //save_identifier_string("p");
75  fp->save_dvar_matrix_position(*this);
76  GRAD_STACK1->set_gradient_stack(dfmatinit);
77  //save_identifier_string("q");
78  }
79 }
Description not yet available.
Definition: fvar.hpp:920
int allocated(const ivector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: fvar_a59.cpp:13
double_and_int * get_va()
Definition: fvar.hpp:2231
void initialize(void)
Zero initialize allocated dvar_matrix, then saves adjoint function and position data.
Definition: fvar_ma7.cpp:48
void dfmatinit(void)
Adjoint function for dvar_matrix::initialize.
Definition: fvar_ma7.cpp:31
ADMB variable vector.
Definition: fvar.hpp:2172
Holds the data for the prevariable class.
Definition: fvar.hpp:191
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.
Definition: fvar.hpp:1045
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void save_dmatrix_derivatives_na(const dvar_matrix_position &pos) const
Description not yet available.
Definition: cmpdif5.cpp:312
Description not yet available.
Definition: fvar.hpp:2819
int indexmin() const
Definition: fvar.hpp:2287
dvar_matrix_position restore_dvar_matrix_position()
Definition: cmpdif6.cpp:114
static _THREAD DF_FILE * fp
int indexmax(void) const
Definition: fvar.hpp:2572
void save_dvar_matrix_position(const dvar_matrix &m)
Definition: cmpdif5.cpp:345
Stores the adjoint gradient data that will be processed by gradcalc.
static _THREAD grad_stack * GRAD_STACK1
void initialize(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: dmat7.cpp:12
int indexmin(void) const
Definition: fvar.hpp:2568
int indexmax() const
Definition: fvar.hpp:2292
double x
&lt; value of the variable
Definition: fvar.hpp:195
dvar_vector * m
Definition: fvar.hpp:2484
Description not yet available.
Definition: fvar.hpp:4843