org.jscience.mathematics.analysis.ode
Class DummyStepInterpolator

java.lang.Object
  extended by org.jscience.mathematics.analysis.ode.AbstractStepInterpolator
      extended by org.jscience.mathematics.analysis.ode.DummyStepInterpolator
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, 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(java.io.ObjectInput in)
           
 void writeExternal(java.io.ObjectOutput 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

DummyStepInterpolator

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.


DummyStepInterpolator

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

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

DummyStepInterpolator

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.

Parameters:
interpolator - interpolator to copy from.
Method Detail

clone

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
Returns:
a copy of the instance.

computeInterpolatedState

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
Parameters:
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
Throws:
DerivativeException - this exception is propagated to the caller if the underlying user function triggers one

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Specified by:
writeExternal in class AbstractStepInterpolator
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException
Specified by:
readExternal in interface java.io.Externalizable
Specified by:
readExternal in class AbstractStepInterpolator
Throws:
java.io.IOException