public abstract class AbstractRootFinder extends AbstractAnytimeBatchLearner<Evaluator<java.lang.Double,java.lang.Double>,InputOutputPair<java.lang.Double,java.lang.Double>> implements RootFinder, MeasurablePerformanceAlgorithm
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_ITERATIONS
Default maximum number of iterations, 1000.
|
static double |
DEFAULT_TOLERANCE
Default tolerance of the algorithm, 1.0E-5.
|
data, keepGoing
maxIterations
DEFAULT_ITERATION, iteration
Constructor and Description |
---|
AbstractRootFinder()
Creates a new instance of AbstractRootFinder
|
Modifier and Type | Method and Description |
---|---|
AbstractRootFinder |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
double |
getInitialGuess()
Returns the initial guess of the root.
|
NamedValue<java.lang.Double> |
getPerformance()
Gets the name-value pair that describes the current performance of the
algorithm.
|
double |
getTolerance()
Gets the tolerance of the algorithm.
|
void |
setInitialGuess(double initialGuess)
Sets the initial guess of the root (zero-crossing), which is supplied
as input to the function to find the zero-crossings of.
|
void |
setTolerance(double tolerance)
Sets the tolerance of the algorithm.
|
cleanupAlgorithm, getData, getKeepGoing, initializeAlgorithm, learn, setData, setKeepGoing, step, stop
getMaxIterations, isResultValid, setMaxIterations
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
learn
getMaxIterations, getResult, setMaxIterations
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
isResultValid, stop
public static final double DEFAULT_TOLERANCE
public static final int DEFAULT_MAX_ITERATIONS
public AbstractRootFinder()
public AbstractRootFinder clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractAnytimeBatchLearner<Evaluator<java.lang.Double,java.lang.Double>,InputOutputPair<java.lang.Double,java.lang.Double>>
public double getTolerance()
RootFinder
getTolerance
in interface RootFinder
public void setTolerance(double tolerance)
RootFinder
setTolerance
in interface RootFinder
tolerance
- Tolerance, where tolerances closer to zero are more accurate, and larger
tolerances are less accurate. In any case, tolerance must be greater
than or equal to zero.public double getInitialGuess()
getInitialGuess
in interface RootFinder
public void setInitialGuess(double initialGuess)
RootFinder
setInitialGuess
in interface RootFinder
initialGuess
- Initial guess of the root location.public NamedValue<java.lang.Double> getPerformance()
MeasurablePerformanceAlgorithm
getPerformance
in interface MeasurablePerformanceAlgorithm