DoglegOptimizer.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 #pragma once
20 
22 
23 namespace gtsam {
24 
25 class DoglegOptimizer;
26 
32 class GTSAM_EXPORT DoglegParams : public NonlinearOptimizerParams {
33 public:
35  enum VerbosityDL {
37  VERBOSE
38  };
39 
40  double deltaInitial;
42 
44  deltaInitial(1.0), verbosityDL(SILENT) {}
45 
46  ~DoglegParams() override {}
47 
48  void print(const std::string& str = "") const override {
50  std::cout << " deltaInitial: " << deltaInitial << "\n";
51  std::cout.flush();
52  }
53 
54  double getDeltaInitial() const { return deltaInitial; }
55  std::string getVerbosityDL() const { return verbosityDLTranslator(verbosityDL); }
56 
57  void setDeltaInitial(double deltaInitial) { this->deltaInitial = deltaInitial; }
58  void setVerbosityDL(const std::string& verbosityDL) { this->verbosityDL = verbosityDLTranslator(verbosityDL); }
59 
60 private:
61  VerbosityDL verbosityDLTranslator(const std::string& verbosityDL) const;
62  std::string verbosityDLTranslator(VerbosityDL verbosityDL) const;
63 };
64 
68 class GTSAM_EXPORT DoglegOptimizer : public NonlinearOptimizer {
69 
70 protected:
72 
73 public:
74  typedef std::shared_ptr<DoglegOptimizer> shared_ptr;
75 
78 
87  DoglegOptimizer(const NonlinearFactorGraph& graph, const Values& initialValues,
88  const DoglegParams& params = DoglegParams());
89 
97  DoglegOptimizer(const NonlinearFactorGraph& graph, const Values& initialValues,
98  const Ordering& ordering);
99 
101 
104 
106  ~DoglegOptimizer() override {}
107 
112  GaussianFactorGraph::shared_ptr iterate() override;
113 
115  const DoglegParams& params() const { return params_; }
116 
118  double getDelta() const;
119 
121 
122 protected:
124  const NonlinearOptimizerParams& _params() const override { return params_; }
125 
127  DoglegParams ensureHasOrdering(DoglegParams params, const NonlinearFactorGraph& graph) const;
128 };
129 
130 }
gtsam::GaussianFactorGraph::shared_ptr
std::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition: GaussianFactorGraph.h:82
gtsam::DoglegParams::setVerbosityDL
void setVerbosityDL(const std::string &verbosityDL)
Definition: DoglegOptimizer.h:58
gtsam::DoglegParams::SILENT
@ SILENT
Definition: DoglegOptimizer.h:36
gtsam::DoglegParams::deltaInitial
double deltaInitial
The initial trust region radius (default: 10.0)
Definition: DoglegOptimizer.h:40
NonlinearOptimizer.h
Base class and parameters for nonlinear optimization algorithms.
gtsam::DoglegParams::~DoglegParams
~DoglegParams() override
Definition: DoglegOptimizer.h:46
vanilla::params
static const SmartProjectionParams params
Definition: smartFactorScenarios.h:69
gtsam::DoglegParams::getDeltaInitial
double getDeltaInitial() const
Definition: DoglegOptimizer.h:54
gtsam::DoglegOptimizer
Definition: DoglegOptimizer.h:68
gtsam::DoglegParams::verbosityDL
VerbosityDL verbosityDL
The verbosity level for Dogleg (default: SILENT), see also NonlinearOptimizerParams::verbosity.
Definition: DoglegOptimizer.h:41
gtsam::DoglegParams::VerbosityDL
VerbosityDL
Definition: DoglegOptimizer.h:35
gtsam::NonlinearOptimizerParams
Definition: NonlinearOptimizerParams.h:35
gtsam::NonlinearFactorGraph
Definition: NonlinearFactorGraph.h:55
gtsam::DoglegOptimizer::_params
const NonlinearOptimizerParams & _params() const override
Definition: DoglegOptimizer.h:124
gtsam::DoglegParams::print
void print(const std::string &str="") const override
Definition: DoglegOptimizer.h:48
ordering
static enum @1096 ordering
gtsam::DoglegParams
Definition: DoglegOptimizer.h:32
str
Definition: pytypes.h:1558
gtsam::DoglegOptimizer::params_
DoglegParams params_
Definition: DoglegOptimizer.h:71
gtsam::DoglegParams::setDeltaInitial
void setDeltaInitial(double deltaInitial)
Definition: DoglegOptimizer.h:57
gtsam::NonlinearOptimizerParams::print
virtual void print(const std::string &str="") const
Definition: NonlinearOptimizerParams.cpp:75
gtsam::DoglegOptimizer::~DoglegOptimizer
~DoglegOptimizer() override
Definition: DoglegOptimizer.h:106
gtsam
traits
Definition: SFMdata.h:40
gtsam::NonlinearOptimizer
Definition: NonlinearOptimizer.h:75
gtsam::Values
Definition: Values.h:65
gtsam::DoglegOptimizer::shared_ptr
std::shared_ptr< DoglegOptimizer > shared_ptr
Definition: DoglegOptimizer.h:74
gtsam::DoglegParams::getVerbosityDL
std::string getVerbosityDL() const
Definition: DoglegOptimizer.h:55
gtsam::DoglegParams::DoglegParams
DoglegParams()
Definition: DoglegOptimizer.h:43
graph
NonlinearFactorGraph graph
Definition: doc/Code/OdometryExample.cpp:2
gtsam::Ordering
Definition: inference/Ordering.h:33
gtsam::DoglegOptimizer::params
const DoglegParams & params() const
Definition: DoglegOptimizer.h:115


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:29