From 9f85d4cc2dbbf33cd8c1f8d124fe93559cd1c6da Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 31 Dec 2024 13:23:41 -0500 Subject: [PATCH] fix equals --- gtsam/discrete/DiscreteTableConditional.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtsam/discrete/DiscreteTableConditional.cpp b/gtsam/discrete/DiscreteTableConditional.cpp index cdfc36556..f50d7fbeb 100644 --- a/gtsam/discrete/DiscreteTableConditional.cpp +++ b/gtsam/discrete/DiscreteTableConditional.cpp @@ -130,12 +130,14 @@ void DiscreteTableConditional::print(const string& s, /* ************************************************************************** */ bool DiscreteTableConditional::equals(const DiscreteFactor& other, double tol) const { - if (!dynamic_cast(&other)) { + auto dtc = dynamic_cast(&other); + if (!dtc) { return false; } else { const DiscreteConditional& f( static_cast(other)); - return DiscreteConditional::equals(f, tol); + return table_.equals(dtc->table_, tol) && + DiscreteConditional::equals(f, tol); } }