Sacado  Development
Public Types | Public Member Functions | List of all members
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]
Collaboration diagram for Sacado::LFad::LogicalSparseImp< ValT, LogT >:
Collaboration graph
[legend]

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)
 

Public Member Functions

template<typename S >
Sacado::LFad::LogicalSparseImp< ValT, LogT > & operator= (const Expr< S > &x)
 
template<typename S >
Sacado::LFad::LogicalSparseImp< ValT, LogT > & operator+= (const Sacado::LFad::Expr< S > &x)
 
template<typename S >
Sacado::LFad::LogicalSparseImp< ValT, LogT > & operator-= (const Sacado::LFad::Expr< S > &x)
 
template<typename S >
Sacado::LFad::LogicalSparseImp< ValT, LogT > & operator*= (const Sacado::LFad::Expr< S > &x)
 
template<typename S >
Sacado::LFad::LogicalSparseImp< ValT, LogT > & operator/= (const Sacado::LFad::Expr< S > &x)
 
Initialization methods
 LogicalSparseImp ()
 Default constructor.
 
 LogicalSparseImp (const value_type &x)
 Constructor with supplied value x. More...
 
 LogicalSparseImp (const int sz, const value_type &x)
 Constructor with size sz and value x. More...
 
 LogicalSparseImp (const int sz, const int i, const value_type &x)
 Constructor with size sz, index i, and value x. More...
 
 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. More...
 
template<typename S >
bool isEqualTo (const Expr< S > &x) const
 Returns whether two LFad objects have the same values.
 
Derivative accessor methods
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.
 
Assignment operators
LogicalSparseImp & operator= (const value_type &val)
 Assignment operator with constant right-hand-side.
 
LogicalSparseImp & operator= (const LogicalSparseImp &x)
 Assignment with Expr right-hand-side.
 
template<typename S >
LogicalSparseImp & operator= (const Expr< S > &x)
 Assignment operator with any expression right-hand-side.
 
Unary operators
LogicalSparseImp & operator+= (const value_type &x)
 Addition-assignment operator with constant right-hand-side.
 
LogicalSparseImp & operator-= (const value_type &x)
 Subtraction-assignment operator with constant right-hand-side.
 
LogicalSparseImp & operator*= (const value_type &x)
 Multiplication-assignment operator with constant right-hand-side.
 
LogicalSparseImp & operator/= (const value_type &x)
 Division-assignment operator with constant right-hand-side.
 
template<typename S >
LogicalSparseImp & operator+= (const Expr< S > &x)
 Addition-assignment operator with Expr right-hand-side.
 
template<typename S >
LogicalSparseImp & operator-= (const Expr< S > &x)
 Subtraction-assignment operator with Expr right-hand-side.
 
template<typename S >
LogicalSparseImp & operator*= (const Expr< S > &x)
 Multiplication-assignment operator with Expr right-hand-side.
 
template<typename S >
LogicalSparseImp & operator/= (const Expr< S > &x)
 Division-assignment operator with Expr right-hand-side.
 
- Public Member Functions inherited from Sacado::Fad::DynamicStorage< ValT, LogT >
 DynamicStorage (const ValT &x)
 Default constructor.
 
 DynamicStorage (const int sz, const ValT &x)
 Constructor with size sz. More...
 
 DynamicStorage (const DynamicStorage &x)
 Copy constructor.
 
 ~DynamicStorage ()
 Destructor.
 
DynamicStorage & operator= (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. More...
 
void expand (int sz)
 Expand derivative array to size sz. More...
 
void zero ()
 Zero out derivative array.
 
const ValT & val () const
 Returns value.
 
ValT & val ()
 Returns value.
 
const LogT * dx () const
 Returns derivative array.
 
LogT dx (int i) const
 Returns derivative component i with bounds checking.
 
LogT & fastAccessDx (int i)
 Returns derivative component i without bounds checking.
 
const LogT & fastAccessDx (int i) const
 Returns derivative component i without bounds checking.
 

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.

Constructor & Destructor Documentation

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

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

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.

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.

References Sacado::Fad::DynamicStorage< ValT, LogT >::fastAccessDx(), Sacado::LFad::LogicalSparseImp< ValT, LogT >::operator=(), Sacado::Fad::DynamicStorage< ValT, LogT >::resize(), Sacado::Fad::DynamicStorage< ValT, LogT >::size(), and Sacado::Fad::DynamicStorage< ValT, LogT >::zero().

Referenced by Sacado::LFad::LogicalSparseImp< ValT, LogT >::LogicalSparseImp().


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