Sacado Package Browser (Single Doxygen Collection) Version of the Day
Public Member Functions | Private Attributes
Sacado::Fad::DynamicStorage< T, S > Class Template Reference

Derivative array storage class using dynamic memory allocation. More...

#include <Sacado_Fad_DynamicStorage.hpp>

Inheritance diagram for Sacado::Fad::DynamicStorage< T, S >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DynamicStorage (const T &x)
 Default constructor.
 DynamicStorage (const int sz, const T &x)
 Constructor with size sz.
 DynamicStorage (const DynamicStorage &x)
 Copy constructor.
 ~DynamicStorage ()
 Destructor.
DynamicStorageoperator= (const DynamicStorage &x)
 Assignment.
int size () const
 Returns number of derivative components.
int length () const
 Returns array length.
void resize (int sz)
 Resize the derivative array to sz.
void expand (int sz)
 Expand derivative array to size sz.
void zero ()
 Zero out derivative array.
const T & val () const
 Returns value.
T & val ()
 Returns value.
const S * dx () const
 Returns derivative array.
dx (int i) const
 Returns derivative component i with bounds checking.
S & fastAccessDx (int i)
 Returns derivative component i without bounds checking.
const S & fastAccessDx (int i) const
 Returns derivative component i without bounds checking.

Private Attributes

val_
 Value.
int sz_
 Derivative array size.
int len_
 Derivative array length.
S * dx_
 Derivative array.

Detailed Description

template<typename T, typename S = T>
class Sacado::Fad::DynamicStorage< T, S >

Derivative array storage class using dynamic memory allocation.

Definition at line 44 of file Sacado_Fad_DynamicStorage.hpp.


Constructor & Destructor Documentation

template<typename T, typename S = T>
Sacado::Fad::DynamicStorage< T, S >::DynamicStorage ( const T &  x) [inline]

Default constructor.

Definition at line 49 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
Sacado::Fad::DynamicStorage< T, S >::DynamicStorage ( const int  sz,
const T &  x 
) [inline]

Constructor with size sz.

Initializes derivative array 0 of length sz

Definition at line 56 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
Sacado::Fad::DynamicStorage< T, S >::DynamicStorage ( const DynamicStorage< T, S > &  x) [inline]

Copy constructor.

Definition at line 62 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
Sacado::Fad::DynamicStorage< T, S >::~DynamicStorage ( ) [inline]

Destructor.

Definition at line 68 of file Sacado_Fad_DynamicStorage.hpp.


Member Function Documentation

template<typename T, typename S = T>
DynamicStorage& Sacado::Fad::DynamicStorage< T, S >::operator= ( const DynamicStorage< T, S > &  x) [inline]

Assignment.

Definition at line 74 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
int Sacado::Fad::DynamicStorage< T, S >::size ( ) const [inline]

Returns number of derivative components.

Definition at line 94 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
int Sacado::Fad::DynamicStorage< T, S >::length ( ) const [inline]

Returns array length.

Definition at line 97 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
void Sacado::Fad::DynamicStorage< T, S >::resize ( int  sz) [inline]

Resize the derivative array to sz.

Note: This does not necessarily preserve derivative components.

Definition at line 103 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
void Sacado::Fad::DynamicStorage< T, S >::expand ( int  sz) [inline]

Expand derivative array to size sz.

This method preserves any existing derivative components and sets any that are added to zero.

Definition at line 118 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
void Sacado::Fad::DynamicStorage< T, S >::zero ( ) [inline]

Zero out derivative array.

Definition at line 133 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
const T& Sacado::Fad::DynamicStorage< T, S >::val ( ) const [inline]

Returns value.

Definition at line 138 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
T& Sacado::Fad::DynamicStorage< T, S >::val ( ) [inline]

Returns value.

Definition at line 141 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
const S* Sacado::Fad::DynamicStorage< T, S >::dx ( ) const [inline]

Returns derivative array.

Definition at line 144 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
S Sacado::Fad::DynamicStorage< T, S >::dx ( int  i) const [inline]

Returns derivative component i with bounds checking.

Definition at line 147 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
S& Sacado::Fad::DynamicStorage< T, S >::fastAccessDx ( int  i) [inline]

Returns derivative component i without bounds checking.

Definition at line 150 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
const S& Sacado::Fad::DynamicStorage< T, S >::fastAccessDx ( int  i) const [inline]

Returns derivative component i without bounds checking.

Definition at line 153 of file Sacado_Fad_DynamicStorage.hpp.


Member Data Documentation

template<typename T, typename S = T>
T Sacado::Fad::DynamicStorage< T, S >::val_ [private]

Value.

Definition at line 158 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
int Sacado::Fad::DynamicStorage< T, S >::sz_ [private]

Derivative array size.

Definition at line 161 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
int Sacado::Fad::DynamicStorage< T, S >::len_ [private]

Derivative array length.

Definition at line 164 of file Sacado_Fad_DynamicStorage.hpp.

template<typename T, typename S = T>
S* Sacado::Fad::DynamicStorage< T, S >::dx_ [private]

Derivative array.

Definition at line 167 of file Sacado_Fad_DynamicStorage.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines