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 boost::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 }
VerbosityDL verbosityDL
The verbosity level for Dogleg (default: SILENT), see also NonlinearOptimizerParams::verbosity.
static enum @843 ordering
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
NonlinearFactorGraph graph
boost::shared_ptr< DoglegOptimizer > shared_ptr
const DoglegParams & params() const
double getDeltaInitial() const
void setDeltaInitial(double deltaInitial)
Definition: pytypes.h:928
const NonlinearOptimizerParams & _params() const override
double deltaInitial
The initial trust region radius (default: 10.0)
static SmartStereoProjectionParams params
virtual void print(const std::string &str="") const
traits
Definition: chartTesting.h:28
std::string getVerbosityDL() const
void setVerbosityDL(const std::string &verbosityDL)
Base class and parameters for nonlinear optimization algorithms.
~DoglegParams() override
void print(const std::string &str="") const override


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:41:59