Simbody  3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimTK::Measure_< T >::Variable::Implementation Class Reference

#include <MeasureImplementation.h>

+ Inheritance diagram for SimTK::Measure_< T >::Variable::Implementation:

Public Member Functions

 Implementation ()
 This default constructor is for use by concrete measure implementation classes.
 Implementation (Stage invalidated, const T &defaultValue)
 Implementation (const Implementation &source)
 Copy constructor copies the number of cache entries from the source, but not the cache indices themselves as those must be allocated uniquely for the copy.
void setInvalidatedStage (Stage invalidates)
Stage getInvalidatedStage () const
void setValue (State &state, const T &value) const
 Change the value of this Measure in the given state.
ImplementationcloneVirtual () const override
int getNumTimeDerivativesVirtual () const override
Stage getDependsOnStageVirtual (int derivOrder) const override
const T & getUncachedValueVirtual (const State &s, int derivOrder) const override
 This is only called when derivOrder >= the number of cache entries we have, but still <= the number of derivatives the Measure says it can deliver.
void realizeMeasureTopologyVirtual (State &s) const override
 Concrete measures can override this to allocate Topology-stage resources.
- Public Member Functions inherited from SimTK::Measure_< T >::Implementation
const T & getValue (const State &s, int derivOrder) const
void setDefaultValue (const T &defaultValue)
 Set a new default value for this Measure.
const T & getDefaultValue () const
 Return a reference to the value that this Measure will use to initialize its value-level state resource (state variable or cache entry) during the next call to realizeTopology().
void setIsPresumedValidAtDependsOnStage (bool presume)
bool getIsPresumedValidAtDependsOnStage () const

Additional Inherited Members

- Protected Member Functions inherited from SimTK::Measure_< T >::Implementation
 Implementation (const T &defaultValue, int numCacheEntries=1)
 Implementation (int numCacheEntries=1)
 Argument numCacheEntries should be one greater than the number of derivatives; that is, there is room for the value ("0th" derivative) also.
int size () const
 Return the number of elements in the data type of this Measure; for Vector measures this is determined by the size of the default value.
int getNumCacheEntries () const
 Return the number of cache entries allocated for the value and derivatives of this Measure.
const T & getCacheEntry (const State &s, int derivOrder) const
 Get a const reference to the value stored in one of this Measure's cache entries, indexed by the derivative order (with the value treated as the 0th derivative).
T & updCacheEntry (const State &s, int derivOrder) const
 Get a writable reference to the value stored in one of this Measure's cache entries, indexed by the derivative order (with the value treated as the 0th derivative).
bool isCacheValueRealized (const State &s, int derivOrder) const
 Determine whether a particular one of this Measure's cache entries has already been realized since the given state was modified.
void markCacheValueRealized (const State &s, int derivOrder) const
 Mark one of this Measure's cache entries up to date; call this after you have calculated a value or derivative and stored it in the corresponding cache entry.
void markCacheValueNotRealized (const State &s, int derivOrder) const
 Invalidate one of this Measure's cache entries.
virtual void calcCachedValueVirtual (const State &, int derivOrder, T &value) const
 Concrete measures must override this if the state cache is used for precalculated values or derivatives.
const T & getValueZero () const
 Return a reference to a zero of the same type and size as this Measure's value.

Constructor & Destructor Documentation

template<class T>
SimTK::Measure_< T >::Variable::Implementation::Implementation ( )
inline

This default constructor is for use by concrete measure implementation classes.

Reimplemented from SimTK::AbstractMeasure::Implementation.

template<class T>
SimTK::Measure_< T >::Variable::Implementation::Implementation ( Stage  invalidated,
const T &  defaultValue 
)
inline
template<class T>
SimTK::Measure_< T >::Variable::Implementation::Implementation ( const Implementation source)
inline

Copy constructor copies the number of cache entries from the source, but not the cache indices themselves as those must be allocated uniquely for the copy.

Reimplemented from SimTK::Measure_< T >::Implementation.

Member Function Documentation

template<class T>
void SimTK::Measure_< T >::Variable::Implementation::setInvalidatedStage ( Stage  invalidates)
inline
template<class T>
Stage SimTK::Measure_< T >::Variable::Implementation::getInvalidatedStage ( ) const
inline
template<class T>
void SimTK::Measure_< T >::Variable::Implementation::setValue ( State state,
const T &  value 
) const
inline

Change the value of this Measure in the given state.

Invalidates cache entries in that state for any stage at or above the "invalidates" stage that was set when this Measure was constructed.

template<class T>
Implementation* SimTK::Measure_< T >::Variable::Implementation::cloneVirtual ( ) const
inlineoverridevirtual
template<class T>
int SimTK::Measure_< T >::Variable::Implementation::getNumTimeDerivativesVirtual ( ) const
inlineoverridevirtual
template<class T>
Stage SimTK::Measure_< T >::Variable::Implementation::getDependsOnStageVirtual ( int  derivOrder) const
inlineoverridevirtual
template<class T>
const T& SimTK::Measure_< T >::Variable::Implementation::getUncachedValueVirtual ( const State ,
int  derivOrder 
) const
inlineoverridevirtual

This is only called when derivOrder >= the number of cache entries we have, but still <= the number of derivatives the Measure says it can deliver.

You don't need to override this if that condition can't occur. This is commonly used for functions whose derivatives above a certain order are zero.

Reimplemented from SimTK::Measure_< T >::Implementation.

template<class T>
void SimTK::Measure_< T >::Variable::Implementation::realizeMeasureTopologyVirtual ( State ) const
inlineoverridevirtual

Concrete measures can override this to allocate Topology-stage resources.

Reimplemented from SimTK::Measure_< T >::Implementation.


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