Package org.ddogleg.optimization.wrap
Class CachedNumericalGradientLineFunction
java.lang.Object
org.ddogleg.optimization.wrap.CachedNumericalGradientLineFunction
- All Implemented Interfaces:
CoupledDerivative
,CoupledGradient
,GradientLineFunction
,LineSearchFunction
Numerically computes the gradient and line derivative. Results are cached independently for function output,
gradient, and line derivative.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected boolean
protected double
protected double[]
protected double[]
protected double
protected double
protected double[]
protected FunctionNtoS
protected FunctionNtoN
protected FunctionStoS
protected int
protected double[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
double
void
computeGradient
(double[] gradient) double[]
int
getN()
void
setInput
(double x) void
setInput
(double[] x) void
setLine
(double[] start, double[] direction)
-
Field Details
-
N
protected int N -
start
protected double[] start -
direction
protected double[] direction -
cachedFunction
protected boolean cachedFunction -
cachedGradient
protected boolean cachedGradient -
cachedDerivative
protected boolean cachedDerivative -
currentInput
protected double[] currentInput -
currentGradient
protected double[] currentGradient -
currentOutput
protected double currentOutput -
currentStep
protected double currentStep -
currentDerivative
protected double currentDerivative -
function
-
gradient
-
lineDerivative
-
-
Constructor Details
-
CachedNumericalGradientLineFunction
-
-
Method Details
-
setLine
public void setLine(double[] start, double[] direction) - Specified by:
setLine
in interfaceLineSearchFunction
-
getCurrentState
public double[] getCurrentState()- Specified by:
getCurrentState
in interfaceLineSearchFunction
-
setInput
public void setInput(double x) - Specified by:
setInput
in interfaceCoupledDerivative
-
getN
public int getN()- Specified by:
getN
in interfaceCoupledGradient
-
setInput
public void setInput(double[] x) - Specified by:
setInput
in interfaceCoupledGradient
-
computeFunction
public double computeFunction()- Specified by:
computeFunction
in interfaceCoupledDerivative
- Specified by:
computeFunction
in interfaceCoupledGradient
-
computeGradient
public void computeGradient(double[] gradient) - Specified by:
computeGradient
in interfaceCoupledGradient
-
computeDerivative
public double computeDerivative()- Specified by:
computeDerivative
in interfaceCoupledDerivative
-