39 SILENT, TERMINATION, ERROR, VALUES, DELTA, LINEAR
42 size_t maxIterations = 100;
43 double relativeErrorTol = 1e-5;
44 double absoluteErrorTol = 1e-5;
45 double errorTol = 0.0;
49 size_t getMaxIterations()
const {
return maxIterations; }
50 double getRelativeErrorTol()
const {
return relativeErrorTol; }
51 double getAbsoluteErrorTol()
const {
return absoluteErrorTol; }
52 double getErrorTol()
const {
return errorTol; }
53 std::string getVerbosity()
const {
return verbosityTranslator(verbosity); }
55 void setMaxIterations(
int value) { maxIterations = value; }
56 void setRelativeErrorTol(
double value) { relativeErrorTol = value; }
57 void setAbsoluteErrorTol(
double value) { absoluteErrorTol = value; }
58 void setErrorTol(
double value) { errorTol = value; }
59 void setVerbosity(
const std::string& src) {
60 verbosity = verbosityTranslator(src);
63 static Verbosity verbosityTranslator(
const std::string &s) ;
64 static std::string verbosityTranslator(
Verbosity value) ;
69 void(
size_t ,
double,
double)>;
99 MULTIFRONTAL_CHOLESKY,
115 virtual void print(
const std::string& str =
"")
const;
118 return maxIterations == other.getMaxIterations()
119 && std::abs(relativeErrorTol - other.getRelativeErrorTol()) <= tol
120 && std::abs(absoluteErrorTol - other.getAbsoluteErrorTol()) <= tol
121 && std::abs(errorTol - other.getErrorTol()) <= tol
122 && verbosityTranslator(verbosity) == other.getVerbosity();
128 inline bool isMultifrontal()
const {
129 return (linearSolverType == MULTIFRONTAL_CHOLESKY)
130 || (linearSolverType == MULTIFRONTAL_QR);
133 inline bool isSequential()
const {
134 return (linearSolverType == SEQUENTIAL_CHOLESKY)
135 || (linearSolverType == SEQUENTIAL_QR);
138 inline bool isCholmod()
const {
139 return (linearSolverType == CHOLMOD);
142 inline bool isIterative()
const {
143 return (linearSolverType == Iterative);
147 switch (linearSolverType) {
148 case MULTIFRONTAL_CHOLESKY:
149 case SEQUENTIAL_CHOLESKY:
152 case MULTIFRONTAL_QR:
157 throw std::runtime_error(
158 "Nonlinear optimization parameter \"factorization\" is invalid");
162 std::string getLinearSolverType()
const {
163 return linearSolverTranslator(linearSolverType);
166 void setLinearSolverType(
const std::string& solver) {
167 linearSolverType = linearSolverTranslator(solver);
170 void setIterativeParams(
const std::shared_ptr<IterativeOptimizationParameters> params);
172 void setOrdering(
const Ordering& ordering) {
173 this->ordering = ordering;
174 this->orderingType = Ordering::CUSTOM;
177 std::string getOrderingType()
const {
178 return orderingTypeTranslator(orderingType);
182 void setOrderingType(
const std::string& ordering){
183 orderingType = orderingTypeTranslator(ordering);
187 std::string linearSolverTranslator(
LinearSolverType linearSolverType)
const;
188 LinearSolverType linearSolverTranslator(
const std::string& linearSolverType)
const;
LinearSolverType
Definition: NonlinearOptimizerParams.h:98
IterationHook iterationHook
Definition: NonlinearOptimizerParams.h:95
Subgraph Solver from IROS 2010.
std::function< void(size_t, double, double)> IterationHook
Definition: NonlinearOptimizerParams.h:69
Definition: Ordering.h:37
GTSAM_EXPORT std::pair< std::shared_ptr< GaussianConditional >, std::shared_ptr< JacobianFactor > > EliminateQR(const GaussianFactorGraph &factors, const Ordering &keys)
Definition: Testable.h:112
std::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
The function type that does a single dense elimination step on a subgraph.
Definition: EliminateableFactorGraph.h:88
GTSAM_EXPORT void print(const Matrix &A, const std::string &s, std::ostream &stream)
Linear Factor Graph where all factors are Gaussians.
IterativeOptimizationParameters::shared_ptr iterativeParams
The container for iterativeOptimization parameters. used in CG Solvers.
Definition: NonlinearOptimizerParams.h:109
OrderingType
Type of ordering to use.
Definition: Ordering.h:44
Verbosity
Definition: NonlinearOptimizerParams.h:38
Definition: chartTesting.h:28
Definition: NonlinearOptimizerParams.h:35
GTSAM_EXPORT std::pair< std::shared_ptr< GaussianConditional >, std::shared_ptr< GaussianFactor > > EliminatePreferCholesky(const GaussianFactorGraph &factors, const Ordering &keys)
std::optional< Ordering > ordering
The optional variable elimination ordering, or empty to use COLAMD (default: empty) ...
Definition: NonlinearOptimizerParams.h:108