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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:33