GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
gtsam::DoglegParams Class Reference

#include <DoglegOptimizer.h>

Inheritance diagram for gtsam::DoglegParams:
Inheritance graph
[legend]
Collaboration diagram for gtsam::DoglegParams:
Collaboration graph
[legend]

Public Types

enum  VerbosityDL { SILENT, VERBOSE }
 
enum  Verbosity {
  SILENT, TERMINATION, ERROR, VALUES,
  DELTA, LINEAR
}
 
enum  LinearSolverType {
  MULTIFRONTAL_CHOLESKY, MULTIFRONTAL_QR, SEQUENTIAL_CHOLESKY, SEQUENTIAL_QR,
  Iterative, CHOLMOD
}
 
using IterationHook = std::function< void(size_t, double, double)>
 

Public Member Functions

void print (const std::string &str="") const override
 
double getDeltaInitial () const
 
std::string getVerbosityDL () const
 
void setDeltaInitial (double deltaInitial)
 
void setVerbosityDL (const std::string &verbosityDL)
 
size_t getMaxIterations () const
 
double getRelativeErrorTol () const
 
double getAbsoluteErrorTol () const
 
double getErrorTol () const
 
std::string getVerbosity () const
 
void setMaxIterations (int value)
 
void setRelativeErrorTol (double value)
 
void setAbsoluteErrorTol (double value)
 
void setErrorTol (double value)
 
void setVerbosity (const std::string &src)
 
bool equals (const NonlinearOptimizerParams &other, double tol=1e-9) const
 
bool isMultifrontal () const
 
bool isSequential () const
 
bool isCholmod () const
 
bool isIterative () const
 
GaussianFactorGraph::Eliminate getEliminationFunction () const
 
std::string getLinearSolverType () const
 
void setLinearSolverType (const std::string &solver)
 
void setIterativeParams (const std::shared_ptr< IterativeOptimizationParameters > params)
 
void setOrdering (const Ordering &ordering)
 
std::string getOrderingType () const
 
void setOrderingType (const std::string &ordering)
 

Static Public Member Functions

static Verbosity verbosityTranslator (const std::string &s)
 
static std::string verbosityTranslator (Verbosity value)
 

Public Attributes

double deltaInitial
 The initial trust region radius (default: 10.0)
 
VerbosityDL verbosityDL
 The verbosity level for Dogleg (default: SILENT), see also NonlinearOptimizerParams::verbosity.
 
size_t maxIterations = 100
 The maximum iterations to stop iterating (default 100)
 
double relativeErrorTol = 1e-5
 The maximum relative error decrease to stop iterating (default 1e-5)
 
double absoluteErrorTol = 1e-5
 The maximum absolute error decrease to stop iterating (default 1e-5)
 
double errorTol = 0.0
 The maximum total error to stop iterating (default 0.0)
 
Verbosity verbosity = SILENT
 The printing verbosity during optimization (default SILENT)
 
Ordering::OrderingType orderingType = Ordering::COLAMD
 The method of ordering use during variable elimination (default COLAMD)
 
IterationHook iterationHook
 
LinearSolverType linearSolverType = MULTIFRONTAL_CHOLESKY
 The type of linear solver to use in the nonlinear optimizer.
 
std::optional< Orderingordering
 The optional variable elimination ordering, or empty to use COLAMD (default: empty)
 
IterativeOptimizationParameters::shared_ptr iterativeParams
 The container for iterativeOptimization parameters. used in CG Solvers.
 

Detailed Description

Parameters for Levenberg-Marquardt optimization. Note that this parameters class inherits from NonlinearOptimizerParams, which specifies the parameters common to all nonlinear optimization algorithms. This class also contains all of those parameters.

Member Typedef Documentation

◆ IterationHook

using gtsam::NonlinearOptimizerParams::IterationHook = std::function< void(size_t , double, double)>
inherited

Type for an optional user-provided hook to be called after each internal optimizer iteration. See iterationHook below.

Member Enumeration Documentation

◆ LinearSolverType

◆ Verbosity

◆ VerbosityDL

See DoglegParams::dlVerbosity

Member Data Documentation

◆ iterationHook

IterationHook gtsam::NonlinearOptimizerParams::iterationHook
inherited

Optional user-provided iteration hook to be called after each optimization iteration (Default: none). Note that IterationHook is defined as a std::function<> with this signature:

void(size_t iteration, double errorBefore, double errorAfter)

which allows binding by means of a reference to a regular function:

void foo(size_t iteration, double errorBefore, double errorAfter);
// ...
lmOpts.iterationHook = &foo;

or to a C++11 lambda (preferred if you need to capture additional context variables, such that the optimizer object itself, the factor graph, etc.):

lmOpts.iterationHook = [&](size_t iter, double oldError, double newError)
{
// ...
};

or to the result of a properly-formed std::bind call.


The documentation for this class was generated from the following file: