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
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected double[]
protected double[]
protected double
protected double[]
protected FunctionNtoS
protected FunctionNtoN
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 -
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:
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
-