Loading...
Searching...
No Matches
nonlinearExceptions.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <boost/lexical_cast.hpp>
#include <exception>
#include <gtsam/inference/Key.h>
namespace gtsam {
class MarginalizeNonleafException : public std::exception {
Key key_;
KeyFormatter formatter_;
mutable std::string what_;
public:
MarginalizeNonleafException(Key key, KeyFormatter formatter = DefaultKeyFormatter) noexcept :
key_(key), formatter_(formatter) {}
virtual ~MarginalizeNonleafException() noexcept {}
Key key() const { return key_; }
const char* what() const noexcept override {
if(what_.empty())
what_ =
"\nRequested to marginalize out variable " + formatter_(key_) + ", but this variable\n\
is not a leaf. To make the variables you would like to marginalize be leaves,\n\
their ordering should be constrained using the constrainedKeys argument to\n\
ISAM2::update().\n";
return what_.c_str();
}
};
}
Key.h
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::KeyFormatter
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
gtsam::Key
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:100