Simbody  3.4 (development)
SimTK::Measure_< T >::Extreme::Implementation Class Reference

#include <MeasureImplementation.h>

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

List of all members.

Public Member Functions

 Implementation ()
 Default constructor leaves the operand measure unspecified; no base class cache entries are allocated.
 Implementation (const Measure_< T > &operand, Operation op)
 Construct a measure that returns the extreme value taken on by the operand measure during a time stepping study.
void setOperandMeasure (const Measure_< T > &operand)
 Set the operand measure for this Extreme measure; this is a Topology stage change so you'll have to call realizeTopology() again if you call this.
void setOperation (Operation op)
 Set the particular operation to be performed by this Extreme measure; this is a Topology stage change so you'll have to call realizeTopology() again if you call this.
const Measure_< T > & getOperandMeasure () const
 Return a reference to the operand measure for this Extreme measure.
Operation getOperation () const
 Return the particular operation being performed by this Extreme measure.
void setValue (State &s, const T &value) const
 Set the current extreme value stored in this Extreme measure's state variable.
Real getTimeOfExtremeValue (const State &s) const
 Return the time at which the extreme was last updated.
ImplementationcloneVirtual () const override
int getNumTimeDerivativesVirtual () const override
 Extreme(f(t)) has the same number of derivatives as f except that they are all zero unless f(t) is a new extreme.
Stage getDependsOnStageVirtual (int order) const override
 The depends-on stage for this measure is the same as for its operand.
const T & getUncachedValueVirtual (const State &s, int derivOrder) const override
 We're not using the Measure_<T> base class cache services, but we do have one of our own.
void initializeVirtual (State &s) const override
 At start of a time stepping study, this should be called to set the current extreme value to the current value of the operand.
void realizeMeasureTopologyVirtual (State &s) const override
 Allocate the auto-updated state variable that holds the extreme seen so far.
void realizeMeasureAccelerationVirtual (const State &s) const override
 In case no one has updated the value of this measure yet, we have to make sure it gets updated before the integration moves ahead.
bool ensureExtremeHasBeenUpdated (const State &s) const
 Here we make sure that the cache entry is updated if the current value of the operand is more extreme than the previous one, and return a bool indicating whether we have a new extreme.

template<class T>
class SimTK::Measure_< T >::Extreme::Implementation


Constructor & Destructor Documentation

template<class T>
SimTK::Measure_< T >::Extreme::Implementation::Implementation ( ) [inline]

Default constructor leaves the operand measure unspecified; no base class cache entries are allocated.

Reimplemented from SimTK::AbstractMeasure::Implementation.

template<class T>
SimTK::Measure_< T >::Extreme::Implementation::Implementation ( const Measure_< T > &  operand,
Operation  op 
) [inline]

Construct a measure that returns the extreme value taken on by the operand measure during a time stepping study.


Member Function Documentation

template<class T>
void SimTK::Measure_< T >::Extreme::Implementation::setOperandMeasure ( const Measure_< T > &  operand) [inline]

Set the operand measure for this Extreme measure; this is a Topology stage change so you'll have to call realizeTopology() again if you call this.

template<class T>
void SimTK::Measure_< T >::Extreme::Implementation::setOperation ( Operation  op) [inline]

Set the particular operation to be performed by this Extreme measure; this is a Topology stage change so you'll have to call realizeTopology() again if you call this.

template<class T>
const Measure_<T>& SimTK::Measure_< T >::Extreme::Implementation::getOperandMeasure ( ) const [inline]

Return a reference to the operand measure for this Extreme measure.

template<class T>
Operation SimTK::Measure_< T >::Extreme::Implementation::getOperation ( ) const [inline]

Return the particular operation being performed by this Extreme measure.

template<class T>
void SimTK::Measure_< T >::Extreme::Implementation::setValue ( State s,
const T &  value 
) const [inline]

Set the current extreme value stored in this Extreme measure's state variable.

template<class T>
Real SimTK::Measure_< T >::Extreme::Implementation::getTimeOfExtremeValue ( const State s) const [inline]

Return the time at which the extreme was last updated.

This will be the current time if the operand is currently at its most extreme value, otherwise it will be sometime in the past.

template<class T>
Implementation* SimTK::Measure_< T >::Extreme::Implementation::cloneVirtual ( ) const [inline, override, virtual]
template<class T>
int SimTK::Measure_< T >::Extreme::Implementation::getNumTimeDerivativesVirtual ( ) const [inline, override, virtual]

Extreme(f(t)) has the same number of derivatives as f except that they are all zero unless f(t) is a new extreme.

Reimplemented from SimTK::AbstractMeasure::Implementation.

template<class T>
Stage SimTK::Measure_< T >::Extreme::Implementation::getDependsOnStageVirtual ( int  order) const [inline, override, virtual]

The depends-on stage for this measure is the same as for its operand.

Implements SimTK::AbstractMeasure::Implementation.

template<class T>
const T& SimTK::Measure_< T >::Extreme::Implementation::getUncachedValueVirtual ( const State s,
int  derivOrder 
) const [inline, override, virtual]

We're not using the Measure_<T> base class cache services, but we do have one of our own.

It looks uncached from the base class point of view which is why we're implementing it here.

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

template<class T>
void SimTK::Measure_< T >::Extreme::Implementation::initializeVirtual ( State s) const [inline, override, virtual]

At start of a time stepping study, this should be called to set the current extreme value to the current value of the operand.

Reimplemented from SimTK::AbstractMeasure::Implementation.

template<class T>
void SimTK::Measure_< T >::Extreme::Implementation::realizeMeasureTopologyVirtual ( State s) const [inline, override, virtual]

Allocate the auto-updated state variable that holds the extreme seen so far.

We'll assume that changes to this variable invalidate Dynamics (force) stage so that any forces that depend on it will be recomputed if it changes. Also allocate an auxiliary boolean variable that is used to hold whether the current value is a new extreme; that is private to the implementation and not user-accessible since you can instead check the time of last update.

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

template<class T>
void SimTK::Measure_< T >::Extreme::Implementation::realizeMeasureAccelerationVirtual ( const State s) const [inline, override, virtual]

In case no one has updated the value of this measure yet, we have to make sure it gets updated before the integration moves ahead.

Reimplemented from SimTK::AbstractMeasure::Implementation.

template<class T>
bool SimTK::Measure_< T >::Extreme::Implementation::ensureExtremeHasBeenUpdated ( const State s) const [inline]

Here we make sure that the cache entry is updated if the current value of the operand is more extreme than the previous one, and return a bool indicating whether we have a new extreme.

We don't want to create an update entry unless the extreme value has changed, because we would like the state variable's last update value to reflect the last actual change.


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