gtsam
nonlinear
NonlinearOptimizer.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
21
#include <
gtsam/nonlinear/NonlinearFactorGraph.h
>
22
#include <
gtsam/nonlinear/NonlinearOptimizerParams.h
>
23
24
namespace
gtsam
{
25
26
namespace
internal
{
struct
NonlinearOptimizerState; }
27
75
class
GTSAM_EXPORT
NonlinearOptimizer
{
76
77
protected
:
78
NonlinearFactorGraph
graph_
;
79
80
std::unique_ptr<internal::NonlinearOptimizerState>
state_
;
81
82
public
:
84
using
shared_ptr
= std::shared_ptr<const NonlinearOptimizer>;
85
88
98
virtual
const
Values
&
optimize
() { defaultOptimize();
return
values
(); }
99
106
const
Values
& optimizeSafely();
107
109
double
error
()
const
;
110
112
size_t
iterations()
const
;
113
115
const
Values
&
values
()
const
;
116
118
const
NonlinearFactorGraph
&
graph
()
const
{
return
graph_; }
119
121
124
126
virtual
~
NonlinearOptimizer
();
127
129
virtual
VectorValues
solve(
const
GaussianFactorGraph
&gfg,
130
const
NonlinearOptimizerParams
&
params
)
const
;
131
136
virtual
GaussianFactorGraph::shared_ptr
iterate() = 0;
137
139
140
protected
:
144
void
defaultOptimize();
145
146
virtual
const
NonlinearOptimizerParams
& _params()
const
= 0;
147
149
NonlinearOptimizer
(
const
NonlinearFactorGraph
&
graph
,
150
std::unique_ptr<internal::NonlinearOptimizerState>
state
);
151
};
152
157
GTSAM_EXPORT
bool
checkConvergence
(
double
relativeErrorTreshold,
158
double
absoluteErrorTreshold,
double
errorThreshold,
159
double
currentError,
double
newError,
NonlinearOptimizerParams::Verbosity
verbosity =
NonlinearOptimizerParams::SILENT
);
160
161
GTSAM_EXPORT
bool
checkConvergence
(
const
NonlinearOptimizerParams&
params
,
double
currentError,
162
double
newError);
163
164
}
// gtsam
gtsam::NonlinearOptimizer::optimize
virtual const Values & optimize()
Definition:
NonlinearOptimizer.h:98
gtsam::GaussianFactorGraph::shared_ptr
std::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition:
GaussianFactorGraph.h:82
gtsam::NonlinearOptimizer::graph
const NonlinearFactorGraph & graph() const
return the graph with nonlinear factors
Definition:
NonlinearOptimizer.h:118
gtsam::NonlinearOptimizerParams::SILENT
@ SILENT
Definition:
NonlinearOptimizerParams.h:39
gtsam::NonlinearOptimizerParams::Verbosity
Verbosity
Definition:
NonlinearOptimizerParams.h:38
different_sigmas::values
HybridValues values
Definition:
testHybridBayesNet.cpp:245
vanilla::params
static const SmartProjectionParams params
Definition:
smartFactorScenarios.h:69
gtsam::checkConvergence
bool checkConvergence(double relativeErrorTreshold, double absoluteErrorTreshold, double errorThreshold, double currentError, double newError, NonlinearOptimizerParams::Verbosity verbosity)
Definition:
NonlinearOptimizer.cpp:182
gtsam::GaussianFactorGraph
Definition:
GaussianFactorGraph.h:73
gtsam::NonlinearOptimizerParams
Definition:
NonlinearOptimizerParams.h:35
gtsam::VectorValues
Definition:
VectorValues.h:74
gtsam::NonlinearFactorGraph
Definition:
NonlinearFactorGraph.h:55
gtsam::NonlinearOptimizer::graph_
NonlinearFactorGraph graph_
The graph with nonlinear factors.
Definition:
NonlinearOptimizer.h:78
gtsam::NonlinearOptimizer::shared_ptr
std::shared_ptr< const NonlinearOptimizer > shared_ptr
Definition:
NonlinearOptimizer.h:84
gtsam
traits
Definition:
SFMdata.h:40
gtsam::NonlinearOptimizer
Definition:
NonlinearOptimizer.h:75
error
static double error
Definition:
testRot3.cpp:37
NonlinearFactorGraph.h
Factor Graph consisting of non-linear factors.
gtsam::Values
Definition:
Values.h:65
internal
Definition:
BandTriangularSolver.h:13
graph
NonlinearFactorGraph graph
Definition:
doc/Code/OdometryExample.cpp:2
NonlinearOptimizerParams.h
Parameters for nonlinear optimization.
gtsam::NonlinearOptimizer::state_
std::unique_ptr< internal::NonlinearOptimizerState > state_
PIMPL'd state.
Definition:
NonlinearOptimizer.h:80
make_changelog.state
state
Definition:
make_changelog.py:29
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:51