12 #include <boost/algorithm/string.hpp> 18 const std::string &src) {
20 boost::algorithm::to_upper(s);
31 if (s ==
"TERMINATION")
70 const boost::shared_ptr<IterativeOptimizationParameters>
params) {
78 std::cout << str <<
"\n";
81 std::cout <<
" total error threshold: " <<
errorTol <<
"\n";
82 std::cout <<
" maximum iterations: " <<
maxIterations <<
"\n";
89 std::cout <<
" linear solver type: MULTIFRONTAL CHOLESKY\n";
92 std::cout <<
" linear solver type: MULTIFRONTAL QR\n";
95 std::cout <<
" linear solver type: SEQUENTIAL CHOLESKY\n";
98 std::cout <<
" linear solver type: SEQUENTIAL QR\n";
101 std::cout <<
" linear solver type: CHOLMOD\n";
104 std::cout <<
" linear solver type: ITERATIVE\n";
107 std::cout <<
" linear solver type: (invalid)\n";
113 std::cout <<
" ordering: COLAMD\n";
116 std::cout <<
" ordering: METIS\n";
119 std::cout <<
" ordering: custom\n";
129 switch (linearSolverType) {
131 return "MULTIFRONTAL_CHOLESKY";
133 return "MULTIFRONTAL_QR";
135 return "SEQUENTIAL_CHOLESKY";
137 return "SEQUENTIAL_QR";
143 throw std::invalid_argument(
144 "Unknown linear solver type in SuccessiveLinearizationOptimizer");
151 if (linearSolverType ==
"MULTIFRONTAL_CHOLESKY")
153 if (linearSolverType ==
"MULTIFRONTAL_QR")
155 if (linearSolverType ==
"SEQUENTIAL_CHOLESKY")
157 if (linearSolverType ==
"SEQUENTIAL_QR")
159 if (linearSolverType ==
"ITERATIVE")
161 if (linearSolverType ==
"CHOLMOD")
163 throw std::invalid_argument(
164 "Unknown linear solver type in SuccessiveLinearizationOptimizer");
179 throw std::invalid_argument(
180 "Invalid ordering type: You must provide an ordering for a custom ordering type. See setOrdering");
186 const std::string&
type)
const {
189 if (type ==
"COLAMD")
191 throw std::invalid_argument(
192 "Invalid ordering type: You must provide an ordering for a custom ordering type. See setOrdering");
std::string linearSolverTranslator(LinearSolverType linearSolverType) const
static Verbosity verbosityTranslator(const std::string &s)
Verbosity verbosity
The printing verbosity during optimization (default SILENT)
void setIterativeParams(const boost::shared_ptr< IterativeOptimizationParameters > params)
double absoluteErrorTol
The maximum absolute error decrease to stop iterating (default 1e-5)
double relativeErrorTol
The maximum relative error decrease to stop iterating (default 1e-5)
double errorTol
The maximum total error to stop iterating (default 0.0)
boost::optional< Ordering > ordering
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.
OrderingType
Type of ordering to use.
static SmartStereoProjectionParams params
virtual void print(const std::string &str="") const
std::string orderingTypeTranslator(Ordering::OrderingType type) const
Parameters for nonlinear optimization.
Ordering::OrderingType orderingType
The method of ordering use during variable elimination (default COLAMD)
LinearSolverType linearSolverType
The type of linear solver to use in the nonlinear optimizer.
size_t maxIterations
The maximum iterations to stop iterating (default 100)