Fixed iSAM2 deep copy of empty tree
parent
4c58a00a6d
commit
2ac1473a84
|
@ -582,6 +582,13 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
template<class CONDITIONAL, class CLIQUE>
|
||||||
|
void BayesTree<CONDITIONAL,CLIQUE>::cloneTo(This& newTree) const {
|
||||||
|
if(root())
|
||||||
|
cloneTo(newTree, root(), sharedClique());
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
template<class CONDITIONAL, class CLIQUE>
|
template<class CONDITIONAL, class CLIQUE>
|
||||||
void BayesTree<CONDITIONAL,CLIQUE>::cloneTo(
|
void BayesTree<CONDITIONAL,CLIQUE>::cloneTo(
|
||||||
|
|
|
@ -283,9 +283,7 @@ namespace gtsam {
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/** deep copy to another tree */
|
/** deep copy to another tree */
|
||||||
void cloneTo(This& newTree) const {
|
void cloneTo(This& newTree) const;
|
||||||
cloneTo(newTree, root(), sharedClique());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** deep copy to another tree */
|
/** deep copy to another tree */
|
||||||
void cloneTo(This& newTree, const sharedClique& subtree, const sharedClique& parent) const;
|
void cloneTo(This& newTree, const sharedClique& subtree, const sharedClique& parent) const;
|
||||||
|
|
|
@ -898,6 +898,11 @@ TEST(ISAM2, clone) {
|
||||||
|
|
||||||
CHECK(assert_equal(createSlamlikeISAM2(), clone1));
|
CHECK(assert_equal(createSlamlikeISAM2(), clone1));
|
||||||
CHECK(assert_equal(clone1, temp));
|
CHECK(assert_equal(clone1, temp));
|
||||||
|
|
||||||
|
// Check clone empty
|
||||||
|
ISAM2 isam;
|
||||||
|
clone1 = isam;
|
||||||
|
CHECK(assert_equal(ISAM2(), clone1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
Loading…
Reference in New Issue