fixed equals
parent
ceed2ae17d
commit
bef2efacb7
|
@ -183,12 +183,22 @@ namespace gtsam {
|
||||||
root_->printTree("");
|
root_->printTree("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
// binary predicate to test equality of a pair for use in equals
|
||||||
|
template<class Conditional>
|
||||||
|
bool check_pair(
|
||||||
|
const pair<string,typename BayesTree<Conditional>::sharedClique >& v1,
|
||||||
|
const pair<string,typename BayesTree<Conditional>::sharedClique >& v2
|
||||||
|
) {
|
||||||
|
return v1.first == v2.first && v1.second->equals(*(v2.second));
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
template<class Conditional>
|
template<class Conditional>
|
||||||
bool BayesTree<Conditional>::equals(const BayesTree<Conditional>& other,
|
bool BayesTree<Conditional>::equals(const BayesTree<Conditional>& other,
|
||||||
double tol) const {
|
double tol) const {
|
||||||
return size()==other.size();
|
return size()==other.size() &&
|
||||||
//&& equal(nodes_.begin(),nodes_.end(),other.nodes_.begin(),equals_star<Clique>(tol));
|
equal(nodes_.begin(),nodes_.end(),other.nodes_.begin(),check_pair<Conditional>);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
Loading…
Reference in New Issue