public class ScalarSolver
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ScalarSolver.Function
Implement a function of one variable to be minimized
|
Constructor and Description |
---|
ScalarSolver(ScalarSolver.Function function)
Constructor
|
public ScalarSolver(ScalarSolver.Function function)
function
- Objective function to be minimized.public double solve(double scalarMin, double scalarMax, double okError, double okFraction, int numberIterations, Monitor monitor)
scalarMin
- The minimum value allowed for the argument scalar.scalarMax
- The maximum value allowed for the argument scalar.okError
- The unknown error in scalar should be less than this
fraction of the range: dscalar/(scalarMax-scalarMin) <= okError,
where dscalar is the error bound on the returned value of scalar.okFraction
- The error in scalar should be less than
this fraction of the minimum possible range for scalar:
dscalar <= okFraction*(scalar-scalarMin),
where dscalar is the error bound on the returned value of scalar.numberIterations
- The maximum number of iterations if greater
than 6. The optimization performs at least 6 iterations --
the minimum necessary for a genuinely parabolic function.
I recommend at least 20.monitor
- For reporting progress. Ignored if null.