Class DummyStepInterpolator

  extended by org.jscience.mathematics.analysis.ode.AbstractStepInterpolator
      extended by org.jscience.mathematics.analysis.ode.DummyStepInterpolator
All Implemented Interfaces:,, java.lang.Cloneable, StepInterpolator

public class DummyStepInterpolator
extends AbstractStepInterpolator

This class is a step interpolator that does nothing.

This class is used when the "step handler" set up by the user does not need step interpolation. It does not recompute the state when setInterpolatedTime is called. This implies the interpolated state is always the state at the end of the current step.

See Also:
StepHandler, Serialized Form

Field Summary
Fields inherited from class org.jscience.mathematics.analysis.ode.AbstractStepInterpolator
currentState, currentTime, h, interpolatedState, interpolatedTime, previousTime
Constructor Summary
protected DummyStepInterpolator()
          Simple constructor.
protected DummyStepInterpolator(double[] y, boolean forward)
          Simple constructor.
protected DummyStepInterpolator(DummyStepInterpolator interpolator)
          Copy constructor.
Method Summary
 java.lang.Object clone()
          Copy the instance.
protected  void computeInterpolatedState(double theta, double oneMinusThetaH)
          Compute the state at the interpolated time.
 void readExternal( in)
 void writeExternal( out)
Methods inherited from class org.jscience.mathematics.analysis.ode.AbstractStepInterpolator
doFinalize, finalizeStep, getCurrentTime, getInterpolatedState, getInterpolatedTime, getPreviousTime, isForward, readBaseExternal, reinitialize, setInterpolatedTime, shift, storeTime, writeBaseExternal
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


protected DummyStepInterpolator()
Simple constructor. This constructor builds an instance that is not usable yet, the AbstractStepInterpolator.reinitialize(double[], boolean) method should be called before using the instance in order to initialize the internal arrays. This constructor is used only in order to delay the initialization in some cases. As an example, the RungeKuttaFehlbergIntegrator uses the prototyping design pattern to create the step interpolators by cloning an uninitialized model and latter initializing the copy.


protected DummyStepInterpolator(double[] y,
                                boolean forward)
Simple constructor.

y - reference to the integrator array holding the state at the end of the step
forward - integration direction indicator


protected DummyStepInterpolator(DummyStepInterpolator interpolator)
Copy constructor.

The copied interpolator should have been finalized before the copy, otherwise the copy will not be able to perform correctly any interpolation and will throw a NullPointerException later. Since we don't want this constructor to throw the exceptions finalization may involve and since we don't want this method to modify the state of the copied interpolator, finalization is not done automatically, it remains under user control.

The copy is a deep copy: its arrays are separated from the original arrays of the instance.

interpolator - interpolator to copy from.
Method Detail


public java.lang.Object clone()
Copy the instance. the copy is a deep copy: its arrays are separated from the original arrays of the instance

Specified by:
clone in class AbstractStepInterpolator
a copy of the instance.


protected void computeInterpolatedState(double theta,
                                        double oneMinusThetaH)
                                 throws DerivativeException
Compute the state at the interpolated time. In this class, this method does nothing: the interpolated state is always the state at the end of the current step.

Specified by:
computeInterpolatedState in class AbstractStepInterpolator
theta - normalized interpolation abscissa within the step (theta is zero at the previous time step and one at the current time step)
oneMinusThetaH - time gap between the interpolated time and the current time
DerivativeException - this exception is propagated to the caller if the underlying user function triggers one


public void writeExternal( out)
Specified by:
writeExternal in interface
Specified by:
writeExternal in class AbstractStepInterpolator


public void readExternal( in)
Specified by:
readExternal in interface
Specified by:
readExternal in class AbstractStepInterpolator