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 ISAM2Result {
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 
120  struct VariableStatus {
126  bool isRelinearizeInvolved;
129  bool isRelinearized;
134  bool isObserved;
137  bool isNew;
141  : isReeliminated(false),
142  isAboveRelinThreshold(false),
143  isRelinearizeInvolved(false),
144  isRelinearized(false),
145  isObserved(false),
146  isNew(false),
147  inRootClique(false) {}
148  };
149 
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 
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
size_t getVariablesReeliminated() const
Definition: ISAM2Result.h:177
bool isNew
Whether the variable itself was just added.
Definition: ISAM2Result.h:138
Factor Graph consisting of non-linear factors.
size_t variablesReeliminated
Definition: ISAM2Result.h:84
FastVector< FactorIndex > FactorIndices
Define collection types:
Definition: Factor.h:32
size_t getCliques() const
Definition: ISAM2Result.h:178
FactorIndices newFactorsIndices
Definition: ISAM2Result.h:97
Nonlinear factor graph optimizer using Powell&#39;s Dogleg algorithm (detail implementation) ...
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
size_t getVariablesRelinearized() const
Definition: ISAM2Result.h:176
KeyVector observedKeys
Definition: ISAM2Result.h:105
Definition: pytypes.h:928
size_t variablesRelinearized
Definition: ISAM2Result.h:76
KeySet keysWithRemovedFactors
Definition: ISAM2Result.h:108
boost::optional< double > errorAfter
Definition: ISAM2Result.h:66
DetailedResults * details()
Return pointer to detail, 0 if no detail requested.
Definition: ISAM2Result.h:165
StatusMap variableStatus
The status of each variable during this update, see VariableStatus.
Definition: ISAM2Result.h:153
traits
Definition: chartTesting.h:28
double getErrorBefore() const
Definition: ISAM2Result.h:179
boost::optional< double > errorBefore
Definition: ISAM2Result.h:54
bool inRootClique
Whether the variable is in the root clique.
Definition: ISAM2Result.h:139
void print(const std::string str="") const
Print results.
Definition: ISAM2Result.h:168
ISAM2Result(bool enableDetailedResults=false)
Definition: ISAM2Result.h:160
double getErrorAfter() const
Definition: ISAM2Result.h:180
Gaussian Bayes Tree, the result of eliminating a GaussianJunctionTree.
Parameters for iSAM 2.
boost::optional< DetailedResults > detail
Definition: ISAM2Result.h:158
size_t factorsRecalculated
Definition: ISAM2Result.h:88


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:22