gtsam  4.0.0
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 
32 namespace gtsam {
33 
41 struct GTSAM_EXPORT ISAM2Result {
54  boost::optional<double> errorBefore;
55 
66  boost::optional<double> errorAfter;
67 
77 
85 
89 
91  size_t cliques;
92 
98 
105  struct VariableStatus {
111  bool isRelinearizeInvolved;
114  bool isRelinearized;
119  bool isObserved;
122  bool isNew;
126  : isReeliminated(false),
127  isAboveRelinThreshold(false),
128  isRelinearizeInvolved(false),
129  isRelinearized(false),
130  isObserved(false),
131  isNew(false),
132  inRootClique(false) {}
133  };
134 
138  };
139 
142  boost::optional<DetailedResults> detail;
143 
144  void print(const std::string str = "") const {
145  using std::cout;
146  cout << str << " Reelimintated: " << variablesReeliminated
147  << " Relinearized: " << variablesRelinearized
148  << " Cliques: " << cliques << std::endl;
149  }
150 
152  size_t getVariablesRelinearized() const { return variablesRelinearized; }
153  size_t getVariablesReeliminated() const { return variablesReeliminated; }
154  size_t getCliques() const { return cliques; }
155 };
156 
157 } // namespace gtsam
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
size_t getVariablesRelinearized() const
Getters and Setters.
Definition: ISAM2Result.h:152
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
Gaussian Bayes Tree, the result of eliminating a GaussianJunctionTree.
size_t factorsRecalculated
The number of factors that were included in reelimination of the Bayes' tree.
Definition: ISAM2Result.h:88
The status of a single variable, this struct is stored in DetailedResults::variableStatus.
Definition: ISAM2Result.h:105
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
bool isAboveRelinThreshold
Whether the variable was just relinearized due to being above the relinearization threshold.
Definition: ISAM2Result.h:110
Definition: FastMap.h:37
FactorIndices newFactorsIndices
The indices of the newly-added factors, in 1-to-1 correspondence with the factors passed as newFactor...
Definition: ISAM2Result.h:97
Nonlinear factor graph optimizer using Powell's Dogleg algorithm (detail implementation)
size_t variablesReeliminated
The number of variables that were reeliminated as parts of the Bayes' Tree were recalculated,...
Definition: ISAM2Result.h:84
Factor Graph Constsiting of non-linear factors.
A struct holding detailed results, which must be enabled with ISAM2Params::enableDetailedResults.
Definition: ISAM2Result.h:102
bool inRootClique
Whether the variable is in the root clique.
Definition: ISAM2Result.h:124
size_t cliques
The number of cliques in the Bayes' Tree.
Definition: ISAM2Result.h:91
Definition: ISAM2Result.h:41
bool isReeliminated
Whether the variable was just reeliminated, due to being relinearized, observed, new,...
Definition: ISAM2Result.h:109
FastVector< FactorIndex > FactorIndices
Define collection types:
Definition: Factor.h:32
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
size_t variablesRelinearized
The number of variables that were relinearized because their linear deltas exceeded the reslinearizat...
Definition: ISAM2Result.h:76
FastMap< Key, VariableStatus > variableStatus
The status of each variable during this update, see VariableStatus.
Definition: ISAM2Result.h:137
boost::optional< DetailedResults > detail
Detailed results, if enabled by ISAM2Params::enableDetailedResults.
Definition: ISAM2Result.h:142
Parameters for iSAM 2.