linearExceptions.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 
20 #include <gtsam/inference/Symbol.h>
21 
22 namespace gtsam {
23 
24  /* ************************************************************************* */
25  const char* IndeterminantLinearSystemException::what() const noexcept
26  {
27  if(!description_) {
29  "\nIndeterminant linear system detected while working near variable\n"
30  + std::to_string(j_) +
31  + " (Symbol: " + gtsam::DefaultKeyFormatter(gtsam::Symbol(j_)) + ").\n"
32  "\n\
33 Thrown when a linear system is ill-posed. The most common cause for this\n\
34 error is having underconstrained variables. Mathematically, the system is\n\
35 underdetermined. See the GTSAM Doxygen documentation at\n\
36 http://borg.cc.gatech.edu/ on gtsam::IndeterminantLinearSystemException for\n\
37 more information.");
38  }
39  return description_->c_str();
40  }
41 
42  /* ************************************************************************* */
43  const char* InvalidNoiseModel::what() const noexcept {
44  if(description_->empty())
45  description_ = "A JacobianFactor was attempted to be constructed or modified to use a\n"
46  "noise model of incompatible dimension. The JacobianFactor has\n"
47  "dimensionality (i.e. length of error vector) " + std::to_string(factorDims) +
48  " but the provided noise model has dimensionality " + std::to_string(noiseModelDims) + ".";
49  return description_->c_str();
50  }
51 
52  /* ************************************************************************* */
53  const char* InvalidMatrixBlock::what() const noexcept {
54  if(description_->empty()) {
55  description_ = "A JacobianFactor was attempted to be constructed with a matrix block of\n"
56  "inconsistent dimension. The JacobianFactor has " + std::to_string(factorRows) +
57  " rows (i.e. length of error vector) but the provided matrix block has " +
58  std::to_string(blockRows) + " rows.";
59  }
60  return description_->c_str();
61  }
62 
63  }
gtsam::InvalidNoiseModel::noiseModelDims
const DenseIndex noiseModelDims
The dimensionality of the noise model.
Definition: linearExceptions.h:109
gtsam::ThreadsafeException< IndeterminantLinearSystemException >::String
std::string String
Definition: ThreadsafeException.h:52
gtsam::InvalidMatrixBlock::blockRows
const DenseIndex blockRows
The dimensionality of the noise model.
Definition: linearExceptions.h:124
gtsam::DefaultKeyFormatter
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition: Key.cpp:30
gtsam::InvalidNoiseModel::what
const char * what() const noexcept override
Definition: linearExceptions.cpp:43
linearExceptions.h
Exceptions that may be thrown by linear solver components.
gtsam::InvalidNoiseModel::factorDims
const DenseIndex factorDims
The dimensionality of the factor.
Definition: linearExceptions.h:108
gtsam::ThreadsafeException< IndeterminantLinearSystemException >::description_
std::optional< String > description_
Optional description.
Definition: ThreadsafeException.h:58
gtsam::IndeterminantLinearSystemException::j_
Key j_
Definition: linearExceptions.h:95
Symbol.h
gtsam::IndeterminantLinearSystemException::what
const char * what() const noexcept override
Definition: linearExceptions.cpp:25
gtsam
traits
Definition: SFMdata.h:40
gtsam::InvalidMatrixBlock::what
const char * what() const noexcept override
Definition: linearExceptions.cpp:53
gtsam::Symbol
Definition: inference/Symbol.h:37
gtsam::InvalidMatrixBlock::factorRows
const DenseIndex factorRows
The dimensionality of the factor.
Definition: linearExceptions.h:123


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:55