Package org.ddogleg.optimization
Class DerivativeChecker
java.lang.Object
org.ddogleg.optimization.DerivativeChecker
Used to validate an algebraic Jacobian numerically.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
gradient
(FunctionNtoS func, FunctionNtoN gradient, double[] param, double tol) Compares the passed in gradient function to a numerical calculation.static boolean
gradient
(FunctionNtoS func, FunctionNtoN gradient, double[] param, double tol, double differenceScale) static boolean
gradientR
(FunctionNtoS func, FunctionNtoN gradient, double[] param, double tol) Compares the passed in gradient function to a numerical calculation.static boolean
gradientR
(FunctionNtoS func, FunctionNtoN gradient, double[] param, double tol, double differenceScale) static <S extends DMatrix>
booleanjacobian
(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol) static <S extends DMatrix>
booleanjacobian
(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol, double differenceScale) static <S extends DMatrix>
voidjacobianPrint
(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol) static <S extends DMatrix>
voidjacobianPrint
(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol, double differenceScale) static <S extends DMatrix>
voidjacobianPrintR
(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol) Prints out the difference using a relative error thresholdstatic <S extends DMatrix>
voidjacobianPrintR
(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol, double differenceScale) static <S extends DMatrix>
booleanjacobianR
(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol) Checks the jacobian using a relative error threshold.static <S extends DMatrix>
booleanjacobianR
(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol, double differenceScale) Checks the jacobian using a relative error threshold.
-
Constructor Details
-
DerivativeChecker
public DerivativeChecker()
-
-
Method Details
-
jacobianPrint
public static <S extends DMatrix> void jacobianPrint(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol) -
jacobianPrint
public static <S extends DMatrix> void jacobianPrint(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol, double differenceScale) -
jacobian
public static <S extends DMatrix> boolean jacobian(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol) -
jacobian
public static <S extends DMatrix> boolean jacobian(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol, double differenceScale) -
jacobianPrintR
public static <S extends DMatrix> void jacobianPrintR(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol) Prints out the difference using a relative error threshold- Parameters:
tol
- fractional difference
-
jacobianPrintR
public static <S extends DMatrix> void jacobianPrintR(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol, double differenceScale) -
jacobianR
public static <S extends DMatrix> boolean jacobianR(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol) Checks the jacobian using a relative error threshold.- Parameters:
tol
- fractional difference
-
jacobianR
public static <S extends DMatrix> boolean jacobianR(FunctionNtoM func, FunctionNtoMxN<S> jacobian, double[] param, double tol, double differenceScale) Checks the jacobian using a relative error threshold.- Parameters:
tol
- fractional difference
-
gradient
public static boolean gradient(FunctionNtoS func, FunctionNtoN gradient, double[] param, double tol) Compares the passed in gradient function to a numerical calculation. Comparison is done using an absolute value.- Returns:
- true for within tolerance and false otherwise
-
gradient
public static boolean gradient(FunctionNtoS func, FunctionNtoN gradient, double[] param, double tol, double differenceScale) -
gradientR
public static boolean gradientR(FunctionNtoS func, FunctionNtoN gradient, double[] param, double tol) Compares the passed in gradient function to a numerical calculation. Comparison is done using an absolute value.- Returns:
- true for within tolerance and false otherwise
-
gradientR
public static boolean gradientR(FunctionNtoS func, FunctionNtoN gradient, double[] param, double tol, double differenceScale)
-