ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_a39.cpp
Go to the documentation of this file.
1 
8 #include "fvar.hpp"
9 
10 void DF_dv_cdble_diff(void);
11 
19 dvar_vector operator-(const dvar_vector& t1, const double x)
20 {
23 
24  dvar_vector tmp(t1.indexmin(),t1.indexmax());
25  save_identifier_string("ucbb");
26  for (int i=t1.indexmin(); i<=t1.indexmax(); i++)
27  {
28  tmp.elem_value(i)=t1.elem_value(i)-x;
29  }
33  save_identifier_string("dduu");
36  return(tmp);
37 }
38 
42 void DF_dv_cdble_diff(void)
43 {
45 
50  dvector dft1(t1_pos.indexmin(),t1_pos.indexmax());
52  //double xinv=1./x;
53  for (int i=t1_pos.indexmax(); i>=t1_pos.indexmin(); i--)
54  {
55  // tmp.elem_value(i)=t1.elem_value(i)-value(x);
56  //tmp.elem_value(i)=value(x)*t1.elem_value(i)/value(x);
57  dft1(i)=dftmp(i);
58  }
59  dft1.save_dvector_derivatives(t1_pos);
60 }
double & elem_value(int i)
Definition: fvar.hpp:2226
d3_array operator-(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
Definition: d3arr2a.cpp:152
#define x
Vector of double precision numbers.
Definition: dvector.h:50
Description not yet available.
Definition: fvar.hpp:4814
int indexmin() const
Definition: fvar.hpp:4827
ADMB variable vector.
Definition: fvar.hpp:2172
void verify_identifier_string(const char *)
Verifies gradient stack string.
Definition: cmpdif3.cpp:149
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
int indexmax() const
Definition: fvar.hpp:4831
dvar_vector_position restore_dvar_vector_position()
Definition: cmpdif4.cpp:69
void RETURN_ARRAYS_INCREMENT()
Definition: gradstrc.cpp:478
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static _THREAD gradient_structure * _instance
int save_identifier_string(const char *)
Writes a gradient stack verification string.
Definition: cmpdif2.cpp:315
int indexmin() const
Definition: fvar.hpp:2287
void save_dvar_vector_position(const dvar_vector &v)
Definition: cmpdif3.cpp:214
static _THREAD DF_FILE * fp
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 RETURN_ARRAYS_DECREMENT()
Definition: gradstrc.cpp:511
void DF_dv_cdble_diff(void)
Adjoint function for operator-(const dvar_vector&amp;, const double)
Definition: fvar_a39.cpp:42
static _THREAD grad_stack * GRAD_STACK1
class for things related to the gradient structures, including dimension of arrays, size of buffers, etc.
int indexmax() const
Definition: fvar.hpp:2292