ISAM2Params.cpp
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 #include <boost/algorithm/string.hpp>
20 
21 using namespace std;
22 
23 namespace gtsam {
24 
25 /* ************************************************************************* */
26 string ISAM2DoglegParams::adaptationModeTranslator(
28  const {
29  string s;
30  switch (adaptationMode) {
31  case DoglegOptimizerImpl::SEARCH_EACH_ITERATION:
32  s = "SEARCH_EACH_ITERATION";
33  break;
34  case DoglegOptimizerImpl::ONE_STEP_PER_ITERATION:
35  s = "ONE_STEP_PER_ITERATION";
36  break;
37  default:
38  s = "UNDEFINED";
39  break;
40  }
41  return s;
42 }
43 
44 /* ************************************************************************* */
46 ISAM2DoglegParams::adaptationModeTranslator(
47  const string& adaptationMode) const {
48  string s = adaptationMode;
49  boost::algorithm::to_upper(s);
50  if (s == "SEARCH_EACH_ITERATION")
51  return DoglegOptimizerImpl::SEARCH_EACH_ITERATION;
52  if (s == "ONE_STEP_PER_ITERATION")
53  return DoglegOptimizerImpl::ONE_STEP_PER_ITERATION;
54 
55  /* default is SEARCH_EACH_ITERATION */
56  return DoglegOptimizerImpl::SEARCH_EACH_ITERATION;
57 }
58 
59 /* ************************************************************************* */
60 ISAM2Params::Factorization ISAM2Params::factorizationTranslator(
61  const string& str) {
62  string s = str;
63  boost::algorithm::to_upper(s);
64  if (s == "QR") return ISAM2Params::QR;
65  if (s == "CHOLESKY") return ISAM2Params::CHOLESKY;
66 
67  /* default is CHOLESKY */
68  return ISAM2Params::CHOLESKY;
69 }
70 
71 /* ************************************************************************* */
72 string ISAM2Params::factorizationTranslator(
74  string s;
75  switch (value) {
76  case ISAM2Params::QR:
77  s = "QR";
78  break;
79  case ISAM2Params::CHOLESKY:
80  s = "CHOLESKY";
81  break;
82  default:
83  s = "UNDEFINED";
84  break;
85  }
86  return s;
87 }
88 
89 } // namespace gtsam
Definition: Half.h:150
Definition: pytypes.h:928
RealScalar s
traits
Definition: chartTesting.h:28
Parameters for iSAM 2.


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