ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_opr.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  */
12 #include "fvar.hpp"
13 
14 #ifdef __TURBOC__
15  #pragma hdrstop
16  #include <iostream.h>
17 #endif
18 
19 #ifdef __ZTC__
20  #include <iostream.hpp>
21 #endif
22 
23 
24 #include <stdio.h>
25 #include <math.h>
26 
27 
32 void prevariable::operator+=(const double uu)
33  {
34  (*v).x+=uu;
35  }
36 
41 void prevariable::operator-=(const double uu)
42  {
43  (*v).x-=uu;
44  }
45 
51 {
53 
54  RETURN_PTR->v->x = (*v1.v).x + (*v2.v).x;
56  &(RETURN_PTR->v->x),&((*v1.v).x), &((*v2.v).x));
57 
58  return *RETURN_PTR;
59 }
60 
66 {
68 
69  double_and_int* di1 = v1.v;
70  double_and_int* di2 = v2.v;
71  RETURN_PTR->v->x = di1->x * di2->x;
73  &(RETURN_PTR->v->x),
74  &(di1->x), di2->x, &(di2->x), di1->x);
75 
76  return *RETURN_PTR;
77  }
78 
84  {
85  return(v->x==value(v1));
86  }
87 
93  {
94  return(v->x<=value(v1));
95  }
96 
102  {
103  return(v->x<value(v1));
104  }
105 
111  {
112  return(v->x>value(v1));
113  }
114 
120  {
121  return(v->x >=value(v1));
122  }
123 
129  {
130  return(v->x!=value(v1));
131  }
void set_gradient_stack4(void(*func)(void), double *dep_addr, double *ind_addr1, double *ind_addr2)
Description not yet available.
Definition: fvar.hpp:1229
Base class for dvariable.
Definition: fvar.hpp:1315
void default_evaluation3(void)
Description not yet available.
Definition: def_eval.cpp:157
#define x
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:132
int operator==(const prevariable &v1) const
Description not yet available.
Definition: fvar_opr.cpp:83
void default_evaluation4(void)
Description not yet available.
Definition: def_eval.cpp:251
dmatrix operator*(const d3_array &t, const dvector &v)
Description not yet available.
Definition: d3arr12.cpp:17
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
static dvariable * next_RETURN_PTR()
Definition: gradstrc.cpp:457
void operator-=(const prevariable &t1)
Description not yet available.
Definition: fvar_o11.cpp:34
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
friend double & value(const prevariable &v1)
Definition: fvar.hpp:1495
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
int operator<=(const prevariable &v1) const
Description not yet available.
Definition: fvar_opr.cpp:92
int operator!=(const prevariable &v1) const
Description not yet available.
Definition: fvar_opr.cpp:128
int operator<(const prevariable &v1) const
Description not yet available.
Definition: fvar_opr.cpp:101
static _THREAD grad_stack * GRAD_STACK1
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518
double x
&lt; value of the variable
Definition: fvar.hpp:195
int operator>=(const prevariable &v1) const
Description not yet available.
Definition: fvar_opr.cpp:119
int operator>(const prevariable &v1) const
Description not yet available.
Definition: fvar_opr.cpp:110