38 SILENT, TERMINATION, ERROR, VALUES, DELTA, LINEAR
41 size_t maxIterations = 100;
42 double relativeErrorTol = 1e-5;
43 double absoluteErrorTol = 1e-5;
44 double errorTol = 0.0;
48 size_t getMaxIterations()
const {
return maxIterations; }
49 double getRelativeErrorTol()
const {
return relativeErrorTol; }
50 double getAbsoluteErrorTol()
const {
return absoluteErrorTol; }
51 double getErrorTol()
const {
return errorTol; }
52 std::string getVerbosity()
const {
return verbosityTranslator(verbosity); }
54 void setMaxIterations(
int value) { maxIterations = value; }
55 void setRelativeErrorTol(
double value) { relativeErrorTol = value; }
56 void setAbsoluteErrorTol(
double value) { absoluteErrorTol = value; }
57 void setErrorTol(
double value) { errorTol = value; }
58 void setVerbosity(
const std::string& src) {
59 verbosity = verbosityTranslator(src);
62 static Verbosity verbosityTranslator(
const std::string &s) ;
63 static std::string verbosityTranslator(Verbosity value) ;
68 void(
size_t ,
double,
double)>;
98 MULTIFRONTAL_CHOLESKY,
114 virtual void print(
const std::string& str =
"")
const;
117 return maxIterations == other.getMaxIterations()
118 && std::abs(relativeErrorTol - other.getRelativeErrorTol()) <= tol
119 && std::abs(absoluteErrorTol - other.getAbsoluteErrorTol()) <= tol
120 && std::abs(errorTol - other.getErrorTol()) <= tol
121 && verbosityTranslator(verbosity) == other.getVerbosity();
127 inline bool isMultifrontal()
const {
128 return (linearSolverType == MULTIFRONTAL_CHOLESKY)
129 || (linearSolverType == MULTIFRONTAL_QR);
132 inline bool isSequential()
const {
133 return (linearSolverType == SEQUENTIAL_CHOLESKY)
134 || (linearSolverType == SEQUENTIAL_QR);
137 inline bool isCholmod()
const {
138 return (linearSolverType == CHOLMOD);
141 inline bool isIterative()
const {
142 return (linearSolverType == Iterative);
145 GaussianFactorGraph::Eliminate getEliminationFunction()
const {
146 switch (linearSolverType) {
147 case MULTIFRONTAL_CHOLESKY:
148 case SEQUENTIAL_CHOLESKY:
151 case MULTIFRONTAL_QR:
156 throw std::runtime_error(
157 "Nonlinear optimization parameter \"factorization\" is invalid");
161 std::string getLinearSolverType()
const {
162 return linearSolverTranslator(linearSolverType);
165 void setLinearSolverType(
const std::string& solver) {
166 linearSolverType = linearSolverTranslator(solver);
169 void setIterativeParams(
const boost::shared_ptr<IterativeOptimizationParameters> params);
171 void setOrdering(
const Ordering& ordering) {
172 this->ordering = ordering;
173 this->orderingType = Ordering::CUSTOM;
176 std::string getOrderingType()
const {
177 return orderingTypeTranslator(orderingType);
181 void setOrderingType(
const std::string& ordering){
182 orderingType = orderingTypeTranslator(ordering);
186 std::string linearSolverTranslator(LinearSolverType linearSolverType)
const;
187 LinearSolverType linearSolverTranslator(
const std::string& linearSolverType)
const;
188 std::string orderingTypeTranslator(Ordering::OrderingType type)
const;
189 Ordering::OrderingType orderingTypeTranslator(
const std::string& type)
const;
std::pair< boost::shared_ptr< GaussianConditional >, boost::shared_ptr< GaussianFactor > > EliminatePreferCholesky(const GaussianFactorGraph &factors, const Ordering &keys)
Densely partially eliminate with Cholesky factorization.
Definition HessianFactor.cpp:548
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:156
std::pair< GaussianConditional::shared_ptr, JacobianFactor::shared_ptr > EliminateQR(const GaussianFactorGraph &factors, const Ordering &keys)
Multiply all factors and eliminate the given keys from the resulting factor using a QR variant that h...
Definition JacobianFactor.cpp:789
std::function< void(size_t, double, double)> IterationHook
Type for an optional user-provided hook to be called after each internal optimizer iteration.
Definition NonlinearOptimizerParams.h:68
boost::optional< Ordering > ordering
The optional variable elimination ordering, or empty to use COLAMD (default: empty)
Definition NonlinearOptimizerParams.h:107