Class LeastSquaresSwitcher<S extends DMatrix>

java.lang.Object
org.ddogleg.optimization.LeastSquaresSwitcher<S>

public class LeastSquaresSwitcher<S extends DMatrix> extends Object
Class that lets you easily switch between different GaussNewtonBase_F64 solvers and matrix formats. You must first call setSolver(org.ddogleg.optimization.ConfigNonLinearLeastSquares, boolean, boolean) before you call setFunction(org.ddogleg.optimization.functions.FunctionNtoM, org.ddogleg.optimization.LeastSquaresSwitcher.ProcessJacobianOut). Supports implementations that can be specified using ConfigNonLinearLeastSquares.
  • Constructor Details

    • LeastSquaresSwitcher

      public LeastSquaresSwitcher()
  • Method Details

    • setFunction

      public void setFunction(FunctionNtoM function, LeastSquaresSwitcher.ProcessJacobianOut jacobian)
      Specifies the cost residual function and it's Jacobian. Must be called after the solver has been specified.
    • setSolver

      public void setSolver(ConfigNonLinearLeastSquares config, boolean sparse, boolean schur)
      Used to specify the solver using a configuration which is then passed on to a factory
      Parameters:
      config - Which solver to user
      sparse - Should it use a sparse matrix format?
      schur - Should it use a schur decomposition?
    • jacobianOutWrap

      public static LeastSquaresSwitcher.JacobianOut jacobianOutWrap(DMatrixRMaj output)