The AutoDerivative<T> works well, and it works with blitz if you create a blitz::Array<AutoDerivative<T>, D>, however the performance tends to be a bit poor for larger Arrays because of all the temporaries that get created.
More...
|
| ArrayAd (const blitz::Array< AutoDerivative< T >, D > &V) |
|
| ArrayAd (const ArrayAd< T, D > &V) |
|
| ArrayAd (const blitz::Array< T, D > &Val, const blitz::Array< T, D+1 > &Jac, bool Is_const=false, bool Force_copy=false) |
|
| ArrayAd (const blitz::Array< T, D > &Val, bool Force_copy=false) |
|
| ArrayAd (const blitz::Array< T, D > &Val, int nvar, bool Force_copy=false) |
|
| ArrayAd () |
|
| ArrayAd (int n1, int nvar) |
|
| ArrayAd (int n1, int n2, int nvar) |
|
| ArrayAd (int n1, int n2, int n3, int nvar) |
|
| ArrayAd (int n1, int n2, int n3, int n4, int nvar) |
|
| ArrayAd (int n1, int n2, int n3, int n4, int n5, int nvar) |
|
| ArrayAd (const blitz::TinyVector< int, D > &Shape, int nvar) |
|
int | cols () const |
|
ArrayAd< T, D > | copy () const |
|
int | depth () const |
|
bool | is_constant () const |
|
const blitz::Array< T, D+1 > | jacobian () const |
|
blitz::Array< T, D+1 > & | jacobian () |
|
int | number_variable () const |
|
bool | operator!= (const ArrayAd< T, D > &A) const |
|
AutoDerivativeRef< T > | operator() (int i1) |
|
AutoDerivativeRef< T > | operator() (int i1, int i2) |
|
AutoDerivativeRef< T > | operator() (int i1, int i2, int i3) |
|
AutoDerivativeRef< T > | operator() (int i1, int i2, int i3, int i4) |
|
AutoDerivativeRef< T > | operator() (int i1, int i2, int i3, int i4, int i5) |
|
AutoDerivative< T > | operator() (int i1) const |
|
AutoDerivative< T > | operator() (int i1, int i2) const |
|
AutoDerivative< T > | operator() (int i1, int i2, int i3) const |
|
AutoDerivative< T > | operator() (int i1, int i2, int i3, int i4) const |
|
AutoDerivative< T > | operator() (int i1, int i2, int i3, int i4, int i5) const |
|
ArrayAd< T, 1 > | operator() (const blitz::Range &r1) const |
|
template<typename T1 , typename T2 > |
ArrayAd< T, blitz::SliceInfo< T, T1, T2 >::rank > | operator() (T1 r1, T2 r2) const |
|
template<typename T1 , typename T2 , typename T3 > |
ArrayAd< T, blitz::SliceInfo< T, T1, T2, T3 >::rank > | operator() (T1 r1, T2 r2, T3 r3) const |
|
template<typename T1 , typename T2 , typename T3 , typename T4 > |
ArrayAd< T, blitz::SliceInfo< T, T1, T2, T3, T4 >::rank > | operator() (T1 r1, T2 r2, T3 r3, T4 r4) const |
|
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > |
ArrayAd< T, blitz::SliceInfo< T, T1, T2, T3, T4, T5 >::rank > | operator() (T1 r1, T2 r2, T3 r3, T4 r4, T5 r5) const |
|
ArrayAd & | operator= (const ArrayAd< T, D > &V) |
|
ArrayAd & | operator= (const blitz::Array< T, D > &V) |
|
ArrayAd & | operator= (const T &V) |
|
ArrayAd & | operator= (const AutoDerivative< T > &V) |
|
bool | operator== (const ArrayAd< T, D > &A) const |
| We define != in terms of this operator. More...
|
|
void | reference (const ArrayAd< T, D > &V) |
|
void | resize (const blitz::TinyVector< int, D > &Shape, int nvar) |
|
void | resize (int n1, int nvar) |
|
void | resize (int n1, int n2, int nvar) |
|
void | resize (int n1, int n2, int n3, int nvar) |
|
void | resize (int n1, int n2, int n3, int n4, int nvar) |
|
void | resize (int n1, int n2, int n3, int n4, int n5, int nvar) |
|
void | resize_number_variable (int nvar) |
|
int | rows () const |
|
const blitz::TinyVector< int, D > & | shape () const |
|
blitz::Array< AutoDerivative< T >, D > | to_array () const |
|
const blitz::Array< T, D > & | value () const |
|
blitz::Array< T, D > & | value () |
|
template<class T, int D>
class FullPhysics::ArrayAd< T, D >
The AutoDerivative<T> works well, and it works with blitz if you create a blitz::Array<AutoDerivative<T>, D>, however the performance tends to be a bit poor for larger Arrays because of all the temporaries that get created.
This class keeps all the values together in one blitz::Array, and all the gradients in one Jacobian blitz::Array. This is less flexible than a blitz::Array<AutoDerivative<T>, D>, but the peformance is much better. We can convert to and from AutoDerivative<T> as needed, so this gives us the best of both worlds - ArrayAd when we don't need the extra functionality, convert to AutoDerivative<T> when needed.
A note on the implementation, blitz doesn't handle Range::all() well with a zero size array. So we always ensure that the Jacobian has at least one column, even for constant values with the nvars = 0. We track if this is a constant separately.
We can get odd floating point errors (particularly on Ubuntu), if we copy garbage values. So even though we don't use the Jacobian, if the data is constant, we initialize it to 0.
Definition at line 40 of file array_ad.h.