From 9844a555d4debcf3e0cb7c6047c7b81f8701d27b Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Sun, 8 Dec 2024 10:34:02 -0500 Subject: [PATCH] move evaluate and operator() next to each other --- gtsam/discrete/DiscreteFactor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtsam/discrete/DiscreteFactor.h b/gtsam/discrete/DiscreteFactor.h index e2d32e828..3151afe80 100644 --- a/gtsam/discrete/DiscreteFactor.h +++ b/gtsam/discrete/DiscreteFactor.h @@ -93,6 +93,9 @@ class GTSAM_EXPORT DiscreteFactor : public Factor { size_t cardinality(Key j) const { return cardinalities_.at(j); } + /// Calculate probability for given values + virtual double evaluate(const Assignment& values) const = 0; + /// Find value for given assignment of values to variables virtual double operator()(const Assignment& values) const = 0; @@ -131,9 +134,6 @@ class GTSAM_EXPORT DiscreteFactor : public Factor { virtual DiscreteFactor::shared_ptr operator/( const DiscreteFactor::shared_ptr& f) const = 0; - /// Calculate probability for given values - virtual double evaluate(const Assignment& values) const = 0; - /** * Get the number of non-zero values contained in this factor. * It could be much smaller than `prod_{key}(cardinality(key))`.