Package com.irurueta.numerical.roots
Class DerivativeSingleRootEstimator
java.lang.Object
com.irurueta.numerical.roots.RootEstimator
com.irurueta.numerical.roots.SingleRootEstimator
com.irurueta.numerical.roots.BracketedSingleRootEstimator
com.irurueta.numerical.roots.DerivativeSingleRootEstimator
- Direct Known Subclasses:
NewtonRaphsonSingleRootEstimator
,SafeNewtonRaphsonSingleRootEstimator
Abstract class to find function roots of a single dimension function using
also its derivative information.
This class is meant to be extended by final implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SingleDimensionFunctionEvaluatorListener
Listener to evaluate a function's derivative.Fields inherited from class com.irurueta.numerical.roots.BracketedSingleRootEstimator
BRACKET_EPS, bracketAvailable, DEFAULT_MAX_EVAL_POINT, DEFAULT_MIN_EVAL_POINT, FACTOR, maxEvalPoint, minEvalPoint, NTRY
Fields inherited from class com.irurueta.numerical.roots.SingleRootEstimator
listener, root, rootAvailable
Fields inherited from class com.irurueta.numerical.roots.RootEstimator
locked
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Empty constructor.protected
DerivativeSingleRootEstimator
(SingleDimensionFunctionEvaluatorListener listener, double minEvalPoint, double maxEvalPoint) Constructor.protected
DerivativeSingleRootEstimator
(SingleDimensionFunctionEvaluatorListener listener, SingleDimensionFunctionEvaluatorListener derivativeListener, double minEvalPoint, double maxEvalPoint) Constructor -
Method Summary
Modifier and TypeMethodDescriptionReturns derivative listener to evaluate a function's derivative.boolean
Returns boolean indicating whether the derivative listener has been provided and is available for retrieval.boolean
isReady()
Returns boolean indicating whether enough parameters have been provided in order to start the estimation of the roots of a function.void
setDerivativeListener
(SingleDimensionFunctionEvaluatorListener derivativeListener) Sets derivative listener to evaluate a function's derivative.Methods inherited from class com.irurueta.numerical.roots.BracketedSingleRootEstimator
computeBracket, computeBracket, computeBracket, getMaxEvaluationPoint, getMinEvaluationPoint, isBracketAvailable, setBracket, sign, swap
Methods inherited from class com.irurueta.numerical.roots.SingleRootEstimator
getListener, getRoot, isListenerAvailable, isRootAvailable, setListener
Methods inherited from class com.irurueta.numerical.roots.RootEstimator
estimate, isLocked
-
Field Details
-
derivativeListener
Listener to evaluate a function's derivative. If the function's derivative is not known (e.g. a closed expression is not available), then a DerivativeEstimator can be used inside the derivative listener implementation.
-
-
Constructor Details
-
DerivativeSingleRootEstimator
protected DerivativeSingleRootEstimator()Empty constructor. -
DerivativeSingleRootEstimator
protected DerivativeSingleRootEstimator(SingleDimensionFunctionEvaluatorListener listener, double minEvalPoint, double maxEvalPoint) throws InvalidBracketRangeException Constructor.- Parameters:
listener
- Listener to evaluate a single dimension function f(x) to find its roots.minEvalPoint
- Smallest value inside the bracket of values where the root will be searched.maxEvalPoint
- Largest value inside the bracket of values where the root will be searched.- Throws:
InvalidBracketRangeException
- Raised if minEvalPoint < maxEvalPoint.
-
DerivativeSingleRootEstimator
protected DerivativeSingleRootEstimator(SingleDimensionFunctionEvaluatorListener listener, SingleDimensionFunctionEvaluatorListener derivativeListener, double minEvalPoint, double maxEvalPoint) throws InvalidBracketRangeException Constructor- Parameters:
listener
- Listener to evaluate a single dimension function f(x) to find its roots.derivativeListener
- Listener to evaluate the function's derivativeminEvalPoint
- Smallest value inside the bracket of values where the root will be searched.maxEvalPoint
- Largest value inside the bracket of values where the root will be searched.- Throws:
InvalidBracketRangeException
- Raised if minEvalPoint < maxEvalPoint.
-
-
Method Details
-
getDerivativeListener
public SingleDimensionFunctionEvaluatorListener getDerivativeListener() throws NotAvailableExceptionReturns derivative listener to evaluate a function's derivative. If the function's derivative is not known (e.g. a closed expression is not available), then a DerivativeEstimator can be used inside the derivative listener implementation.- Returns:
- Derivative listener.
- Throws:
NotAvailableException
- if listener is not available for retrieval.
-
setDerivativeListener
public void setDerivativeListener(SingleDimensionFunctionEvaluatorListener derivativeListener) throws LockedException Sets derivative listener to evaluate a function's derivative. If the function's derivative is not known (e.g. a closed expression is not available), then a DerivativeEstimator can be used inside the derivative listener implementation.- Parameters:
derivativeListener
- Derivative listener to be set.- Throws:
LockedException
- Raised if this instance is locked.
-
isDerivativeListenerAvailable
public boolean isDerivativeListenerAvailable()Returns boolean indicating whether the derivative listener has been provided and is available for retrieval.- Returns:
- true if derivative 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. An instance of this class is assumed to be ready when a listener, a derivative listener and a bracket have been provided or computed.- Overrides:
isReady
in classSingleRootEstimator
- Returns:
- True if this instance is ready to start the root estimation, false otherwise.
-