Prev Next

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
AD Conditional Assignment

Syntax
target.cond_assign(copleftrightif_trueif_false)

Purpose
The code
     if( 
left cop right )
          
target = if_true
     else
          
target = if_false
records either the true or false case depending on the value of left and right ; see a_fun_ctor . If left or right is a variable , it may be desirable to switch between if_true and if_false depending of the value of the independent variable during calls to order zero a_fun_forward . The cond_assign does this.

target
This object has prototype
     a_double& 
target

cop
This argument has prototype
     const char *cop
The comparison is
     
left cop right
where cop is one of the following:
cop
< less than
<= less than or equal
== equal
>= greater than or equal
> greater than

left
This argument has prototype
     const a_double& 
left
It specifies the left operand in the comparison.

right
This argument has prototype
     const a_double& 
right
It specifies the right operand in the comparison.

if_true
This argument has prototype
     const a_double& 
if_true
It specifies the value assigned to ad if the result of the comparison is true.

if_false
This argument has prototype
     const a_double& 
if_false
It specifies the value assigned to ad if the result of the comparison is false.

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