org.omegahat.Numerics.Optimizers
Interface LineStep

All Known Implementing Classes:
LineStepBasic

public interface LineStep

The interface to store information needed about a candidate parameter set during a line search.

Classes implementing this interface store enough information for the corresponding LineSearch object to use this step. Depending on the search algorithm, a number of steps may need to be kept around.

The minimal information is the step, the parameter set at the step, the function and gradient vector. Note that the implied parameter values are those at the step (thus the origin of the step would be found if needed by going back by the step size along the direction taken).

All the line searches of interest involve the slope, so we have not cluttered the concepts by having separate line step without derivatives (even if the stepping algorithm does not use slopes, it must retain the gradient in case this step is chosen as the solution.)


Method Summary
 void copyData(LineStep source)
          Copy the data from source into the current object.
 NumericArray getDirection()
           
 NumericArray getOrigin()
          The parameter values at the origin for the step.
 ModelPointNumericInt getPoint()
          The model point at which the step is evaluated.
 double getSlope()
          The slope, in the sense of directional derivative or other estimate.
 double getStep()
           
 double getValue()
          The value of the model at this step point.
 NumericArray setDirection(NumericArray direction)
           
 NumericArray setOrigin(NumericArray origin)
           
 ModelPointNumericInt setPoint(ModelPointNumericInt value)
           
 double setSlope()
           
 double setSlope(double value)
           
 double setStep(double step)
           
 

Method Detail

getStep

public double getStep()

setStep

public double setStep(double step)

getOrigin

public NumericArray getOrigin()
The parameter values at the origin for the step.

There is no requirement that the model be evaluated at the origin, so this property is a NumericArray, not a ModelPoint.


setOrigin

public NumericArray setOrigin(NumericArray origin)

getDirection

public NumericArray getDirection()

setDirection

public NumericArray setDirection(NumericArray direction)

getPoint

public ModelPointNumericInt getPoint()
The model point at which the step is evaluated.


setPoint

public ModelPointNumericInt setPoint(ModelPointNumericInt value)

copyData

public void copyData(LineStep source)
Copy the data from source into the current object.

The intention is to write into current fields if they are the correct size, so that a LineStep object can be allocated at the beginning of a fit and then re-used throughout the iteration.


getValue

public double getValue()
The value of the model at this step point.

getSlope

public double getSlope()
The slope, in the sense of directional derivative or other estimate.

Not all LineStep objects will store a gradient estimate. The setSlop() method is expected to compute the slope from the internal information, such as the gradient and direction.

For a step structure that does not want to allow slope estimates at all, returning NaN would be a way out.


setSlope

public double setSlope(double value)

setSlope

public double setSlope()