LevenbergMarquardtParams.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 
22 #include <boost/algorithm/string/case_conv.hpp>
23 #include <boost/range/adaptor/map.hpp>
24 #include <iostream>
25 #include <string>
26 
27 using namespace std;
28 
29 namespace gtsam {
30 
31 /* ************************************************************************* */
32 LevenbergMarquardtParams::VerbosityLM LevenbergMarquardtParams::verbosityLMTranslator(
33  const std::string &src) {
34  std::string s = src;
35  boost::algorithm::to_upper(s);
36  if (s == "SILENT")
37  return LevenbergMarquardtParams::SILENT;
38  if (s == "SUMMARY")
39  return LevenbergMarquardtParams::SUMMARY;
40  if (s == "TERMINATION")
41  return LevenbergMarquardtParams::TERMINATION;
42  if (s == "LAMBDA")
43  return LevenbergMarquardtParams::LAMBDA;
44  if (s == "TRYLAMBDA")
45  return LevenbergMarquardtParams::TRYLAMBDA;
46  if (s == "TRYCONFIG")
47  return LevenbergMarquardtParams::TRYCONFIG;
48  if (s == "TRYDELTA")
49  return LevenbergMarquardtParams::TRYDELTA;
50  if (s == "DAMPED")
51  return LevenbergMarquardtParams::DAMPED;
52 
53  /* default is silent */
54  return LevenbergMarquardtParams::SILENT;
55 }
56 
57 /* ************************************************************************* */
58 std::string LevenbergMarquardtParams::verbosityLMTranslator(
60  std::string s;
61  switch (value) {
62  case LevenbergMarquardtParams::SILENT:
63  s = "SILENT";
64  break;
65  case LevenbergMarquardtParams::SUMMARY:
66  s = "SUMMARY";
67  break;
68  case LevenbergMarquardtParams::TERMINATION:
69  s = "TERMINATION";
70  break;
71  case LevenbergMarquardtParams::LAMBDA:
72  s = "LAMBDA";
73  break;
74  case LevenbergMarquardtParams::TRYLAMBDA:
75  s = "TRYLAMBDA";
76  break;
77  case LevenbergMarquardtParams::TRYCONFIG:
78  s = "TRYCONFIG";
79  break;
80  case LevenbergMarquardtParams::TRYDELTA:
81  s = "TRYDELTA";
82  break;
83  case LevenbergMarquardtParams::DAMPED:
84  s = "DAMPED";
85  break;
86  default:
87  s = "UNDEFINED";
88  break;
89  }
90  return s;
91 }
92 
93 /* ************************************************************************* */
94 void LevenbergMarquardtParams::print(const std::string& str) const {
96  std::cout << " lambdaInitial: " << lambdaInitial << "\n";
97  std::cout << " lambdaFactor: " << lambdaFactor << "\n";
98  std::cout << " lambdaUpperBound: " << lambdaUpperBound << "\n";
99  std::cout << " lambdaLowerBound: " << lambdaLowerBound << "\n";
100  std::cout << " minModelFidelity: " << minModelFidelity << "\n";
101  std::cout << " diagonalDamping: " << diagonalDamping << "\n";
102  std::cout << " minDiagonal: " << minDiagonal << "\n";
103  std::cout << " maxDiagonal: " << maxDiagonal << "\n";
104  std::cout << " verbosityLM: "
105  << verbosityLMTranslator(verbosityLM) << "\n";
106  std::cout.flush();
107 }
108 
109 } /* namespace gtsam */
110 
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:155
Parameters for Levenberg-Marquardt trust-region scheme.
Definition: Half.h:150
Definition: pytypes.h:928
RealScalar s
traits
Definition: chartTesting.h:28


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