exact equality

release/4.3a0
Frank Dellaert 2022-01-22 11:08:17 -05:00
parent f2518d11f0
commit 823239090d
1 changed files with 7 additions and 2 deletions

View File

@ -128,6 +128,11 @@ class FactorGraph {
/** Collection of factors */ /** Collection of factors */
FastVector<sharedFactor> factors_; FastVector<sharedFactor> factors_;
/// Check exact equality of the factor pointers. Useful for derived ==.
bool isEqual(const FactorGraph& other) const {
return factors_ == other.factors_;
}
/// @name Standard Constructors /// @name Standard Constructors
/// @{ /// @{
@ -290,11 +295,11 @@ class FactorGraph {
/// @name Testable /// @name Testable
/// @{ /// @{
/// print out graph /// Print out graph to std::cout, with optional key formatter.
virtual void print(const std::string& s = "FactorGraph", virtual void print(const std::string& s = "FactorGraph",
const KeyFormatter& formatter = DefaultKeyFormatter) const; const KeyFormatter& formatter = DefaultKeyFormatter) const;
/** Check equality */ /// Check equality up to tolerance.
bool equals(const This& fg, double tol = 1e-9) const; bool equals(const This& fg, double tol = 1e-9) const;
/// @} /// @}