org.omegahat.Numerics.Optimizers
Class LineSearchBasic

java.lang.Object
  |
  +--org.omegahat.Numerics.Optimizers.LineSearchBasic
All Implemented Interfaces:
LineSearch
Direct Known Subclasses:
LineSearchWolfe

public abstract class LineSearchBasic
extends java.lang.Object
implements LineSearch

the basic line search algorithm structure, without any particular algorithm.

This class defines some fields, such as the minimum and maximum step length, plus a few utility methods.


Field Summary
protected  boolean debug
           
protected  NumericArray direction
           
protected  int evaluations
          the number of evaluations in this line search.
protected  int maxEvaluations
           
protected  LineStep origin
           
protected  int state
          the state represented by this step.
protected  double stepMax
          steps must never be greater than this (large) number, default 1.e20.
protected  double stepMin
          steps must never be less than this (small) number, default 1e-20.
 
Fields inherited from interface org.omegahat.Numerics.Optimizers.LineSearch
CONTINUE, EXCEPTION, SUCCESSFUL, TOO_LARGE, TOO_MANY, TOO_NARROW, TOO_SMALL
 
Constructor Summary
LineSearchBasic()
           
 
Method Summary
 boolean continueIteration(LineStep step)
          Tests whether the search should continue.
 boolean getDebug()
          Accessor for debug field
 NumericArray getDirection()
          Accessor for direction field
 int getEvaluations()
          Accessor for evaluations field
 int getMaxEvaluations()
          Accessor for maxEvaluations field
 LineStep getOrigin()
          Accessor for origin field
 int getState()
          Accessor for state field
 double getStepMax()
          Accessor for stepMax field
 double getStepMin()
          Accessor for stepMin field
 int incrementCount()
          Increment the count of evaluations; this does not test against the maxEvaluations field, but the continueIteration method should.
 LineStep initialize(ModelPointNumericInt origin, NumericArray p, double step)
          Initialize the original step using the given model point, direction and step size.
 boolean setDebug(boolean value)
          Accessor for setting debug field
 NumericArray setDirection(NumericArray value)
          Accessor for setting direction field
 int setEvaluations(int value)
          Accessor for setting evaluations field
 int setMaxEvaluations(int value)
          Accessor for setting maxEvaluations field
 LineStep setOrigin(LineStep value)
          Accessor for setting origin field
 int setState(int value)
          Accessor for setting state field
 double setStepMax(double value)
          Accessor for setting stepMax field
 double setStepMin(double value)
          Accessor for setting stepMin field
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.omegahat.Numerics.Optimizers.LineSearch
refineStep
 

Field Detail

evaluations

protected int evaluations
the number of evaluations in this line search.

maxEvaluations

protected int maxEvaluations

state

protected int state
the state represented by this step.

It should be one of the pre-defined states in the LineSearch interface.


stepMax

protected double stepMax
steps must never be greater than this (large) number, default 1.e20.

stepMin

protected double stepMin
steps must never be less than this (small) number, default 1e-20.

origin

protected LineStep origin

direction

protected NumericArray direction

debug

protected boolean debug
Constructor Detail

LineSearchBasic

public LineSearchBasic()
Method Detail

getEvaluations

public int getEvaluations()
Accessor for evaluations field

setEvaluations

public int setEvaluations(int value)
Accessor for setting evaluations field

getMaxEvaluations

public int getMaxEvaluations()
Accessor for maxEvaluations field

setMaxEvaluations

public int setMaxEvaluations(int value)
Accessor for setting maxEvaluations field

getState

public int getState()
Accessor for state field
Specified by:
getState in interface LineSearch

setState

public int setState(int value)
Accessor for setting state field
Specified by:
setState in interface LineSearch

getStepMax

public double getStepMax()
Accessor for stepMax field

setStepMax

public double setStepMax(double value)
Accessor for setting stepMax field

getStepMin

public double getStepMin()
Accessor for stepMin field

setStepMin

public double setStepMin(double value)
Accessor for setting stepMin field

getOrigin

public LineStep getOrigin()
Accessor for origin field

setOrigin

public LineStep setOrigin(LineStep value)
Accessor for setting origin field

getDirection

public NumericArray getDirection()
Accessor for direction field

setDirection

public NumericArray setDirection(NumericArray value)
Accessor for setting direction field

getDebug

public boolean getDebug()
Accessor for debug field

setDebug

public boolean setDebug(boolean value)
Accessor for setting debug field

incrementCount

public int incrementCount()
Increment the count of evaluations; this does not test against the maxEvaluations field, but the continueIteration method should.

initialize

public LineStep initialize(ModelPointNumericInt origin,
                           NumericArray p,
                           double step)
Initialize the original step using the given model point, direction and step size.

The returned object has an (unevaluated) model point shifted by the specified step along the specified direction from the origin.

Specified by:
initialize in interface LineSearch

continueIteration

public boolean continueIteration(LineStep step)
Tests whether the search should continue. If not, sets the internal state to a non-zero value, e.g., SUCCESSFUL in case of numeric convergence by the criterion of the search, or any of a number of states indicating failure.

The method in this class only checks for failures: too small or large a step, or too many evaluations.

Specified by:
continueIteration in interface LineSearch