Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

An::ExpDecay Class Reference

#include <Numeric.h>

List of all members.


Detailed Description

Implements an exponential decay using the Crank-Nicholson method.

For improved performances, the CN factor is cached, assuming that the dt will rarely change during runtime.


Public Member Functions

 ExpDecay (double t=5.0, double delta=1.0, double init=0.0)
 Constructor.
void add (double f)
 Add f to actual value.
void step ()
 Decay during the same time as last step.
void step (double thisDt)
 Decay during a given time thisDt decay time.
double getValueAndStep ()
 Return the value and than decay for the same time as last step.
double getValueAndStep (double thisDt)
 Return the value and than decay during a given time thisDt decay time.
void setTau (double t)
 Set the time constant t time constant.
double getTau () const
 Return the time constant.
void setDt (double delta)
 Set the step duration delta step duration.
double getDt () const
 Return the step duration.
void setValue (double val)
 Set the value val value.
double getValue () const
 Return the value.
void operator= (double val)
 Set the value val value.
void operator+= (double f)
 Add f to the value.
void operator-= (double f)
 Substract f from the value.
 operator double () const
 Return the value.

Protected Member Functions

void syncFactor ()
 Calc step multiplication factor according to the Crank-Nicholson method.

Protected Attributes

double tau
 time constant
double factor
 factor for Crank-Nicholson method, computed from tau and value
double value
 actual value
double dt
 step duration


Constructor & Destructor Documentation

An::ExpDecay::ExpDecay double  t = 5.0,
double  delta = 1.0,
double  init = 0.0
[inline]
 

Constructor.

Parameters:
t Time-constant
delta Integration step
init Initial value


The documentation for this class was generated from the following file:
Generated on Mon Oct 24 17:30:34 2005 for liban by  doxygen 1.4.2