move evaluate and operator() next to each other

release/4.3a0
Varun Agrawal 2024-12-08 10:34:02 -05:00
parent 77578512f8
commit 9844a555d4
1 changed files with 3 additions and 3 deletions

View File

@ -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<Key>& values) const = 0;
/// Find value for given assignment of values to variables
virtual double operator()(const Assignment<Key>& 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<Key>& values) const = 0;
/**
* Get the number of non-zero values contained in this factor.
* It could be much smaller than `prod_{key}(cardinality(key))`.