fix decision tree equality and move default constructor to public

release/4.3a0
Varun Agrawal 2021-12-29 13:31:06 -05:00 committed by Frank Dellaert
parent a25e3f6d38
commit 94f21358f4
2 changed files with 4 additions and 4 deletions

View File

@ -79,7 +79,7 @@ namespace gtsam {
bool equals(const Node& q, double tol) const override {
const Leaf* other = dynamic_cast<const Leaf*> (&q);
if (!other) return false;
return std::abs(double(this->constant_ - other->constant_)) < tol;
return this->constant_ == other->constant_;
}
/** print */

View File

@ -113,14 +113,14 @@ namespace gtsam {
convert(const typename DecisionTree<M, X>::NodePtr& f, const std::map<M,
L>& map, std::function<Y(const X&)> op);
/** Default constructor */
DecisionTree();
public:
/// @name Standard Constructors
/// @{
/** Default constructor (for serialization) */
DecisionTree();
/** Create a constant */
DecisionTree(const Y& y);