#include <C:/Work/specialnumbers_svn/NumberLib/NumbersLib/IntegrableNumber.h>
This class complements the DifferentiableNumber class.
T | The type that underlies this IntegrableNumber. Typically float. | |
m | The number of samples to store | |
n | The order of the integrable |
Definition at line 29 of file IntegrableNumber.h.
Public Member Functions | |
void | forceValue (T x, float elapsedTime=1.0f) |
Forces this integrable number into a long term srteady state. | |
T | getSample (int i) const |
This returns the nth sample stored. | |
T | getValue (unsigned int order) const |
Returns the integral of order specified for this IntegrableNumber. | |
IntegrableNumber (T initialValue) | |
void | setValue (T x, float elapsedTime=1.0f) |
Sets the value of this IntegrableNumber, and recalculates all integrals. | |
Private Attributes | |
CyclicNumber< int > | mCurrentIndex |
T | mCurrentValue |
T | mInitialValue |
T | mSamples [sampleCount] |
IntegrableNumber< T, sampleCount, maxOrder-1 > | mSum |
float | mTimeSamples [sampleCount] |
float | mTotalTime |
IntegrableNumber | ( | T | initialValue | ) | [inline] |
initialValue | zero of type T, returned by all calls of getValue that this number cannot calculate. |
Definition at line 87 of file IntegrableNumber.h.
References IntegrableNumber::mSamples, and IntegrableNumber::mTimeSamples.
void forceValue | ( | T | x, | |
float | elapsedTime = 1.0f | |||
) | [inline] |
Forces this integrable number into a long term srteady state.
The alpsed time is the time elapsed between samples. For example, if this integrable number (with say, 10 samples) is forced to a value of 10, with elapsed time of 1.0f, then the sum would be 100. If the elapsed time is 3, then the sum would be 300.
Definition at line 122 of file IntegrableNumber.h.
References IntegrableNumber::mCurrentValue, IntegrableNumber::mInitialValue, IntegrableNumber::mSamples, IntegrableNumber::mSum, and IntegrableNumber::mTotalTime.
Referenced by PIDBufferedNumber::forceValue().
T getSample | ( | int | i | ) | const [inline] |
This returns the nth sample stored.
Note that sample[0] is not necesarily the oldest sample. This method is used for testing, and should not be generally not be used in production code.
Definition at line 163 of file IntegrableNumber.h.
References IntegrableNumber::mSamples.
Referenced by PIDBufferedNumber::getSample().
T getValue | ( | unsigned int | order | ) | const [inline, virtual] |
Returns the integral of order specified for this IntegrableNumber.
order |
|
Implements AbstractFilteredNumber.
Definition at line 144 of file IntegrableNumber.h.
References IntegrableNumber::mCurrentValue, IntegrableNumber::mInitialValue, and IntegrableNumber::mSum.
Referenced by PIDBufferedNumber::getValue().
void setValue | ( | T | x, | |
float | elapsedTime = 1.0f | |||
) | [inline, virtual] |
Sets the value of this IntegrableNumber, and recalculates all integrals.
Implements UpdateableNumber.
Definition at line 102 of file IntegrableNumber.h.
References IntegrableNumber::mCurrentIndex, IntegrableNumber::mCurrentValue, IntegrableNumber::mSamples, IntegrableNumber::mSum, IntegrableNumber::mTimeSamples, and IntegrableNumber::mTotalTime.
Referenced by PIDBufferedNumber::setValue().
CyclicNumber<int> mCurrentIndex [private] |
Definition at line 35 of file IntegrableNumber.h.
Referenced by IntegrableNumber< T, sampleCount, 1 >::setValue(), and IntegrableNumber::setValue().
T mCurrentValue [private] |
Definition at line 36 of file IntegrableNumber.h.
Referenced by IntegrableNumber< T, sampleCount, 1 >::forceValue(), IntegrableNumber::forceValue(), IntegrableNumber< T, sampleCount, 1 >::getValue(), IntegrableNumber::getValue(), IntegrableNumber< T, sampleCount, 1 >::setValue(), and IntegrableNumber::setValue().
T mInitialValue [private] |
Definition at line 37 of file IntegrableNumber.h.
Referenced by IntegrableNumber< T, sampleCount, 1 >::forceValue(), IntegrableNumber::forceValue(), IntegrableNumber< T, sampleCount, 1 >::getValue(), and IntegrableNumber::getValue().
T mSamples[sampleCount] [private] |
Definition at line 32 of file IntegrableNumber.h.
Referenced by IntegrableNumber< T, sampleCount, 1 >::forceValue(), IntegrableNumber::forceValue(), IntegrableNumber< T, sampleCount, 1 >::getSample(), IntegrableNumber::getSample(), IntegrableNumber< T, sampleCount, 1 >::IntegrableNumber(), IntegrableNumber::IntegrableNumber(), IntegrableNumber< T, sampleCount, 1 >::setValue(), and IntegrableNumber::setValue().
IntegrableNumber<T, sampleCount, maxOrder - 1> mSum [private] |
Definition at line 39 of file IntegrableNumber.h.
Referenced by IntegrableNumber< T, sampleCount, 1 >::forceValue(), IntegrableNumber::forceValue(), IntegrableNumber< T, sampleCount, 1 >::getValue(), IntegrableNumber::getValue(), IntegrableNumber< T, sampleCount, 1 >::setValue(), and IntegrableNumber::setValue().
float mTimeSamples[sampleCount] [private] |
float mTotalTime [private] |
Definition at line 40 of file IntegrableNumber.h.
Referenced by IntegrableNumber< T, sampleCount, 1 >::forceValue(), IntegrableNumber::forceValue(), IntegrableNumber< T, sampleCount, 1 >::setValue(), and IntegrableNumber::setValue().