Class EigenNonlinearSolver#

Inheritance Relationships#

Base Type#

Class Documentation#

class EigenNonlinearSolver : public Karana::Dynamics::NonlinearSolver#

EigenNonlinearSolver class manages a nonlinear problem and associated solver.

Public Types

enum SolverType#

Solver types used by the Nonlinear solver.

Values:

enumerator LEVENBERG_MARQUARDT#
enumerator HYBRID_NON_LINEAR_SOLVER#

Public Functions

EigenNonlinearSolver(std::string_view name, int input_dim, int value_dim, cost_fn f, jac_fn j = nullptr, SolverType type = SolverType::LEVENBERG_MARQUARDT)#

Constructor for nonlinear solver using numerical methods shipped with Eigen.

Parameters:
  • name – The name of the nonlinear solver.

  • input_dim – The number of inputs.

  • value_dim – The number of values (outputs).

  • f – The cost function. This should take in a vector of inputs and output a vector of outputs.

  • j – The jacobian function. This is optional, if not specified, the jacobian will be computed by forward numerical differentiation.

  • type – The type of nonlinear solver to use.

SolverType getSolverType()#

Get the non-linear solver type.

Returns:

The current non-linear solver type.

void setSolverType(const SolverType &solver_type)#

Set the solver type.

Parameters:

solver_type – The solver.

Public Members

std::variant<Eigen::LevenbergMarquardtSpace::Status, Eigen::HybridNonLinearSolverSpace::Status> status#

The status of the nonlinear solver.

Public Static Functions

static kc::ks_ptr<EigenNonlinearSolver> create(std::string_view name, int input_dim, int value_dim, cost_fn f, jac_fn j = nullptr, SolverType type = SolverType::LEVENBERG_MARQUARDT)#

Constructor for nonlinear solver using numerical methods shipped with Eigen.

Parameters:
  • name – The name of the Nonlinear solver.

  • input_dim – The number of inputs.

  • value_dim – The number of values (outputs).

  • f – The cost function. This should take in a vector of inputs and output a vector of outputs.

  • j – The jacobian function. This is optional, if not specified, the jacobian will be computed by forward numerical differentiation.

  • type – The type of nonlinear solver to use.

Returns:

A ks_ptr to a new Nonlinear solver instance.

Protected Functions

virtual void _makeHealthy() final override#

Internal method to ensure the solver is ready.