Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
gtsam::NonlinearOptimizerParams Class Reference

#include <NonlinearOptimizerParams.h>

Inheritance diagram for gtsam::NonlinearOptimizerParams:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Private Member Functions

std::string linearSolverTranslator (LinearSolverType linearSolverType) const
 
LinearSolverType linearSolverTranslator (const std::string &linearSolverType) const
 
std::string orderingTypeTranslator (Ordering::OrderingType type) const
 
Ordering::OrderingType orderingTypeTranslator (const std::string &type) const
 

Detailed Description

The common parameters for Nonlinear optimizers. Most optimizers deriving from NonlinearOptimizer also subclass the parameters.

Definition at line 34 of file NonlinearOptimizerParams.h.

Member Typedef Documentation

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

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

Definition at line 68 of file NonlinearOptimizerParams.h.

Member Enumeration Documentation

See NonlinearOptimizerParams::linearSolverType

Enumerator
MULTIFRONTAL_CHOLESKY 
MULTIFRONTAL_QR 
SEQUENTIAL_CHOLESKY 
SEQUENTIAL_QR 
Iterative 
CHOLMOD 

Definition at line 97 of file NonlinearOptimizerParams.h.

See NonlinearOptimizerParams::verbosity

Enumerator
SILENT 
TERMINATION 
ERROR 
VALUES 
DELTA 
LINEAR 

Definition at line 37 of file NonlinearOptimizerParams.h.

Constructor & Destructor Documentation

gtsam::NonlinearOptimizerParams::NonlinearOptimizerParams ( )
default
virtual gtsam::NonlinearOptimizerParams::~NonlinearOptimizerParams ( )
inlinevirtual

Definition at line 111 of file NonlinearOptimizerParams.h.

Member Function Documentation

bool gtsam::NonlinearOptimizerParams::equals ( const NonlinearOptimizerParams other,
double  tol = 1e-9 
) const
inline

Definition at line 116 of file NonlinearOptimizerParams.h.

double gtsam::NonlinearOptimizerParams::getAbsoluteErrorTol ( ) const
inline

Definition at line 50 of file NonlinearOptimizerParams.h.

GaussianFactorGraph::Eliminate gtsam::NonlinearOptimizerParams::getEliminationFunction ( ) const
inline

Definition at line 145 of file NonlinearOptimizerParams.h.

double gtsam::NonlinearOptimizerParams::getErrorTol ( ) const
inline

Definition at line 51 of file NonlinearOptimizerParams.h.

std::string gtsam::NonlinearOptimizerParams::getLinearSolverType ( ) const
inline

Definition at line 161 of file NonlinearOptimizerParams.h.

size_t gtsam::NonlinearOptimizerParams::getMaxIterations ( ) const
inline

Definition at line 48 of file NonlinearOptimizerParams.h.

std::string gtsam::NonlinearOptimizerParams::getOrderingType ( ) const
inline

Definition at line 176 of file NonlinearOptimizerParams.h.

double gtsam::NonlinearOptimizerParams::getRelativeErrorTol ( ) const
inline

Definition at line 49 of file NonlinearOptimizerParams.h.

std::string gtsam::NonlinearOptimizerParams::getVerbosity ( ) const
inline

Definition at line 52 of file NonlinearOptimizerParams.h.

bool gtsam::NonlinearOptimizerParams::isCholmod ( ) const
inline

Definition at line 137 of file NonlinearOptimizerParams.h.

bool gtsam::NonlinearOptimizerParams::isIterative ( ) const
inline

Definition at line 141 of file NonlinearOptimizerParams.h.

bool gtsam::NonlinearOptimizerParams::isMultifrontal ( ) const
inline

Definition at line 127 of file NonlinearOptimizerParams.h.

bool gtsam::NonlinearOptimizerParams::isSequential ( ) const
inline

Definition at line 132 of file NonlinearOptimizerParams.h.

std::string gtsam::NonlinearOptimizerParams::linearSolverTranslator ( LinearSolverType  linearSolverType) const
private

Definition at line 127 of file NonlinearOptimizerParams.cpp.

NonlinearOptimizerParams::LinearSolverType gtsam::NonlinearOptimizerParams::linearSolverTranslator ( const std::string &  linearSolverType) const
private

Definition at line 149 of file NonlinearOptimizerParams.cpp.

std::string gtsam::NonlinearOptimizerParams::orderingTypeTranslator ( Ordering::OrderingType  type) const
private

Definition at line 168 of file NonlinearOptimizerParams.cpp.

