Class DerivativeChecker

java.lang.Object
org.ddogleg.optimization.DerivativeChecker

public class DerivativeChecker extends Object
Used to validate an algebraic Jacobian numerically.
  • 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)