Class AbstractUnivariateDifferentiableSolver
- java.lang.Object
-
- org.apache.commons.math4.legacy.analysis.solvers.BaseAbstractUnivariateSolver<UnivariateDifferentiableFunction>
-
- org.apache.commons.math4.legacy.analysis.solvers.AbstractUnivariateDifferentiableSolver
-
- All Implemented Interfaces:
BaseUnivariateSolver<UnivariateDifferentiableFunction>,UnivariateDifferentiableSolver
- Direct Known Subclasses:
NewtonRaphsonSolver
public abstract class AbstractUnivariateDifferentiableSolver extends BaseAbstractUnivariateSolver<UnivariateDifferentiableFunction> implements UnivariateDifferentiableSolver
Provide a default implementation for several functions useful to generic solvers.- Since:
- 3.1
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractUnivariateDifferentiableSolver(double absoluteAccuracy)Construct a solver with given absolute accuracy.protectedAbstractUnivariateDifferentiableSolver(double relativeAccuracy, double absoluteAccuracy, double functionValueAccuracy)Construct a solver with given accuracies.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DerivativeStructurecomputeObjectiveValueAndDerivative(double point)Compute the objective function value.protected voidsetup(int maxEval, UnivariateDifferentiableFunction f, double min, double max, double startValue)Prepare for computation.-
Methods inherited from class org.apache.commons.math4.legacy.analysis.solvers.BaseAbstractUnivariateSolver
computeObjectiveValue, doSolve, getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMax, getMaxEvaluations, getMin, getRelativeAccuracy, getStartValue, incrementEvaluationCount, isBracketing, isSequence, solve, solve, solve, verifyBracketing, verifyInterval, verifySequence
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.math4.legacy.analysis.solvers.BaseUnivariateSolver
getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMaxEvaluations, getRelativeAccuracy, solve, solve, solve
-
-
-
-
Constructor Detail
-
AbstractUnivariateDifferentiableSolver
protected AbstractUnivariateDifferentiableSolver(double absoluteAccuracy)
Construct a solver with given absolute accuracy.- Parameters:
absoluteAccuracy- Maximum absolute error.
-
AbstractUnivariateDifferentiableSolver
protected AbstractUnivariateDifferentiableSolver(double relativeAccuracy, double absoluteAccuracy, double functionValueAccuracy)
Construct a solver with given accuracies.- Parameters:
relativeAccuracy- Maximum relative error.absoluteAccuracy- Maximum absolute error.functionValueAccuracy- Maximum function value error.
-
-
Method Detail
-
computeObjectiveValueAndDerivative
protected DerivativeStructure computeObjectiveValueAndDerivative(double point) throws TooManyEvaluationsException
Compute the objective function value.- Parameters:
point- Point at which the objective function must be evaluated.- Returns:
- the objective function value and derivative at specified point.
- Throws:
TooManyEvaluationsException- if the maximal number of evaluations is exceeded.
-
setup
protected void setup(int maxEval, UnivariateDifferentiableFunction f, double min, double max, double startValue)
Prepare for computation. Subclasses must call this method if they override any of thesolvemethods.- Overrides:
setupin classBaseAbstractUnivariateSolver<UnivariateDifferentiableFunction>- Parameters:
maxEval- Maximum number of evaluations.f- Function to solve.min- Lower bound for the interval.max- Upper bound for the interval.startValue- Start value to use.
-
-