gtsam 4.1.1
gtsam
ISAM2Result.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
18// \callgraph
19
20#pragma once
21
22#include <string>
23#include <vector>
24
29
30#include <boost/variant.hpp>
31
32namespace gtsam {
33
54 boost::optional<double> errorBefore;
55
66 boost::optional<double> errorAfter;
67
77
85
89
91 size_t cliques;
92
98
103
106
109
112
133 bool isRelinearized;
138 bool isNew;
141 : isReeliminated(false),
144 isRelinearized(false),
145 isObserved(false),
146 isNew(false),
147 inRootClique(false) {}
148 };
149
150 using StatusMap = FastMap<Key, VariableStatus>;
151
154 };
155
158 boost::optional<DetailedResults> detail;
159
160 explicit ISAM2Result(bool enableDetailedResults = false) {
161 if (enableDetailedResults) detail.reset(DetailedResults());
162 }
163
165 DetailedResults* details() { return detail.get_ptr(); }
166
168 void print(const std::string str = "") const {
169 using std::cout;
170 cout << str << " Reelimintated: " << variablesReeliminated
171 << " Relinearized: " << variablesRelinearized
172 << " Cliques: " << cliques << std::endl;
173 }
174
177 size_t getVariablesReeliminated() const { return variablesReeliminated; }
178 size_t getCliques() const { return cliques; }
179 double getErrorBefore() const { return errorBefore ? *errorBefore : std::nan(""); }
180 double getErrorAfter() const { return errorAfter ? *errorAfter : std::nan(""); }
181};
182
183} // namespace gtsam
Gaussian Bayes Tree, the result of eliminating a GaussianJunctionTree.
Nonlinear factor graph optimizer using Powell's Dogleg algorithm (detail implementation)
Parameters for iSAM 2.
Factor Graph consisting of non-linear factors.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
FastVector< FactorIndex > FactorIndices
Define collection types:
Definition: Factor.h:33
Definition: ISAM2Result.h:41
size_t variablesRelinearized
The number of variables that were relinearized because their linear deltas exceeded the reslinearizat...
Definition: ISAM2Result.h:76
size_t getVariablesRelinearized() const
Getters and Setters.
Definition: ISAM2Result.h:176
size_t factorsRecalculated
The number of factors that were included in reelimination of the Bayes' tree.
Definition: ISAM2Result.h:88
DetailedResults * details()
Return pointer to detail, 0 if no detail requested.
Definition: ISAM2Result.h:165
boost::optional< double > errorBefore
The nonlinear error of all of the factors, including new factors and variables added during the curre...
Definition: ISAM2Result.h:54
void print(const std::string str="") const
Print results.
Definition: ISAM2Result.h:168
boost::optional< DetailedResults > detail
Detailed results, if enabled by ISAM2Params::enableDetailedResults.
Definition: ISAM2Result.h:158
size_t cliques
The number of cliques in the Bayes' Tree.
Definition: ISAM2Result.h:91
KeySet keysWithRemovedFactors
Keys of variables that had factors removed.
Definition: ISAM2Result.h:108
size_t variablesReeliminated
The number of variables that were reeliminated as parts of the Bayes' Tree were recalculated,...
Definition: ISAM2Result.h:84
KeySet unusedKeys
Unused keys, and indices for unused keys, i.e., keys that are empty now and do not appear in the new ...
Definition: ISAM2Result.h:102
KeyVector observedKeys
keys for variables that were observed, i.e., not unused.
Definition: ISAM2Result.h:105
KeySet markedKeys
All keys that were marked during the update process.
Definition: ISAM2Result.h:111
FactorIndices newFactorsIndices
The indices of the newly-added factors, in 1-to-1 correspondence with the factors passed as newFactor...
Definition: ISAM2Result.h:97
boost::optional< double > errorAfter
The nonlinear error of all of the factors computed after the current update, meaning that variables a...
Definition: ISAM2Result.h:66
A struct holding detailed results, which must be enabled with ISAM2Params::enableDetailedResults.
Definition: ISAM2Result.h:117
StatusMap variableStatus
The status of each variable during this update, see VariableStatus.
Definition: ISAM2Result.h:153
The status of a single variable, this struct is stored in DetailedResults::variableStatus.
Definition: ISAM2Result.h:120
bool isRelinearizeInvolved
Whether the variable was below the relinearization threshold but was relinearized by being involved i...
Definition: ISAM2Result.h:128
bool isObserved
Whether the variable was relinearized, either by being above the relinearization threshold or by invo...
Definition: ISAM2Result.h:136
bool isNew
Whether the variable itself was just added.
Definition: ISAM2Result.h:138
bool isAboveRelinThreshold
Whether the variable was just relinearized due to being above the relinearization threshold.
Definition: ISAM2Result.h:125
bool isReeliminated
Whether the variable was just reeliminated, due to being relinearized, observed, new,...
Definition: ISAM2Result.h:124
bool inRootClique
Whether the variable is in the root clique.
Definition: ISAM2Result.h:139