a_double_property#

View page source

Properties of an a_double Object#

Syntax#

d = ad.value ()
p = ad.parameter ()
v = ad.variable ()
e = ad.near_equal ( aother )
ap = ad.var2par ()

value#

The result d has c++ prototype

      double d

It is the value of ad , as a constant function.

Restriction#

The object ad must 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; see var2par below.

parameter#

The result p has c++ 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 c++ 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 aother , and the result e , c++ have prototype

      const a_double& aother
      bool e

The result is true if ad is nearly equal to aother . To be specific, the result is

\[| d - o | \leq 100 \; \varepsilon \; ( |d| + |o| )\]

where d and o are the value corresponding to ad and aother and \(\varepsilon\) is machine epsilon corresponding to the type double .

var2par#

The result has c++ prototype

      a_double ap

It has the same value as ad and is sure to be a parameter ( ad may or may not be a variable). This can be useful when you want to access the value of ad while is a variable; value above.

Example#

c++, python.