Class NumericalGradientFB
java.lang.Object
org.ddogleg.optimization.derivative.NumericalGradientFB
- All Implemented Interfaces:
FunctionNtoN
Finite difference numerical gradient calculation using the forward+backwards equation.
Difference equation, f'(x) = (f(x+h)-f(x-h))/(2*h). Scaling is taken in account by h based
upon the magnitude of the elements in variable x.
NOTE: If multiple input parameters are modified by the function when a single one is changed numerical derivatives aren't reliable.
-
Constructor Summary
ConstructorsConstructorDescriptionNumericalGradientFB(FunctionNtoS function) NumericalGradientFB(FunctionNtoS function, double differenceScale) -
Method Summary
-
Constructor Details
-
NumericalGradientFB
-
NumericalGradientFB
-
-
Method Details
-
getN
public int getN()Description copied from interface:FunctionNtoNReturns the number of inputs and outputs for this function.- Specified by:
getNin interfaceFunctionNtoN
-
process
public void process(double[] input, double[] output) Description copied from interface:FunctionNtoNProcesses the function.- Specified by:
processin interfaceFunctionNtoN- Parameters:
input- Array with the inputs of length N. Not modified.output- Array for storing the output of length N. Modified.
-