Prev Next

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
Properties of an a_double Object

Syntax
d = ad.value()
p = ad.parameter()
v = ad.variable()
n = ad.near_equal(ae)


This object has prototype
     const a_double& 
ad

value
The result d has prototype
     double 
d
It is the value of ad , as a constant function. In addition it must represent a constant functions; i.e., ad not depend on the independent variables when ad.value() is called. If it does depend on the independent variables, you will have to wait until the current recording is terminated before you can access its value.

parameter
The result p has prototype
     bool 
p
It is true if ad represent a constant functions; i.e., ad not depend on the independent variables.

variable
The result v has prototype
     bool 
v
It is true if ad is not a constant function; i.e., ad depends on the independent variables.

near_equal
The argument ae , and the result n , have prototype
     const a_double& 
ae
     bool 
n
The result is true if ae is nearly equal to ae . To be specific, the result is @[@ | d - e | \leq 100 \; \varepsilon \; ( |d| + |e| ) @]@ where d and e are the value corresponding to ad and ae and @(@ \varepsilon @)@ is machine epsilon corresponding to the type double.

Example
C++ , Octave , Perl , Python .
Input File: lib/a_double.cpp