ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_a30.cpp
Go to the documentation of this file.
1 
8 #include "fvar.hpp"
9 
10 void dv_xminuseq(void);
11 
18 {
20 
24  fp->save_dvar_vector_position(*this); // for this->
27  GRAD_STACK1->set_gradient_stack(dv_xminuseq);
28 
29  return *this;
30 }
34 void dv_xminuseq(void)
35 {
37 
38  // int ierr=fsetpos(gradient_structure::get_fp(),&filepos);
43  dvector dfthis=restore_dvar_vector_der_nozero(this_pos);
44  double temp=-sum(dfthis);
45  save_double_derivative(temp,d_pos);
46 }
47 
48 void dv_xpluseq(void);
49 
56 {
58 
62  fp->save_dvar_vector_position(*this); // for this->
65  GRAD_STACK1->set_gradient_stack(dv_xpluseq);
66 
67  return *this;
68 }
72 void dv_xpluseq(void)
73 {
75 
76  // int ierr=fsetpos(gradient_structure::get_fp(),&filepos);
81  dvector dfthis=restore_dvar_vector_der_nozero(this_pos);
82  double temp=sum(dfthis);
83  save_double_derivative(temp,d_pos);
84 }
91 {
92  double_and_int* pv = va + index_min;
93  for (int i = index_min; i <= index_max; ++i)
94  {
95  pv->x -= d;
96  ++pv;
97  }
98 
99  return *this;
100 }
107 {
108  double_and_int* pv = va + index_min;
109  for (int i = index_min; i <= index_max; ++i)
110  {
111  pv->x += d;
112  ++pv;
113  }
114 
115  return *this;
116 }
Description not yet available.
Definition: fvar.hpp:920
Base class for dvariable.
Definition: fvar.hpp:1315
Description not yet available.
Definition: fvar.hpp:4440
Vector of double precision numbers.
Definition: dvector.h:50
friend dvector value(const dvar_vector &v1)
Description not yet available.
Definition: fvar_ar3.cpp:43
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr.cpp:21
Description not yet available.
Definition: fvar.hpp:4814
ADMB variable vector.
Definition: fvar.hpp:2172
void verify_identifier_string(const char *)
Verifies gradient stack string.
Definition: cmpdif3.cpp:149
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
void dv_xpluseq(void)
Adjoint function to compute gradients for dvar_vector::operator+=(const prevariable&amp;).
Definition: fvar_a30.cpp:72
dvar_vector & operator-=(const prevariable &d)
Substracts d from each element of dvar_vector.
Definition: fvar_a30.cpp:17
prevariable_position restore_prevariable_position()
Definition: cmpdif8.cpp:43
void save_prevariable_position(const prevariable &v)
Definition: cmpdif8.cpp:60
dvar_vector_position restore_dvar_vector_position()
Definition: cmpdif4.cpp:69
dvar_vector & operator+=(const prevariable &d)
Adds d to each element of dvar_vector.
Definition: fvar_a30.cpp:55
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int save_identifier_string(const char *)
Writes a gradient stack verification string.
Definition: cmpdif2.cpp:315
dvector restore_dvar_vector_der_nozero(const dvar_vector_position &tmp)
Description not yet available.
Definition: cmpdif5.cpp:185
void save_dvar_vector_position(const dvar_vector &v)
Definition: cmpdif3.cpp:214
void dv_xminuseq(void)
Adjoint function to compute gradients for dvar_vector::operator-=(const prevariable&amp;) ...
Definition: fvar_a30.cpp:34
static _THREAD DF_FILE * fp
int index_min
Definition: fvar.hpp:2176
Stores the adjoint gradient data that will be processed by gradcalc.
double_and_int * va
Definition: fvar.hpp:2175
void save_double_derivative(const double x, const prevariable_position &_pos)
Description not yet available.
Definition: cmpdif8.cpp:28
static _THREAD grad_stack * GRAD_STACK1
double x
&lt; value of the variable
Definition: fvar.hpp:195
int index_max
Definition: fvar.hpp:2177