28 #include <boost/assign/std/set.hpp> 31 using namespace gtsam;
37 expected += 0, 1, 2, 3, 4;
38 KeySet actual = simpleTestGraph1.keys();
39 EXPECT(expected == actual);
45 expected += 0, 1, 2, 3, 4, 5;
46 KeySet actual = simpleTestGraph2.keys();
47 EXPECT(expected == actual);
54 order += 0, 1, 2, 3, 4;
66 const Ordering order = list_of(0)(1);
76 boost::tie(actualBayesNet, actualSfg) =
84 boost::tie(actualBayesNet2, actualSfg2) =
85 simpleTestGraph2.eliminatePartialSequential(
86 list_of(0)(1).convert_to_container<KeyVector>());
95 ordering += 0, 1, 2, 3;
107 boost::make_shared<SymbolicConditional>(
108 SymbolicConditional::FromKeys(list_of(4)(5)(1), 2));
110 boost::make_shared<SymbolicBayesTreeClique>(root));
118 boost::tie(actualBayesTree, actualFactorGraph) =
126 boost::make_shared<SymbolicBayesTreeClique>(
127 boost::make_shared<SymbolicConditional>(4, 1));
128 root2->children.push_back(boost::make_shared<SymbolicBayesTreeClique>(
129 boost::make_shared<SymbolicConditional>(5, 4)));
134 boost::tie(actualBayesTree2, actualFactorGraph2) =
135 simpleTestGraph2.eliminatePartialMultifrontal(
136 list_of<Key>(4)(5).convert_to_container<KeyVector>());
163 expected.
push_back(boost::make_shared<SymbolicConditional>(0, 1, 2));
164 expected.
push_back(boost::make_shared<SymbolicConditional>(1, 2));
165 expected.
push_back(boost::make_shared<SymbolicConditional>(2));
166 expected.
push_back(boost::make_shared<SymbolicConditional>(3, 4));
167 expected.
push_back(boost::make_shared<SymbolicConditional>(4));
170 order += 0, 1, 2, 3, 4;
187 Ordering ord(list_of(3)(4)(2)(1)(0));
std::pair< boost::shared_ptr< BayesTreeType >, boost::shared_ptr< FactorGraphType > > eliminatePartialMultifrontal(const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Provides additional testing facilities for common data structures.
boost::shared_ptr< This > shared_ptr
boost::shared_ptr< This > shared_ptr
static int runAllTests(TestResult &result)
boost::shared_ptr< This > shared_ptr
static enum @843 ordering
FastVector< FactorIndex > FactorIndices
Define collection types:
FactorIndices add_factors(const CONTAINER &factors, bool useEmptySlots=false)
IsDerived< DERIVEDFACTOR > push_back(boost::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
const mpreal root(const mpreal &x, unsigned long int k, mp_rnd_t r=mpreal::get_default_rnd())
void insertRoot(const sharedClique &subtree)
bool assert_container_equality(const std::map< size_t, V2 > &expected, const std::map< size_t, V2 > &actual)
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&...args)
Emplace a shared pointer to factor of given type.
boost::shared_ptr< This > shared_ptr
Typedef to the conditional base class.
void push_factor(Key key)
#define EXPECT(condition)
std::pair< boost::shared_ptr< BayesNetType >, boost::shared_ptr< FactorGraphType > > eliminatePartialSequential(const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
boost::shared_ptr< This > shared_ptr
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
boost::shared_ptr< BayesNetType > eliminateSequential(OptionalOrderingType orderingType=boost::none, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
TEST(SymbolicFactorGraph, keys1)
Marginals marginals(graph, result)