Package org.ddogleg.optimization.wrap
Class CachedGradientLineFunction
java.lang.Object
org.ddogleg.optimization.wrap.CachedGradientLineFunction
- All Implemented Interfaces:
CoupledDerivative,CoupledGradient,GradientLineFunction,LineSearchFunction
From separate classes for the function and gradient computations implements
GradientLineFunction. Results are cached until the next time a line set
of parameters or line position is specified.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected double[]protected double[]protected doubleprotected double[]protected FunctionNtoSprotected FunctionNtoNprotected 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 -
currentInput
protected double[] currentInput -
currentGradient
protected double[] currentGradient -
currentOutput
protected double currentOutput -
function
-
gradient
-
-
Constructor Details
-
CachedGradientLineFunction
-
-
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
-