20 #include <iostream.hpp>
21 #include <iomanip.hpp>
36 cerr <<
"Error -- base = 0 in function"
37 " prevariable& pow(const prevariable& v1, const double u)" <<
endl;
47 &(RETURN_PTR->
v->
x), &(v1.
v->
x), u * x );
71 &(RETURN_PTR->
v->
x), &(v1.
v->
x), ::
cos(v1.
v->
x) );
90 &(RETURN_PTR->
v->
x), &(v1.
v->
x),
92 1./((1.+tmp*tmp)*2.8));
110 RETURN_PTR->
v->
x=
fabs(tmp);
113 &(v1.
v->
x), tmp >= 0.0 ? 1.0 : -1.0);
127 #define cutoff 0.001 // h
128 #define cutoff2 0.000001
139 RETURN_PTR->
v->
x=tmp;
155 double t2 = tmp * tmp;
158 RETURN_PTR->
v->
x=t2*(a-b*tmp1);
161 &(v1.
v->
x),tmp*(2*a-3*b*tmp1) );
165 RETURN_PTR->
v->
x=t2*(a+b*tmp1);
168 &(v1.
v->
x),tmp1*(2*a+3*b*tmp1));
201 &(v1.
v->
x),1./(v1.
v->
x) );
216 &(RETURN_PTR->
v->
x),&(v1.
v->
x),
217 1./(v1.
v->
x)/2.3025851);
Base class for dvariable.
double sigmoid(const double v1)
Returns computed sigmoid value at v1.
dvector log10(const dvector &vec)
Returns dvector with the common (base-10) logarithm of vec.
void initialize(void)
Description not yet available.
df1_one_variable atan(const df1_one_variable &x)
d3_array sin(const d3_array &arr3)
Returns d3_array results with computed sin from elements in arr3.
df1_two_variable fabs(const df1_two_variable &x)
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.
double sfabs(const double v1)
Description not yet available.
prnstream & endl(prnstream &)
static dvariable * next_RETURN_PTR()
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void default_evaluation(void)
Description not yet available.
double_and_int * v
pointer to the data
d3_array cos(const d3_array &arr3)
Returns d3_array results with computed cos from elements in arr3.
static _THREAD grad_stack * GRAD_STACK1
Fundamental data type for reverse mode automatic differentiation.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double x
< value of the variable
d3_array pow(const d3_array &m, int e)
Description not yet available.