Checked scatter
parent
a3ed636fce
commit
41d4c48938
|
|
@ -83,13 +83,33 @@ TEST( GaussianBayesTree, eliminate )
|
||||||
{
|
{
|
||||||
GaussianBayesTree bt = *chain.eliminateMultifrontal(chainOrdering);
|
GaussianBayesTree bt = *chain.eliminateMultifrontal(chainOrdering);
|
||||||
|
|
||||||
|
Scatter scatter(chain);
|
||||||
|
BOOST_FOREACH(const Scatter::value_type& entry, scatter)
|
||||||
|
cout << entry.first << " " << entry.second.toString() << endl;
|
||||||
|
|
||||||
|
EXPECT_LONGS_EQUAL(4, scatter.size());
|
||||||
|
EXPECT_LONGS_EQUAL(0, scatter.at(x1).slot);
|
||||||
|
EXPECT_LONGS_EQUAL(1, scatter.at(x2).slot);
|
||||||
|
EXPECT_LONGS_EQUAL(2, scatter.at(x3).slot);
|
||||||
|
EXPECT_LONGS_EQUAL(3, scatter.at(x4).slot);
|
||||||
|
|
||||||
Matrix two = (Matrix(1, 1) << 2.).finished();
|
Matrix two = (Matrix(1, 1) << 2.).finished();
|
||||||
Matrix one = (Matrix(1, 1) << 1.).finished();
|
Matrix one = (Matrix(1, 1) << 1.).finished();
|
||||||
|
|
||||||
GaussianBayesTree bayesTree_expected;
|
GaussianBayesTree bayesTree_expected;
|
||||||
bayesTree_expected.insertRoot(
|
bayesTree_expected.insertRoot(
|
||||||
MakeClique(GaussianConditional(pair_list_of<Key, Matrix>(x3, (Matrix(2, 1) << 2., 0.).finished()) (x4, (Matrix(2, 1) << 2., 2.).finished()), 2, Vector2(2., 2.)), list_of
|
MakeClique(
|
||||||
(MakeClique(GaussianConditional(pair_list_of<Key, Matrix>(x2, (Matrix(2, 1) << -2.*sqrt(2.), 0.).finished()) (x1, (Matrix(2, 1) << -sqrt(2.), -sqrt(2.)).finished()) (x3, (Matrix(2, 1) << -sqrt(2.), sqrt(2.)).finished()), 2, (Vector(2) << -2.*sqrt(2.), 0.).finished())))));
|
GaussianConditional(
|
||||||
|
pair_list_of<Key, Matrix>(x3, (Matrix21() << 2., 0.).finished())(
|
||||||
|
x4, (Matrix21() << 2., 2.).finished()), 2, Vector2(2., 2.)),
|
||||||
|
list_of(
|
||||||
|
MakeClique(
|
||||||
|
GaussianConditional(
|
||||||
|
pair_list_of<Key, Matrix>(x2,
|
||||||
|
(Matrix21() << -2. * sqrt(2.), 0.).finished())(x1,
|
||||||
|
(Matrix21() << -sqrt(2.), -sqrt(2.)).finished())(x3,
|
||||||
|
(Matrix21() << -sqrt(2.), sqrt(2.)).finished()), 2,
|
||||||
|
(Vector(2) << -2. * sqrt(2.), 0.).finished())))));
|
||||||
|
|
||||||
EXPECT(assert_equal(bayesTree_expected, bt));
|
EXPECT(assert_equal(bayesTree_expected, bt));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue