Sacado::LFad::LogicalSparseImp< ValT, LogT > Class Template Reference

Implementation class for computing the logical sparsity of a derivative using forward-mode AD. More...

#include <Sacado_LFad_LogicalSparse.hpp>

Inheritance diagram for Sacado::LFad::LogicalSparseImp< ValT, LogT >:

Inheritance graph
[legend]
List of all members.

Initialization methods

 LogicalSparseImp ()
 Default constructor.
 LogicalSparseImp (const value_type &x)
 Constructor with supplied value x.
 LogicalSparseImp (const int sz, const value_type &x)
 Constructor with size sz and value x.
 LogicalSparseImp (const int sz, const int i, const value_type &x)
 Constructor with size sz, index i, and value x.
 LogicalSparseImp (const LogicalSparseImp &x)
 Copy constructor.
template<typename S>
 LogicalSparseImp (const Expr< S > &x)
 Copy constructor from any Expression object.
 ~LogicalSparseImp ()
 Destructor.
void diff (const int ith, const int n)
 Set LogicalSparseImp object as the ith independent variable.
void resize (int sz)
 Resize derivative array to length sz.
void zero ()
 Zero out the derivative array.

Value accessor methods

const value_typeval () const
 Returns value.
value_typeval ()
 Returns value.

Derivative accessor methods

int size () const
 Returns number of derivative components.
bool hasFastAccess () const
 Returns true if derivative array is not empty.
bool isPassive () const
 Returns true if derivative array is empty.
void setIsConstant (bool is_const)
 Set whether variable is constant.
const logical_typedx () const
 Returns derivative array.
logical_type dx (int i) const
 Returns derivative component i with bounds checking.
logical_typefastAccessDx (int i)
 Returns derivative component i without bounds checking.
const logical_typefastAccessDx (int i) const
 Returns derivative component i without bounds checking.

Assignment operators

LogicalSparseImpoperator= (const value_type &val)
 Assignment operator with constant right-hand-side.
LogicalSparseImpoperator= (const LogicalSparseImp &x)
 Assignment with Expr right-hand-side.
template<typename S>
LogicalSparseImpoperator= (const Expr< S > &x)
 Assignment operator with any expression right-hand-side.

Unary operators

LogicalSparseImpoperator+= (const value_type &x)
 Addition-assignment operator with constant right-hand-side.
LogicalSparseImpoperator-= (const value_type &x)
 Subtraction-assignment operator with constant right-hand-side.
LogicalSparseImpoperator *= (const value_type &x)
 Multiplication-assignment operator with constant right-hand-side.
LogicalSparseImpoperator/= (const value_type &x)
 Division-assignment operator with constant right-hand-side.
template<typename S>
LogicalSparseImpoperator+= (const Expr< S > &x)
 Addition-assignment operator with Expr right-hand-side.
template<typename S>
LogicalSparseImpoperator-= (const Expr< S > &x)
 Subtraction-assignment operator with Expr right-hand-side.
template<typename S>
LogicalSparseImpoperator *= (const Expr< S > &x)
 Multiplication-assignment operator with Expr right-hand-side.
template<typename S>
LogicalSparseImpoperator/= (const Expr< S > &x)
 Division-assignment operator with Expr right-hand-side.

Public Types

typedef ValT value_type
 Typename of values (e.g., double).