Ordering::OrderingType gtsam::NonlinearOptimizerParams::orderingTypeTranslator ( const std::string &  type) const
private

Definition at line 185 of file NonlinearOptimizerParams.cpp.

void gtsam::NonlinearOptimizerParams::print ( const std::string &  str = "") const
virtual

Reimplemented in gtsam::LevenbergMarquardtParams, and gtsam::DoglegParams.

Definition at line 75 of file NonlinearOptimizerParams.cpp.

void gtsam::NonlinearOptimizerParams::setAbsoluteErrorTol ( double  value)
inline

Definition at line 56 of file NonlinearOptimizerParams.h.

void gtsam::NonlinearOptimizerParams::setErrorTol ( double  value)
inline

Definition at line 57 of file NonlinearOptimizerParams.h.

void gtsam::NonlinearOptimizerParams::setIterativeParams ( const boost::shared_ptr< IterativeOptimizationParameters params)

Definition at line 69 of file NonlinearOptimizerParams.cpp.

void gtsam::NonlinearOptimizerParams::setLinearSolverType ( const std::string &  solver)
inline

Definition at line 165 of file NonlinearOptimizerParams.h.

void gtsam::NonlinearOptimizerParams::setMaxIterations ( int  value)
inline

Definition at line 54 of file NonlinearOptimizerParams.h.

void gtsam::NonlinearOptimizerParams::setOrdering ( const Ordering ordering)
inline

Definition at line 171 of file NonlinearOptimizerParams.h.

void gtsam::NonlinearOptimizerParams::setOrderingType ( const std::string &  ordering)
inline

Definition at line 181 of file NonlinearOptimizerParams.h.

void gtsam::NonlinearOptimizerParams::setRelativeErrorTol ( double  value)
inline

Definition at line 55 of file NonlinearOptimizerParams.h.

void gtsam::NonlinearOptimizerParams::setVerbosity ( const std::string &  src)
inline

Definition at line 58 of file NonlinearOptimizerParams.h.

NonlinearOptimizerParams::Verbosity gtsam::NonlinearOptimizerParams::verbosityTranslator ( const std::string &  s)
static

Definition at line 17 of file NonlinearOptimizerParams.cpp.

std::string gtsam::NonlinearOptimizerParams::verbosityTranslator ( Verbosity  value)
static

Definition at line 39 of file NonlinearOptimizerParams.cpp.

Member Data Documentation

double gtsam::NonlinearOptimizerParams::absoluteErrorTol = 1e-5

The maximum absolute error decrease to stop iterating (default 1e-5)

Definition at line 43 of file NonlinearOptimizerParams.h.

double gtsam::NonlinearOptimizerParams::errorTol = 0.0

The maximum total error to stop iterating (default 0.0)

Definition at line 44 of file NonlinearOptimizerParams.h.

IterationHook gtsam::NonlinearOptimizerParams::iterationHook

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.

Definition at line 94 of file NonlinearOptimizerParams.h.

IterativeOptimizationParameters::shared_ptr gtsam::NonlinearOptimizerParams::iterativeParams

The container for iterativeOptimization parameters. used in CG Solvers.

Definition at line 108 of file NonlinearOptimizerParams.h.

LinearSolverType gtsam::NonlinearOptimizerParams::linearSolverType = MULTIFRONTAL_CHOLESKY

The type of linear solver to use in the nonlinear optimizer.

Definition at line 106 of file NonlinearOptimizerParams.h.

size_t gtsam::NonlinearOptimizerParams::maxIterations = 100

The maximum iterations to stop iterating (default 100)

Definition at line 41 of file NonlinearOptimizerParams.h.

boost::optional<Ordering> gtsam::NonlinearOptimizerParams::ordering

The optional variable elimination ordering, or empty to use COLAMD (default: empty)

Definition at line 107 of file NonlinearOptimizerParams.h.

Ordering::OrderingType gtsam::NonlinearOptimizerParams::orderingType = Ordering::COLAMD

The method of ordering use during variable elimination (default COLAMD)

Definition at line 46 of file NonlinearOptimizerParams.h.

double gtsam::NonlinearOptimizerParams::relativeErrorTol = 1e-5

The maximum relative error decrease to stop iterating (default 1e-5)

Definition at line 42 of file NonlinearOptimizerParams.h.

Verbosity gtsam::NonlinearOptimizerParams::verbosity = SILENT

The printing verbosity during optimization (default SILENT)

Definition at line 45 of file NonlinearOptimizerParams.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:18