Fix issues with gcc compiler.
parent
15802e58f9
commit
fa3a8103c5
|
@ -56,6 +56,9 @@ public:
|
||||||
/** Copy constructor from the base list class */
|
/** Copy constructor from the base list class */
|
||||||
FastList(const Base& x) : Base(x) {}
|
FastList(const Base& x) : Base(x) {}
|
||||||
|
|
||||||
|
/// Construct from c++11 initializer list:
|
||||||
|
FastList(std::initializer_list<VALUE> l) : Base(l) {}
|
||||||
|
|
||||||
#ifdef GTSAM_ALLOCATOR_BOOSTPOOL
|
#ifdef GTSAM_ALLOCATOR_BOOSTPOOL
|
||||||
/** Copy constructor from a standard STL container */
|
/** Copy constructor from a standard STL container */
|
||||||
FastList(const std::list<VALUE>& x) {
|
FastList(const std::list<VALUE>& x) {
|
||||||
|
|
|
@ -120,14 +120,15 @@ namespace gtsam {
|
||||||
using sharedClique = SymbolicBayesTreeClique::shared_ptr;
|
using sharedClique = SymbolicBayesTreeClique::shared_ptr;
|
||||||
using Children = ListOf<sharedClique>;
|
using Children = ListOf<sharedClique>;
|
||||||
|
|
||||||
inline sharedClique LeafClique(const KeyVector& keys,
|
inline sharedClique LeafClique(const std::vector<Key>& keys,
|
||||||
DenseIndex nrFrontals) {
|
DenseIndex nrFrontals) {
|
||||||
return boost::make_shared<SymbolicBayesTreeClique>(
|
return boost::make_shared<SymbolicBayesTreeClique>(
|
||||||
boost::make_shared<SymbolicConditional>(
|
boost::make_shared<SymbolicConditional>(
|
||||||
SymbolicConditional::FromKeys(keys, nrFrontals)));
|
SymbolicConditional::FromKeys(keys, nrFrontals)));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline sharedClique NodeClique(const KeyVector& keys, DenseIndex nrFrontals,
|
inline sharedClique NodeClique(const std::vector<Key>& keys,
|
||||||
|
DenseIndex nrFrontals,
|
||||||
const std::vector<sharedClique>& children) {
|
const std::vector<sharedClique>& children) {
|
||||||
sharedClique clique = LeafClique(keys, nrFrontals);
|
sharedClique clique = LeafClique(keys, nrFrontals);
|
||||||
clique->children.assign(children.begin(), children.end());
|
clique->children.assign(children.begin(), children.end());
|
||||||
|
|
|
@ -106,8 +106,7 @@ TEST(BayesTree, removePath) {
|
||||||
SymbolicFactorGraph expected;
|
SymbolicFactorGraph expected;
|
||||||
expected.emplace_shared<SymbolicFactor>(_A_, _B_);
|
expected.emplace_shared<SymbolicFactor>(_A_, _B_);
|
||||||
expected.emplace_shared<SymbolicFactor>(_C_, _A_);
|
expected.emplace_shared<SymbolicFactor>(_C_, _A_);
|
||||||
SymbolicBayesTree::Cliques expectedOrphans =
|
SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_D_], bayesTree[_E_]};
|
||||||
std::list<sharedClique>{bayesTree[_D_], bayesTree[_E_]};
|
|
||||||
|
|
||||||
SymbolicBayesNet bn;
|
SymbolicBayesNet bn;
|
||||||
SymbolicBayesTree::Cliques orphans;
|
SymbolicBayesTree::Cliques orphans;
|
||||||
|
@ -123,8 +122,7 @@ TEST(BayesTree, removePath) {
|
||||||
SymbolicFactorGraph expected2;
|
SymbolicFactorGraph expected2;
|
||||||
expected2.emplace_shared<SymbolicFactor>(_A_, _B_);
|
expected2.emplace_shared<SymbolicFactor>(_A_, _B_);
|
||||||
expected2.emplace_shared<SymbolicFactor>(_E_, _B_);
|
expected2.emplace_shared<SymbolicFactor>(_E_, _B_);
|
||||||
SymbolicBayesTree::Cliques expectedOrphans2 =
|
SymbolicBayesTree::Cliques expectedOrphans2{bayesTree[_F_], bayesTree[_C_]};
|
||||||
std::list<sharedClique>{bayesTree[_F_], bayesTree[_C_]};
|
|
||||||
|
|
||||||
SymbolicBayesNet bn2;
|
SymbolicBayesNet bn2;
|
||||||
SymbolicBayesTree::Cliques orphans2;
|
SymbolicBayesTree::Cliques orphans2;
|
||||||
|
@ -149,8 +147,8 @@ TEST(BayesTree, removePath2) {
|
||||||
SymbolicFactorGraph expected;
|
SymbolicFactorGraph expected;
|
||||||
expected.emplace_shared<SymbolicFactor>(_E_, _L_, _B_);
|
expected.emplace_shared<SymbolicFactor>(_E_, _L_, _B_);
|
||||||
CHECK(assert_equal(expected, factors));
|
CHECK(assert_equal(expected, factors));
|
||||||
SymbolicBayesTree::Cliques expectedOrphans =
|
SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_S_], bayesTree[_T_],
|
||||||
std::list<sharedClique>{bayesTree[_S_], bayesTree[_T_], bayesTree[_X_]};
|
bayesTree[_X_]};
|
||||||
CHECK(assert_container_equal(expectedOrphans | indirected,
|
CHECK(assert_container_equal(expectedOrphans | indirected,
|
||||||
orphans | indirected));
|
orphans | indirected));
|
||||||
}
|
}
|
||||||
|
@ -170,8 +168,7 @@ TEST(BayesTree, removePath3) {
|
||||||
expected.emplace_shared<SymbolicFactor>(_E_, _L_, _B_);
|
expected.emplace_shared<SymbolicFactor>(_E_, _L_, _B_);
|
||||||
expected.emplace_shared<SymbolicFactor>(_T_, _E_, _L_);
|
expected.emplace_shared<SymbolicFactor>(_T_, _E_, _L_);
|
||||||
CHECK(assert_equal(expected, factors));
|
CHECK(assert_equal(expected, factors));
|
||||||
SymbolicBayesTree::Cliques expectedOrphans =
|
SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_S_], bayesTree[_X_]};
|
||||||
std::list<sharedClique>{bayesTree[_S_], bayesTree[_X_]};
|
|
||||||
CHECK(assert_container_equal(expectedOrphans | indirected,
|
CHECK(assert_container_equal(expectedOrphans | indirected,
|
||||||
orphans | indirected));
|
orphans | indirected));
|
||||||
}
|
}
|
||||||
|
@ -253,8 +250,7 @@ TEST(BayesTree, removeTop) {
|
||||||
expected += SymbolicConditional::FromKeys<KeyVector>(Keys(_S_)(_B_)(_L_), 1);
|
expected += SymbolicConditional::FromKeys<KeyVector>(Keys(_S_)(_B_)(_L_), 1);
|
||||||
CHECK(assert_equal(expected, bn));
|
CHECK(assert_equal(expected, bn));
|
||||||
|
|
||||||
SymbolicBayesTree::Cliques expectedOrphans =
|
SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_T_], bayesTree[_X_]};
|
||||||
std::list<sharedClique>{bayesTree[_T_], bayesTree[_X_]};
|
|
||||||
CHECK(assert_container_equal(expectedOrphans | indirected,
|
CHECK(assert_container_equal(expectedOrphans | indirected,
|
||||||
orphans | indirected));
|
orphans | indirected));
|
||||||
|
|
||||||
|
@ -291,8 +287,7 @@ TEST(BayesTree, removeTop2) {
|
||||||
SymbolicConditional::FromKeys<KeyVector>(Keys(_T_)(_E_)(_L_), 1));
|
SymbolicConditional::FromKeys<KeyVector>(Keys(_T_)(_E_)(_L_), 1));
|
||||||
CHECK(assert_equal(expected, bn));
|
CHECK(assert_equal(expected, bn));
|
||||||
|
|
||||||
SymbolicBayesTree::Cliques expectedOrphans =
|
SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_S_], bayesTree[_X_]};
|
||||||
std::list<sharedClique>{bayesTree[_S_], bayesTree[_X_]};
|
|
||||||
CHECK(assert_container_equal(expectedOrphans | indirected,
|
CHECK(assert_container_equal(expectedOrphans | indirected,
|
||||||
orphans | indirected));
|
orphans | indirected));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue