Sundance::ADReal Class Reference

List of all members.

Public Member Functions

 ADReal ()
 ADReal (double value, int direction, int spatialDimension)
 ADReal (double value, int spatialDimension)
 ADReal (double value, const Point &gradient)
ADReal operator- () const
ADRealoperator+= (const ADReal &other)
ADRealoperator-= (const ADReal &other)
ADRealoperator*= (const ADReal &other)
ADRealoperator/= (const ADReal &other)
ADRealoperator+= (const double &scalar)
ADRealoperator-= (const double &scalar)
ADRealoperator*= (const double &scalar)
ADRealoperator/= (const double &scalar)
ADReal operator+ (const ADReal &other) const
ADReal operator- (const ADReal &other) const
ADReal operator* (const ADReal &other) const
ADReal operator/ (const ADReal &other) const
ADReal operator+ (const double &scalar) const
ADReal operator- (const double &scalar) const
ADReal operator* (const double &scalar) const
ADReal operator/ (const double &scalar) const
const double & value () const
const Pointgradient () const
void reciprocate ()

Static Public Member Functions

static double & totalFlops ()
static void addFlops (const double &flops)

Private Attributes

double value_
Point gradient_

Related Functions

(Note that these are not member functions.)

ADReal operator+ (const double &scalar, const ADReal &a)
ADReal operator- (const double &scalar, const ADReal &a)
ADReal operator* (const double &scalar, const ADReal &a)
ADReal operator/ (const double &scalar, const ADReal &a)


Detailed Description

First-order automatic differentiation of a multivariable function.
Author:
Kevin Long

Definition at line 46 of file SundanceADReal.hpp.


Constructor & Destructor Documentation

Sundance::ADReal::ADReal (  )  [inline]

Create an ADReal with value and gradient = 0

Definition at line 50 of file SundanceADReal.hpp.

Sundance::ADReal::ADReal ( double  value,
int  direction,
int  spatialDimension 
) [inline]

Create an ADReal object that varies linearly with one coordinate direction

Definition at line 53 of file SundanceADReal.hpp.

References gradient_.

Sundance::ADReal::ADReal ( double  value,
int  spatialDimension 
) [inline]

Create a constant-valued ADReal object in a multidimensional space

Definition at line 62 of file SundanceADReal.hpp.

References gradient_.

Sundance::ADReal::ADReal ( double  value,
const Point gradient 
) [inline]

Create an ADReal with the specified value and gradient

Definition at line 71 of file SundanceADReal.hpp.


Member Function Documentation

static void Sundance::ADReal::addFlops ( const double &  flops  )  [inline, static]

Definition at line 122 of file SundanceADReal.hpp.

References totalFlops().

Referenced by operator*=(), operator+=(), operator-(), operator-=(), operator/=(), and reciprocate().

const Point& Sundance::ADReal::gradient (  )  const [inline]

get the gradient

Definition at line 115 of file SundanceADReal.hpp.

References gradient_.

Referenced by std::operator<<(), and Sundance::pow().

ADReal ADReal::operator* ( const double &  scalar  )  const

scalar multiplication

Definition at line 144 of file SundanceADReal.cpp.

ADReal ADReal::operator* ( const ADReal other  )  const

multiplication

Definition at line 32 of file SundanceADReal.cpp.

ADReal & ADReal::operator*= ( const double &  scalar  ) 

reflexive scalar multiplication

Definition at line 108 of file SundanceADReal.cpp.

References addFlops(), Sundance::Point::dim(), gradient_, and value_.

ADReal & ADReal::operator*= ( const ADReal other  ) 

reflexive multiplication

Definition at line 66 of file SundanceADReal.cpp.

References addFlops(), Sundance::Point::dim(), gradient_, and value_.

ADReal ADReal::operator+ ( const double &  scalar  )  const

scalar addition

Definition at line 130 of file SundanceADReal.cpp.

ADReal ADReal::operator+ ( const ADReal other  )  const

addition

Definition at line 18 of file SundanceADReal.cpp.

ADReal & ADReal::operator+= ( const double &  scalar  ) 

reflexive scalar addition

Definition at line 93 of file SundanceADReal.cpp.

References addFlops(), and value_.

ADReal & ADReal::operator+= ( const ADReal other  ) 

reflexive addition

Definition at line 46 of file SundanceADReal.cpp.

References addFlops(), Sundance::Point::dim(), gradient_, and value_.

ADReal ADReal::operator- ( const double &  scalar  )  const

scalar subtraction

Definition at line 137 of file SundanceADReal.cpp.

ADReal ADReal::operator- ( const ADReal other  )  const

subtraction

Definition at line 25 of file SundanceADReal.cpp.

ADReal ADReal::operator- (  )  const

unary minus

Definition at line 8 of file SundanceADReal.cpp.

References addFlops(), Sundance::Point::dim(), gradient_, and value_.

ADReal & ADReal::operator-= ( const double &  scalar  ) 

reflexive scalar subtraction

Definition at line 100 of file SundanceADReal.cpp.

References addFlops(), and value_.

ADReal & ADReal::operator-= ( const ADReal other  ) 

reflexive subtraction

Definition at line 56 of file SundanceADReal.cpp.

References addFlops(), Sundance::Point::dim(), gradient_, and value_.

ADReal ADReal::operator/ ( const double &  scalar  )  const

scalar division

Definition at line 151 of file SundanceADReal.cpp.

ADReal ADReal::operator/ ( const ADReal other  )  const

division

Definition at line 39 of file SundanceADReal.cpp.

ADReal & ADReal::operator/= ( const double &  scalar  ) 

reflexive scalar division

Definition at line 118 of file SundanceADReal.cpp.

References addFlops(), Sundance::Point::dim(), gradient_, and value_.

ADReal & ADReal::operator/= ( const ADReal other  ) 

reflexive division

Definition at line 76 of file SundanceADReal.cpp.

References addFlops(), Sundance::Point::dim(), gradient_, and value_.

void ADReal::reciprocate (  ) 

Definition at line 184 of file SundanceADReal.cpp.

References addFlops(), Sundance::Point::dim(), gradient_, and value_.

Referenced by Sundance::operator/().

static double& Sundance::ADReal::totalFlops (  )  [inline, static]

Definition at line 119 of file SundanceADReal.hpp.

Referenced by addFlops().

const double& Sundance::ADReal::value (  )  const [inline]


Friends And Related Function Documentation

ADReal operator* ( const double &  scalar,
const ADReal a 
) [related]

Definition at line 171 of file SundanceADReal.cpp.

ADReal operator+ ( const double &  scalar,
const ADReal a 
) [related]

Definition at line 161 of file SundanceADReal.cpp.

ADReal operator- ( const double &  scalar,
const ADReal a 
) [related]

Definition at line 166 of file SundanceADReal.cpp.

ADReal operator/ ( const double &  scalar,
const ADReal a 
) [related]

Definition at line 176 of file SundanceADReal.cpp.


Member Data Documentation

double Sundance::ADReal::value_ [private]

Site Contact