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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected doubleprotected double[]protected double[]protected doubleprotected doubleprotected double[]protected FunctionNtoSprotected FunctionNtoNprotected FunctionStoSprotected intprotected double[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubledoublevoidcomputeGradient(double[] gradient) double[]intgetN()voidsetInput(double x) voidsetInput(double[] x) voidsetLine(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:
setLinein interfaceLineSearchFunction
-
getCurrentState
public double[] getCurrentState()- Specified by:
getCurrentStatein interfaceLineSearchFunction
-
setInput
public void setInput(double x) - Specified by:
setInputin interfaceCoupledDerivative
-
getN
public int getN()- Specified by:
getNin interfaceCoupledGradient
-
setInput
public void setInput(double[] x) - Specified by:
setInputin interfaceCoupledGradient
-
computeFunction
public double computeFunction()- Specified by:
computeFunctionin interfaceCoupledDerivative- Specified by:
computeFunctionin interfaceCoupledGradient
-
computeGradient
public void computeGradient(double[] gradient) - Specified by:
computeGradientin interfaceCoupledGradient
-
computeDerivative
public double computeDerivative()- Specified by:
computeDerivativein interfaceCoupledDerivative
-