gov.sandia.cognition.learning.algorithm.root
Class AbstractBracketedRootFinder

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
          extended by gov.sandia.cognition.algorithm.AbstractAnytimeAlgorithm<ResultType>
              extended by gov.sandia.cognition.learning.algorithm.AbstractAnytimeBatchLearner<Evaluator<Double,Double>,InputOutputPair<Double,Double>>
                  extended by gov.sandia.cognition.learning.algorithm.root.AbstractRootFinder
                      extended by gov.sandia.cognition.learning.algorithm.root.AbstractBracketedRootFinder
All Implemented Interfaces:
AnytimeAlgorithm<InputOutputPair<Double,Double>>, IterativeAlgorithm, MeasurablePerformanceAlgorithm, StoppableAlgorithm, AnytimeBatchLearner<Evaluator<Double,Double>,InputOutputPair<Double,Double>>, BatchLearner<Evaluator<Double,Double>,InputOutputPair<Double,Double>>, RootFinder, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
RootFinderBisectionMethod, RootFinderFalsePositionMethod, RootFinderRiddersMethod, RootFinderSecantMethod

public abstract class AbstractBracketedRootFinder
extends AbstractRootFinder

Partial implementation of RootFinder that maintains a bracket on the root.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
static RootBracketer DEFAULT_ROOT_BRACKETER
          Default root-bracketing algorithm, RootBracketExpander.
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.root.AbstractRootFinder
DEFAULT_MAX_ITERATIONS, DEFAULT_TOLERANCE
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.AbstractAnytimeBatchLearner
data, keepGoing
 
Fields inherited from class gov.sandia.cognition.algorithm.AbstractAnytimeAlgorithm
maxIterations
 
Fields inherited from class gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
DEFAULT_ITERATION, iteration
 
Constructor Summary
AbstractBracketedRootFinder()
          Creates a new instance of AbstractBracketedRootFinder
 
Method Summary
protected  void cleanupAlgorithm()
          Called to clean up the learning algorithm's state after learning has finished.
 RootBracketer getBracketer()
          Gets the root-bracketing algorithm that will be used to initially bracket the root.
 InputOutputPair<Double,Double> getResult()
          Gets the current result of the algorithm.
 LineBracket getRootBracket()
          Getter for rootBracket.
protected  boolean initializeAlgorithm()
          Called to initialize the learning algorithm's state based on the data that is stored in the data field.
 void setBracketer(RootBracketer bracketer)
          Gets the root-bracketing algorithm that will be used to initially bracket the root.
 void setRootBracket(LineBracket rootBracket)
          Setter for rootBracket.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.root.AbstractRootFinder
clone, getInitialGuess, getPerformance, getTolerance, setInitialGuess, setTolerance
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.AbstractAnytimeBatchLearner
getData, getKeepGoing, learn, setData, setKeepGoing, step, stop
 
Methods inherited from class gov.sandia.cognition.algorithm.AbstractAnytimeAlgorithm
getMaxIterations, isResultValid, setMaxIterations
 
Methods inherited from class gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.BatchLearner
learn
 
Methods inherited from interface gov.sandia.cognition.algorithm.AnytimeAlgorithm
getMaxIterations, setMaxIterations
 
Methods inherited from interface gov.sandia.cognition.algorithm.IterativeAlgorithm
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
 
Methods inherited from interface gov.sandia.cognition.algorithm.StoppableAlgorithm
isResultValid, stop
 

Field Detail

DEFAULT_ROOT_BRACKETER

public static final RootBracketer DEFAULT_ROOT_BRACKETER
Default root-bracketing algorithm, RootBracketExpander.

Constructor Detail

AbstractBracketedRootFinder

public AbstractBracketedRootFinder()
Creates a new instance of AbstractBracketedRootFinder

Method Detail

initializeAlgorithm

protected boolean initializeAlgorithm()
Description copied from class: AbstractAnytimeBatchLearner
Called to initialize the learning algorithm's state based on the data that is stored in the data field. The return value indicates if the algorithm can be run or not based on the initialization.

Specified by:
initializeAlgorithm in class AbstractAnytimeBatchLearner<Evaluator<Double,Double>,InputOutputPair<Double,Double>>
Returns:
True if the learning algorithm can be run and false if it cannot.

cleanupAlgorithm

protected void cleanupAlgorithm()
Description copied from class: AbstractAnytimeBatchLearner
Called to clean up the learning algorithm's state after learning has finished.

Specified by:
cleanupAlgorithm in class AbstractAnytimeBatchLearner<Evaluator<Double,Double>,InputOutputPair<Double,Double>>

getResult

public InputOutputPair<Double,Double> getResult()
Description copied from interface: AnytimeAlgorithm
Gets the current result of the algorithm.

Returns:
Current result of the algorithm.

getBracketer

public RootBracketer getBracketer()
Gets the root-bracketing algorithm that will be used to initially bracket the root.

Returns:
Root-bracketing algorithm.

setBracketer

public void setBracketer(RootBracketer bracketer)
Gets the root-bracketing algorithm that will be used to initially bracket the root.

Parameters:
bracketer - Root-bracketing algorithm.

getRootBracket

public LineBracket getRootBracket()
Getter for rootBracket.

Returns:
Gets the bracket on the root location. That is, a range of input values where a root is guaranteed to lay between.

setRootBracket

public void setRootBracket(LineBracket rootBracket)
Setter for rootBracket.

Parameters:
rootBracket - Gets the bracket on the root location. That is, a range of input values where a root is guaranteed to lay between.