ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cmpdif11.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 #ifdef __TURBOC__
14  #pragma hdrstop
15  #include <iostream.h>
16 #endif
17 
18 #ifdef __ZTC__
19  #include <iostream.hpp>
20 #endif
21 
22 #include <string.h>
23 
29 {
31 }
32 
38 {
40 }
41 
47 {
49 }
50 
56  const dvar_matrix_position& mpos)
57 {
59 
60  // restores the size, address, and value information for a dvar_matrix
62  //int ierr;
63  int min=out.rowmin();
64  int max=out.rowmax();
65  for (int i=max;i>=min;i--)
66  {
68  out.d(i)=restore_dvar_vector_value(vpos);
69  }
70  return out;
71 }
72 
79  const dvar_matrix_position& mpos)
80 {
82 
83  // restores the size, address, and value information for a dvar_matrix
85  //int ierr;
86  int min=out.rowmin();
87  int max=out.rowmax();
88  for (int i=max;i>=min;i--)
89  {
91  out.d(i)=restore_dvar_vector_value(vpos);
92  }
93  return out;
94 }
95 
101 {
103 }
104 
110 {
112 }
113 
119  const dvar_matrix_position& pos) const
120 {
121  // puts the derivative values in a dvector into a dvar_vector's guts
122  int min=rowmin();
123  int max=rowmax();
124  if (min!=pos.row_min||max!=pos.row_max)
125  {
126  cerr << "Incompatible array sizes in " <<
127  "void dmatrix::save_dmatrix__derivatives(const dvar_matrix_position& pos)"
128  << endl;
129  }
130  for (int i=min;i<=max;i++)
131  {
132  const dvector& xx=(*this)(i);
133  dvector& x=(dvector&) xx;
135  //((const dvector&)x).save_dvector_derivatives(pos1(i));
136  x.save_dvector_derivatives(pos1(i));
137  }
138 }
139 
145  const dvar_matrix_position& pos) const
146 {
147  // puts the derivative values in a dvector into a dvar_vector's guts
148  int min=rowmin();
149  int max=rowmax();
150  if (min!=pos.row_min||max!=pos.row_max)
151  {
152  cerr << "Incompatible array sizes in " <<
153  "void dmatrix::save_dmatrix__derivatives(const dvar_matrix_position& pos)"
154  << endl;
155  }
156  for (int i=min;i<=max;i++)
157  {
158  dvector& x=(dvector&)d(i);
160  x.save_dvector_derivatives(pos1(i));
161  }
162 }
163 
170  (const dvar_matrix_position& _pos)
171 {
174  for (int i=pos.row_max;i>=pos.row_min;i--)
175  {
177  }
178  return tmp;
179 }
180 
186  (const dvar_matrix_position& _pos)
187 {
189  banded_symmetric_dmatrix tmp(pos);
190  for (int i=pos.row_max;i>=pos.row_min;i--)
191  {
193  }
194  return tmp;
195 }
void save_dmatrix_derivatives(const dvar_matrix_position &) const
Description not yet available.
Definition: cmpdif11.cpp:118
Description not yet available.
Definition: fvar.hpp:7981
banded_lower_triangular_dmatrix restore_banded_lower_triangular_dvar_matrix_derivatives(const dvar_matrix_position &_pos)
Description not yet available.
Definition: cmpdif11.cpp:170
void save_dmatrix_derivatives(const dvar_matrix_position &) const
Description not yet available.
Definition: cmpdif11.cpp:144
#define x
Vector of double precision numbers.
Definition: dvector.h:50
int rowmin(void) const
Definition: fvar.hpp:8003
void save_dvar_matrix_value() const
Description not yet available.
Definition: cmpdif11.cpp:28
int rowmin(void) const
Definition: fvar.hpp:8139
int rowmax(void) const
Definition: fvar.hpp:8143
void save_dvector_derivatives(const dvar_vector_position &pos) const
Puts the derivative values in a dvector into a dvar_vector&#39;s guts.
Definition: cmpdif5.cpp:212
Description not yet available.
Definition: fvar.hpp:4814
void save_dmatrix_value(const dmatrix &m)
Definition: cmpdif5.cpp:26
banded_symmetric_dmatrix restore_bounded_symmetric_dvar_matrix_derivatives(const dvar_matrix_position &_pos)
Description not yet available.
Definition: cmpdif11.cpp:186
void save_dvar_matrix_value() const
Description not yet available.
Definition: cmpdif11.cpp:37
void save_dvar_matrix_position() const
Description not yet available.
Definition: cmpdif11.cpp:109
prnstream & endl(prnstream &)
dvar_vector_position restore_dvar_vector_position()
Definition: cmpdif4.cpp:69
#define min(a, b)
Definition: cbivnorm.cpp:188
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
Definition: fvar.hpp:8120
dvector restore_dvar_vector_value(const dvar_vector_position &tmp)
Restores the size, address, and value information for a dvar_vector.
Definition: cmpdif4.cpp:227
void save_dvar_matrix_position() const
Description not yet available.
Definition: cmpdif11.cpp:100
static _THREAD DF_FILE * fp
void save_dvar_matrix_position(const dvar_matrix &m)
Definition: cmpdif5.cpp:345
size_t pos(const adstring &substr, const adstring &s)
Definition: string3.cpp:56
Stores the adjoint gradient data that will be processed by gradcalc.
dvector restore_dvar_vector_derivatives(const dvar_vector_position &tmp)
Description not yet available.
Definition: cmpdif5.cpp:150
void save_dvar_matrix_value(const dvar_matrix &m)
Definition: cmpdif4.cpp:252
void save_dmatrix_value() const
Description not yet available.
Definition: cmpdif11.cpp:46
#define max(a, b)
Definition: cbivnorm.cpp:189
banded_lower_triangular_dmatrix restore_banded_lower_triangular_dvar_matrix_value(const dvar_matrix_position &mpos)
Description not yet available.
Definition: cmpdif11.cpp:78
banded_symmetric_dmatrix restore_banded_symmetric_dvar_matrix_value(const dvar_matrix_position &mpos)
Description not yet available.
Definition: cmpdif11.cpp:55
int rowmax(void) const
Definition: fvar.hpp:8007
Description not yet available.
Definition: fvar.hpp:4843