Loading...
Searching...
No Matches
DoglegOptimizer.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/nonlinear/NonlinearOptimizer.h>
namespace gtsam {
class DoglegOptimizer;
class GTSAM_EXPORT DoglegParams : public NonlinearOptimizerParams {
public:
enum VerbosityDL {
SILENT,
VERBOSE
};
double deltaInitial;
VerbosityDL verbosityDL;
DoglegParams() :
deltaInitial(1.0), verbosityDL(SILENT) {}
~DoglegParams() override {}
void print(const std::string& str = "") const override {
NonlinearOptimizerParams::print(str);
std::cout << " deltaInitial: " << deltaInitial << "\n";
std::cout.flush();
}
double getDeltaInitial() const { return deltaInitial; }
std::string getVerbosityDL() const { return verbosityDLTranslator(verbosityDL); }
void setDeltaInitial(double deltaInitial) { this->deltaInitial = deltaInitial; }
void setVerbosityDL(const std::string& verbosityDL) { this->verbosityDL = verbosityDLTranslator(verbosityDL); }
private:
VerbosityDL verbosityDLTranslator(const std::string& verbosityDL) const;
std::string verbosityDLTranslator(VerbosityDL verbosityDL) const;
};
class GTSAM_EXPORT DoglegOptimizer : public NonlinearOptimizer {
protected:
DoglegParams params_;
public:
typedef boost::shared_ptr<DoglegOptimizer> shared_ptr;
DoglegOptimizer(const NonlinearFactorGraph& graph, const Values& initialValues,
const DoglegParams& params = DoglegParams());
DoglegOptimizer(const NonlinearFactorGraph& graph, const Values& initialValues,
const Ordering& ordering);
~DoglegOptimizer() override {}
GaussianFactorGraph::shared_ptr iterate() override;
const DoglegParams& params() const { return params_; }
double getDelta() const;
protected:
const NonlinearOptimizerParams& _params() const override { return params_; }
DoglegParams ensureHasOrdering(DoglegParams params, const NonlinearFactorGraph& graph) const;
};
}
NonlinearOptimizer.h
Base class and parameters for nonlinear optimization algorithms.
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::Ordering
Definition Ordering.h:34
gtsam::GaussianFactorGraph::shared_ptr
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition GaussianFactorGraph.h:81
gtsam::DoglegParams
Parameters for Levenberg-Marquardt optimization.
Definition DoglegOptimizer.h:32
gtsam::DoglegParams::VerbosityDL
VerbosityDL
See DoglegParams::dlVerbosity.
Definition DoglegOptimizer.h:35
gtsam::DoglegParams::verbosityDL
VerbosityDL verbosityDL
The verbosity level for Dogleg (default: SILENT), see also NonlinearOptimizerParams::verbosity.
Definition DoglegOptimizer.h:41
gtsam::DoglegParams::deltaInitial
double deltaInitial
The initial trust region radius (default: 10.0).
Definition DoglegOptimizer.h:40
gtsam::DoglegOptimizer
This class performs Dogleg nonlinear optimization.
Definition DoglegOptimizer.h:68
gtsam::DoglegOptimizer::~DoglegOptimizer
~DoglegOptimizer() override
Virtual destructor.
Definition DoglegOptimizer.h:106
gtsam::DoglegOptimizer::DoglegOptimizer
DoglegOptimizer(const NonlinearFactorGraph &graph, const Values &initialValues, const DoglegParams &params=DoglegParams())
Standard constructor, requires a nonlinear factor graph, initial variable assignments,...
Definition DoglegOptimizer.cpp:65
gtsam::DoglegOptimizer::_params
const NonlinearOptimizerParams & _params() const override
Access the parameters (base class version).
Definition DoglegOptimizer.h:124
gtsam::DoglegOptimizer::params
const DoglegParams & params() const
Read-only access the parameters.
Definition DoglegOptimizer.h:115
gtsam::NonlinearFactorGraph
Definition NonlinearFactorGraph.h:55
gtsam::NonlinearOptimizer::graph
const NonlinearFactorGraph & graph() const
return the graph with nonlinear factors
Definition NonlinearOptimizer.h:118
gtsam::NonlinearOptimizer::NonlinearOptimizer
NonlinearOptimizer(const NonlinearFactorGraph &graph, std::unique_ptr< internal::NonlinearOptimizerState > state)
Constructor for initial construction of base classes.
Definition NonlinearOptimizer.cpp:44
gtsam::NonlinearOptimizerParams
The common parameters for Nonlinear optimizers.
Definition NonlinearOptimizerParams.h:34
gtsam::Values
A non-templated config holding any types of Manifold-group elements.
Definition Values.h:65