typedef LogT logical_type
 Logical type (i.e., type for derivative array components (e.g., bool).

Protected Attributes

Fad::DynamicStorage< value_type,
logical_type
s_
 Value & Sparsity.

Detailed Description

template<typename ValT, typename LogT>
class Sacado::LFad::LogicalSparseImp< ValT, LogT >

Implementation class for computing the logical sparsity of a derivative using forward-mode AD.

Definition at line 56 of file Sacado_LFad_LogicalSparse.hpp.


Member Typedef Documentation

template<typename ValT, typename LogT>
typedef ValT Sacado::LFad::LogicalSparseImp< ValT, LogT >::value_type

Typename of values (e.g., double).

Definition at line 61 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
typedef LogT Sacado::LFad::LogicalSparseImp< ValT, LogT >::logical_type

Logical type (i.e., type for derivative array components (e.g., bool).

Definition at line 64 of file Sacado_LFad_LogicalSparse.hpp.


Constructor & Destructor Documentation

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT >::LogicalSparseImp (  )  [inline]

Default constructor.

Definition at line 72 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT >::LogicalSparseImp ( const value_type x  )  [inline]

Constructor with supplied value x.

Initializes value to x and derivative array is empty

Definition at line 78 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT >::LogicalSparseImp ( const int  sz,
const value_type x 
) [inline]

Constructor with size sz and value x.

Initializes value to x and derivative array 0 of length sz

Definition at line 84 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT >::LogicalSparseImp ( const int  sz,
const int  i,
const value_type x 
) [inline]

Constructor with size sz, index i, and value x.

Initializes value to x and derivative array of length sz as row i of the identity matrix, i.e., sets derivative component i to 1 and all other's to zero.

Definition at line 92 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT >::LogicalSparseImp ( const LogicalSparseImp< ValT, LogT > &  x  )  [inline]

Copy constructor.

Definition at line 98 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
template<typename S>
Sacado::LFad::LogicalSparseImp< ValT, LogT >::LogicalSparseImp ( const Expr< S > &  x  )  [inline]

Copy constructor from any Expression object.

Definition at line 59 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT >::~LogicalSparseImp (  )  [inline]

Destructor.

Definition at line 105 of file Sacado_LFad_LogicalSparse.hpp.


Member Function Documentation

template<typename ValT, typename LogT>
void Sacado::LFad::LogicalSparseImp< ValT, LogT >::diff ( const int  ith,
const int  n 
) [inline]

Set LogicalSparseImp object as the ith independent variable.

Sets the derivative array of length n to the ith row of the identity matrix and has the same affect as the Implementation(const int sz, const int i, const T & x) constructor.

Definition at line 83 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
void Sacado::LFad::LogicalSparseImp< ValT, LogT >::resize ( int  sz  )  [inline]

Resize derivative array to length sz.

This method does not (re)initialize the derivative components, so any previous values may be lost. Also any pointers to derivative components may be invalid.

Definition at line 122 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
void Sacado::LFad::LogicalSparseImp< ValT, LogT >::zero (  )  [inline]

Zero out the derivative array.

Definition at line 125 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
const value_type& Sacado::LFad::LogicalSparseImp< ValT, LogT >::val (  )  const [inline]

Returns value.

Definition at line 135 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
value_type& Sacado::LFad::LogicalSparseImp< ValT, LogT >::val (  )  [inline]

Returns value.

Definition at line 138 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
int Sacado::LFad::LogicalSparseImp< ValT, LogT >::size (  )  const [inline]

Returns number of derivative components.

Definition at line 148 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
bool Sacado::LFad::LogicalSparseImp< ValT, LogT >::hasFastAccess (  )  const [inline]

Returns true if derivative array is not empty.

Definition at line 151 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
bool Sacado::LFad::LogicalSparseImp< ValT, LogT >::isPassive (  )  const [inline]

Returns true if derivative array is empty.

Definition at line 154 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
void Sacado::LFad::LogicalSparseImp< ValT, LogT >::setIsConstant ( bool  is_const  )  [inline]

Set whether variable is constant.

Definition at line 157 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
const logical_type* Sacado::LFad::LogicalSparseImp< ValT, LogT >::dx (  )  const [inline]

Returns derivative array.

Definition at line 163 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
logical_type Sacado::LFad::LogicalSparseImp< ValT, LogT >::dx ( int  i  )  const [inline]

Returns derivative component i with bounds checking.

Definition at line 166 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
logical_type& Sacado::LFad::LogicalSparseImp< ValT, LogT >::fastAccessDx ( int  i  )  [inline]

Returns derivative component i without bounds checking.

Definition at line 170 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
const logical_type& Sacado::LFad::LogicalSparseImp< ValT, LogT >::fastAccessDx ( int  i  )  const [inline]

Returns derivative component i without bounds checking.

Definition at line 173 of file Sacado_LFad_LogicalSparse.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator= ( const value_type val  )  [inline]

Assignment operator with constant right-hand-side.

Reimplemented in Sacado::LFad::LogicalSparse< ValT, LogT >.

Definition at line 96 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
LogicalSparseImp& Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator= ( const LogicalSparseImp< ValT, LogT > &  x  ) 

Assignment with Expr right-hand-side.

template<typename ValT, typename LogT>
template<typename S>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator= ( const Expr< S > &  x  )  [inline]

Assignment operator with any expression right-hand-side.

Reimplemented in Sacado::LFad::LogicalSparse< ValT, LogT >.

Definition at line 123 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator+= ( const value_type x  )  [inline]

Addition-assignment operator with constant right-hand-side.

Definition at line 147 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator-= ( const value_type x  )  [inline]

Subtraction-assignment operator with constant right-hand-side.

Definition at line 157 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator *= ( const value_type x  )  [inline]

Multiplication-assignment operator with constant right-hand-side.

Definition at line 167 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator/= ( const value_type x  )  [inline]

Division-assignment operator with constant right-hand-side.

Definition at line 177 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
template<typename S>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator+= ( const Expr< S > &  x  )  [inline]

Addition-assignment operator with Expr right-hand-side.

Definition at line 188 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
template<typename S>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator-= ( const Expr< S > &  x  )  [inline]

Subtraction-assignment operator with Expr right-hand-side.

Definition at line 226 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
template<typename S>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator *= ( const Expr< S > &  x  )  [inline]

Multiplication-assignment operator with Expr right-hand-side.

Definition at line 265 of file Sacado_LFad_LogicalSparseImp.hpp.

template<typename ValT, typename LogT>
template<typename S>
Sacado::LFad::LogicalSparseImp< ValT, LogT > & Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator/= ( const Expr< S > &  x  )  [inline]

Division-assignment operator with Expr right-hand-side.

Definition at line 303 of file Sacado_LFad_LogicalSparseImp.hpp.


Member Data Documentation

template<typename ValT, typename LogT>
Fad::DynamicStorage<value_type,logical_type> Sacado::LFad::LogicalSparseImp< ValT, LogT >::s_ [protected]

Value & Sparsity.

Definition at line 233 of file Sacado_LFad_LogicalSparse.hpp.


The documentation for this class was generated from the following files:
Generated on Wed May 12 21:59:12 2010 for Sacado Package Browser (Single Doxygen Collection) by  doxygen 1.4.7