org.jquantlib.math
Class AbstractSolver1D<F extends Ops.DoubleOp>
- java.lang.Object
-
- org.jquantlib.math.AbstractSolver1D<F>
-
- Direct Known Subclasses:
- Bisection, Brent, FalsePosition, Newton, NewtonSafe, Ridder, Secant
public abstract class AbstractSolver1D<F extends Ops.DoubleOp> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description AbstractSolver1D()AbstractSolver1D(int maxEvalautions, boolean lowerBoundEnforced, boolean upperBoundenforeced)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetMaxEvaluations()intgetNumEvaluations()voidsetLowerBound(double lowerBound)voidsetMaxEvaluations(int evaluations)voidsetUpperBound(double upperBound)doublesolve(F f, double accuracy, double guess, double step)This method returns the zero of the functionf, determined with the given accuracyepsilon; depending on the particular solver, this might mean that the returnedxis such that|f(x)| < epsilon f, or thatf |x-\xi| < \epsilon \f$ where \f$ \xi \f$is the real zero.doublesolve(F f, double accuracy, double guess, double xMin, double xMax)This method returns the zero of the function , determined with the given accuracy ; depending on the particular solver, this might mean that the returned is such that , or that where is the real zero.
-
-
-
Constructor Detail
-
AbstractSolver1D
public AbstractSolver1D()
-
AbstractSolver1D
public AbstractSolver1D(int maxEvalautions, boolean lowerBoundEnforced, boolean upperBoundenforeced)
-
-
Method Detail
-
solve
public double solve(F f, double accuracy, double guess, double step)
This method returns the zero of the functionf, determined with the given accuracyepsilon; depending on the particular solver, this might mean that the returnedxis such that|f(x)| < epsilon f, or thatf |x-\xi| < \epsilon \f$ where \f$ \xi \f$is the real zero.This method contains a bracketing routine to which an initial guess must be supplied as well as a step used to scan the range of the possible bracketing values.
-
solve
public double solve(F f, double accuracy, double guess, double xMin, double xMax)
This method returns the zero of the function , determined with the given accuracy ; depending on the particular solver, this might mean that the returned is such that , or that where is the real zero.An initial guess must be supplied, as well as two values and which must bracket the zero (i.e., either , or must be true).
- Parameters:
f- is the function we wish to find a rootaccuracy- is the desired accuracyguess-xMin-xMax-- Returns:
- a zero of a function
-
setMaxEvaluations
public void setMaxEvaluations(int evaluations)
-
getMaxEvaluations
public int getMaxEvaluations()
-
setLowerBound
public void setLowerBound(double lowerBound)
-
setUpperBound
public void setUpperBound(double upperBound)
-
getNumEvaluations
public int getNumEvaluations()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG