ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_op9.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 // file: fvar_ops.cpp
12 // operators involving prevariables
13 
14 #include "fvar.hpp"
15 
16 #ifdef __TURBOC__
17  #pragma hdrstop
18  #include <iostream.h>
19 #endif
20 
21 #ifdef __ZTC__
22  #include <iostream.hpp>
23 #endif
24 
25 #include <stdio.h>
26 #include <math.h>
27 
28 void df_plus_eq_pvpv(void);
29  //extern ofstream gradlog;
30 
37 {
38  (*v).x += (*other.v).x;
39 
41  (df_plus_eq_pvpv,&(v->x),&(other.v->x));
42 
43  return *this;
44 }
48 void df_plus_eq_pvpv(void)
49 {
50  //cout << setprecision(13) <<
51  // *gradient_structure::get()->GRAD_STACK1->ptr->ind_addr1 << endl;
52 
53  //cout << setprecision(13) <<
54  // *gradient_structure::get()->GRAD_STACK1->ptr->dep_addr << endl;
55 
56  //gradlog << setprecision(13) <<
57  // *gradient_structure::get()->GRAD_STACK1->ptr->ind_addr1 << endl;
58 
60  *ptr->ind_addr1 += *ptr->dep_addr;
61 
62  //gradlog << setprecision(13) <<
63  // *gradient_structure::get()->GRAD_STACK1->ptr->ind_addr1 << endl;
64 }
Base class for dvariable.
Definition: fvar.hpp:1315
void set_gradient_stack1(void(*func)(void), double *dep_addr, double *ind_addr1)
Sets the gradient stack entry for a function or operator with a single independent variable...
Definition: sgradclc.cpp:385
double * ind_addr1
Pointer to first independent variable.
Definition: fvar.hpp:900
#define x
Holds derivative information for arithmetic operators and math library functions. ...
Definition: fvar.hpp:894
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double_and_int * v
pointer to the data
Definition: fvar.hpp:1333
prevariable & operator+=(const prevariable &)
Prevariable addition assignment operator.
Definition: fvar_op9.cpp:36
grad_stack_entry * ptr
Definition: fvar.hpp:934
void df_plus_eq_pvpv(void)
Computes gradients for prevariable addition assignment operator.
Definition: fvar_op9.cpp:48
static _THREAD grad_stack * GRAD_STACK1
double * dep_addr
Pointer to dependent variable.
Definition: fvar.hpp:899
double x
&lt; value of the variable
Definition: fvar.hpp:195