33 class MarginalizeNonleafException :
public std::exception {
36 mutable std::string what_;
38 MarginalizeNonleafException(
Key key,
KeyFormatter formatter = DefaultKeyFormatter) noexcept :
39 key_(key), formatter_(formatter) {}
40 virtual ~MarginalizeNonleafException()
noexcept {}
41 Key key()
const {
return key_; }
42 const char* what()
const noexcept override {
45"\nRequested to marginalize out variable " + formatter_(key_) +
", but this variable\n\
46is not a leaf. To make the variables you would like to marginalize be leaves,\n\
47their ordering should be constrained using the constrainedKeys argument to\n\