Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IntegratorState Class Reference

#include <IntegratorState.h>

Inheritance diagram for IntegratorState:

Public Types

typedef std::valarray< size_t > cIndexArray

Public Member Functions

 IntegratorState ()
 IntegratorState (int size)
 ~IntegratorState ()
void accept (StateVisitor &v)
const char * className () const
State * clone () const
StringList currentValue () const
double & dot (size_t pIdx)
ParseToken evalExpression (FileTokenizer &)
void initialize ()
void initializeStateVector (const cIndexArray &pIndices, double **pXHandle, double **pXDotHandle, double *pAbsTol, double *pRelTol)
int isA (const char *) const
int isArray () const
void resize (size_t pNewSize)
void setDotVector (const RVector &pNewDot)
void setDotVector (const double *pNewDot, size_t pN)
int size () const
const char * type () const

Protected Member Functions

bool isInitialized () const

Protected Attributes

size_t mElements
cIndexArray mIndexArray
double ** mXDotHandle
double ** mXHandle
double & operator[] (size_t n)
const double & operator[] (size_t n) const
void getStateVector (RVector &pVal)
void getStateVector (double *pVal, size_t pN)
void setStateVector (const RVector &pVal)
void setStateVector (const double *pVal, size_t pN)
enum  StateType {
void setType (StateType pNewState=integrator)
StateType getStateType () const
void setAbsTolerance (double pTol)
void setAbsTolerance (size_t pIdx, double pTol)
void setAbsTolerance (const RVector &pTol)
void setAbsTolerance (const double *pTol, size_t pLen)
void unsetAbsTolerance ()
void setRelTolerance (double pTol)
 discard distinct tolerance settings More...
void setRelTolerance (size_t pIdx, double pTol)
void setRelTolerance (const RVector &pTol)
void setRelTolerance (const double *pTol, size_t pLen)
void unsetRelTolerance ()
template<typename ForwardIter >
void setAbsTolerance (ForwardIter anf, ForwardIter end)
 discard distinct tolerance settings More...
bool setInputInfluence ()
bool setInputInfluence (InCTDEPort &pPort)
bool setInputInfluence (size_t pMyIdx, InCTDEPort &pPort)
bool setInputInfluence (size_t pMyIdx, InCTDEPort &pPort, size_t pInIdx)
bool unsetInputInfluence ()
bool unsetInputInfluence (InCTDEPort &pPort)
bool unsetInputInfluence (size_t pMyIdx, InCTDEPort &pPort)
bool unsetInputInfluence (size_t pMyIdx, InCTDEPort &pPort, size_t pInIdx)
bool setStateInfluence ()
bool setStateInfluence (IntegratorState &pState)
bool setStateInfluence (size_t tMyIdx, IntegratorState &pState)
bool setStateInfluence (size_t pMyIdx, IntegratorState &pState, size_t pFarIdx)
bool unsetStateInfluence ()
bool unsetStateInfluence (IntegratorState &pState)
bool unsetStateInfluence (size_t tMyIdx, IntegratorState &pState)
bool unsetStateInfluence (size_t pMyIdx, IntegratorState &pState, size_t pFarIdx)

Detailed Description

Array state of doubles, used for continuous states in the CTDE domain. The values are stored in

Andreas Franck
See Also

Member Enumeration Documentation

<af proto 02/20/2002> support for algebraic states

Constructor & Destructor Documentation

IntegratorState::IntegratorState ( )

Default constructor. Create an array state of size zero.

IntegratorState::IntegratorState ( int  size)

Constructor with size argument.

The size of integrator states is always set as the size of their initial value.
IntegratorState::~IntegratorState ( )


Member Function Documentation

void IntegratorState::accept ( StateVisitor &  v)

State visitor interface

double & IntegratorState::dot ( size_t  pIdx)

Get the derivative of a single state in the array.

pIdxIndex of the queried derivative
Reference to the derivative indexed by pIdx
In the current implementation of CTDE, it is not sure that the derivative values are actually stored. If not, a reference to a randomly set static variable is returned.
void IntegratorState::getStateVector ( RVector &  pVal)

vector-based methods to retrieve and set the integrator state.

void IntegratorState::initializeStateVector ( const cIndexArray &  pIndices,
double **  pXHandle,
double **  pXDotHandle,
double *  pAbsTol,
double *  pRelTol 

fill the global state vectors from the initial values buffer.

double & IntegratorState::operator[] ( size_t  n)

element based accessed to state values. return an array element indexed by n.

const double & IntegratorState::operator[] ( size_t  n) const

Constant version of array index operator.

Constant reference to the double value indexed by n
void IntegratorState::resize ( size_t  pNewSize)

Adjust the size of the Array.

This method must only be called during simulation setup, never at runtime.
void IntegratorState::setAbsTolerance ( double  pTol)

Tolerance settings dialog

a call to resize() invalidates all tolerance settings
template<typename ForwardIter >
void IntegratorState::setAbsTolerance ( ForwardIter  anf,
ForwardIter  end 

discard distinct tolerance settings

bool IntegratorState::setInputInfluence ( )

define dependency relations between integrator states and/or the ports of the primitive containing the integrator state. declare that the whole state vector depends on all continous input ports

bool IntegratorState::setInputInfluence ( InCTDEPort pPort)

the state vector depends on all signals of the input port

bool IntegratorState::setInputInfluence ( size_t  pMyIdx,
InCTDEPort pPort 

state vector element depends on input

bool IntegratorState::setInputInfluence ( size_t  pMyIdx,
InCTDEPort pPort,
size_t  pInIdx 

state vector element depends on signal of input port

void IntegratorState::setRelTolerance ( double  pTol)

discard distinct tolerance settings

bool IntegratorState::setStateInfluence ( )

declare this state to be dependent on all integrator states in the containing primitive.

int IntegratorState::size ( ) const

Return the size of the array. This function is virtual and therefore not inline

bool IntegratorState::unsetInputInfluence ( )

declare the state vector to be independend of any input port.

bool IntegratorState::unsetInputInfluence ( InCTDEPort pPort)

declare the state vector to be independent odf input port

bool IntegratorState::unsetInputInfluence ( size_t  pMyIdx,
InCTDEPort pPort 

declare element of the state vector to be independent of input port

bool IntegratorState::unsetInputInfluence ( size_t  pMyIdx,
InCTDEPort pPort,
size_t  pInIdx 

declare element of the state vector to be independent of signal input port

Member Data Documentation

cIndexArray IntegratorState::mIndexArray

Required to point the Handle to the shadowVal during setup time

double** IntegratorState::mXDotHandle

Pointer to Pointer to the representation of the state derivatives

double** IntegratorState::mXHandle

The size of the array A pointer to pointer to the representation of the array. The double indirection is neccessary because the global vector is changed during simulation.