36 template<
class FACTOR>
37 std::pair<std::shared_ptr<SymbolicConditional>, std::shared_ptr<SymbolicFactor> >
44 for(
const std::shared_ptr<FACTOR>& factor: factors) {
45 allKeys.insert(factor->begin(), factor->end());
50 if(allKeys.find(key) == allKeys.end())
51 throw std::runtime_error(
"Requested to eliminate a key that is not in the factors");
56 const size_t nFrontals = keys.size();
60 std::copy(keys.begin(), keys.end(), orderedKeys.begin());
61 std::set_difference(allKeys.begin(), allKeys.end(), frontals.begin(), frontals.end(), orderedKeys.begin() + nFrontals);
Definition: BayesTree.h:34
Definition: Ordering.h:37
static SymbolicConditional::shared_ptr FromKeysShared(const CONTAINER &keys, size_t nrFrontals)
Definition: SymbolicConditional.h:94
static SymbolicFactor::shared_ptr FromIteratorsShared(KEYITERATOR beginKey, KEYITERATOR endKey)
Definition: SymbolicFactor.h:118
GTSAM_EXPORT std::pair< std::shared_ptr< SymbolicConditional >, std::shared_ptr< SymbolicFactor > > EliminateSymbolic(const SymbolicFactorGraph &factors, const Ordering &keys)
Definition: chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
The base class for all factors.