Package com.irurueta.numerical.roots
Class SingleRootEstimator
java.lang.Object
com.irurueta.numerical.roots.RootEstimator
com.irurueta.numerical.roots.SingleRootEstimator
- Direct Known Subclasses:
BracketedSingleRootEstimator
Abstract class to find roots of single dimension functions.
A root is the locus of points (set of points) where the value of a given
function equals to zero.
A single dimension function is one containing a single parameter and
returning a single value (i.e. f(x)).
Usually root estimators will only find a single root around an initial
coarsely estimated solution.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SingleDimensionFunctionEvaluatorListener
Listener that evaluates a single dimension function in order to find its root.protected double
Root that has been found.protected boolean
Boolean indicating that a root has been computed and is available to be retrieved.Fields inherited from class com.irurueta.numerical.roots.RootEstimator
locked
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Empty constructor.protected
Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns listener that evaluates a single dimension function in order to find its root.double
getRoot()
Returns estimated root for a single dimension function inside a given bracket of values.boolean
Returns boolean indicating whether a listener has been provided.boolean
isReady()
Returns boolean indicating whether enough parameters have been provided in order to start the estimation of the roots of a function.boolean
Returns boolean indicating whether a root has been estimated and is available for retrieval.void
Sets listener that evaluates a single dimension function in order to find its root.Methods inherited from class com.irurueta.numerical.roots.RootEstimator
estimate, isLocked
-
Field Details
-
listener
Listener that evaluates a single dimension function in order to find its root. -
rootAvailable
protected boolean rootAvailableBoolean indicating that a root has been computed and is available to be retrieved. -
root
protected double rootRoot that has been found.
-
-
Constructor Details
-
SingleRootEstimator
protected SingleRootEstimator()Empty constructor. -
SingleRootEstimator
Constructor.- Parameters:
listener
- Listener that evaluates a single dimension function in order to find its root.
-
-
Method Details
-
getListener
Returns listener that evaluates a single dimension function in order to find its root.- Returns:
- Listener that evaluates a single dimension function.
- Throws:
NotAvailableException
- Raised if listener has not yet been provided.
-
setListener
Sets listener that evaluates a single dimension function in order to find its root.- Parameters:
listener
- Listener that evaluates a single dimension function.- Throws:
LockedException
- Raised if this instance is already locked.
-
isListenerAvailable
public boolean isListenerAvailable()Returns boolean indicating whether a listener has been provided.- Returns:
- True if listener is available, false otherwise.
-
isReady
public boolean isReady()Returns boolean indicating whether enough parameters have been provided in order to start the estimation of the roots of a function.- Overrides:
isReady
in classRootEstimator
- Returns:
- True if this instance is ready to start the root estimation, false otherwise.
-
isRootAvailable
public boolean isRootAvailable()Returns boolean indicating whether a root has been estimated and is available for retrieval.- Returns:
- True if root is available, false otherwise.
-
getRoot
Returns estimated root for a single dimension function inside a given bracket of values.- Returns:
- Estimated root.
- Throws:
NotAvailableException
- Raised if root has not yet been estimated.
-