SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
mth::AD< T, N > Class Template Reference

forward automatic differentiation variable More...

Public Types

enum  
 the number of derivatives
 

Public Member Functions

 AD ()
 default constructor
 
 AD (double x)
 default constructor from a double
 
 AD (AD< T, N > const &other)
 copy constructor
 
unsigned int size () const
 get the size of the derivative array
 
void diff (unsigned int i, unsigned int n=0)
 set as the ith variable of N
 
double & val ()
 get the value of the variable (mutable)
 
const double & val () const
 get the value of the variable (immutable)
 
T & dx (unsigned int i)
 get the ith derivative value (mutable)
 
const T & dx (unsigned int i) const
 get the ith derivative value (immutable)
 
void resize (unsigned int i)
 resize for static AD (no-op)
 
 operator double () const
 type conversion from AD to double
 
AD< T, N > & operator= (double other)
 assignment to a double
 
AD< T, N > & operator= (AD< T, N > const &other)
 assignment to another AD variable
 
AD< T, N > & operator+= (double other)
 addition assignment with a double
 
template<class B >
AD< T, N > & operator+= (AD< B, N > const &other)
 addition assignment with another AD variable
 
AD< T, N > & operator-= (double other)
 subtraction assignment with a double
 
template<class B >
AD< T, N > & operator-= (AD< B, N > const &other)
 subtraction assignment with another AD variable
 
AD< T, N > & operator*= (double other)
 multiplication assignment with a double
 
template<class B >
AD< T, N > & operator*= (AD< B, N > const &other)
 multiplication assignment with another AD variable
 
AD< T, N > & operator/= (double other)
 division assignment with a double
 
template<class B >
AD< T, N > & operator/= (AD< B, N > const &other)
 division assignment with another AD variable
 

Public Attributes

double x_
 the variable value
 
dx_ [N]
 the derivative array
 

Detailed Description

template<class T = double, unsigned int N = 0>
class mth::AD< T, N >

forward automatic differentiation variable

Definition at line 15 of file mthAD.h.


The documentation for this class was generated from the following file: