nonlinearExceptions.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 #pragma once
19 
20 #include <exception>
21 
22 #include <gtsam/inference/Key.h>
23 
24 namespace gtsam {
25 
32  class MarginalizeNonleafException : public std::exception {
35  mutable std::string what_;
36  public:
39  virtual ~MarginalizeNonleafException() noexcept {}
40  Key key() const { return key_; }
41  const char* what() const noexcept override {
42  if(what_.empty())
43  what_ =
44 "\nRequested to marginalize out variable " + formatter_(key_) + ", but this variable\n\
45 is not a leaf. To make the variables you would like to marginalize be leaves,\n\
46 their ordering should be constrained using the constrainedKeys argument to\n\
47 ISAM2::update().\n";
48  return what_.c_str();
49  }
50  };
51 
52 }
MarginalizeNonleafException(Key key, KeyFormatter formatter=DefaultKeyFormatter) noexcept
virtual ~MarginalizeNonleafException() noexcept
static const KeyFormatter DefaultKeyFormatter
Definition: Key.h:43
const KeyFormatter & formatter
const char * what() const noexcept override
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
traits
Definition: chartTesting.h:28
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102


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