|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.numerics.dde_solvers.interpolation.StateMemory
public class StateMemory
StateMemory is a class for objects that store past states of an ODE (in form of IntervalData objects) and uses this information to provide interpolated states at different instants of time. For proper operation, the IntervalData must be ordered from old to new and the left side of each interval must match the right side of the previous interval.
Constructor Summary | |
---|---|
StateMemory(ODE ode)
Instantiates a StateMemory for a given ode |
Method Summary | |
---|---|
void |
addIntervalData(IntervalData data)
Adds an IntervalData at the end of the memory |
void |
clearAll()
Clears all the memory data |
void |
clearBefore(double time)
Clears all intervals whose data is older than the given time. |
IntervalData |
findInterval(double time,
boolean useLeftInterval)
Finds the interval responsible for interpolating data at this time , including the initial conditions if all other intervals fail |
java.util.Iterator<IntervalData> |
getDescendingIterator()
Returns the mIntervalList in descending order. |
double[] |
interpolate(double time,
boolean useLeftInterval,
double[] state)
Retrieve the state for the given time. |
double[] |
interpolate(double time,
boolean useLeftInterval,
double[] state,
int beginIndex,
int length)
Retrieve the state for the given time for a subset of indexes |
double |
interpolate(double time,
boolean useLeftInterval,
int index)
Retrieve the value of one entry of the state for the given time |
void |
setInitialConditions(IntervalData interval)
Sets a DDE which can provide data further for time beyond the memory limits |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StateMemory(ODE ode)
ode
- Method Detail |
---|
public void setInitialConditions(IntervalData interval)
dde
- public void addIntervalData(IntervalData data)
data
- public java.util.Iterator<IntervalData> getDescendingIterator()
public void clearAll()
public void clearBefore(double time)
time
- public IntervalData findInterval(double time, boolean useLeftInterval)
time
- double the given time for the stateuseLeftInterval
- boolean If the time coincides with the end of an interval, use the boolean to choose the correct interval
public double[] interpolate(double time, boolean useLeftInterval, double[] state)
time
- double the given time for the stateuseLeftInterval
- boolean If the time coincides with the end of an interval, use the boolean to choose the correct intervalstate
- double[] a place holder for the returned state
public double[] interpolate(double time, boolean useLeftInterval, double[] state, int beginIndex, int length)
time
- double the given time for the stateuseLeftInterval
- boolean If the time coincides with the end of an interval, use the boolean to choose the correct intervalstate
- double[] a place holder for the returned statebeginIndex
- the first indexlength
- the number of indexes requested
public double interpolate(double time, boolean useLeftInterval, int index)
time
- double the given time for the stateuseLeftInterval
- boolean If the time coincides with the end of an interval, use the boolean to choose the correct intervalindex
- the index of the value required
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |