-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override print methods #760
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,6 +177,13 @@ namespace gtsam { | |
*/ | ||
VectorValues backSubstituteTranspose(const VectorValues& gx) const; | ||
|
||
/// print graph | ||
virtual void print( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no virtual. I recommend checking the warnings in a clang CI run to be sure I did not miss anything. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great idea. And yes I'll get rid of the virtuals where there are overrides. |
||
const std::string& s = "", | ||
const KeyFormatter& formatter = DefaultKeyFormatter) const override { | ||
Base::print(s, formatter); | ||
} | ||
|
||
/** | ||
* @brief Save the GaussianBayesNet as an image. Requires `dot` to be | ||
* installed. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,8 +54,11 @@ namespace gtsam { | |
virtual ~GaussianFactor() {} | ||
|
||
// Implementing Testable interface | ||
virtual void print(const std::string& s = "", | ||
const KeyFormatter& formatter = DefaultKeyFormatter) const = 0; | ||
|
||
virtual void print( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no virtual |
||
const std::string& s = "", | ||
const KeyFormatter& formatter = DefaultKeyFormatter) const override = 0; | ||
|
||
/** Equals for testable */ | ||
virtual bool equals(const GaussianFactor& lf, double tol = 1e-9) const = 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,8 +70,9 @@ class GTSAM_EXPORT NonlinearFactor: public Factor { | |
/// @{ | ||
|
||
/** print */ | ||
virtual void print(const std::string& s = "", | ||
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const; | ||
virtual void print( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no virtual |
||
const std::string& s = "", | ||
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override; | ||
|
||
/** Check if two factors are equal */ | ||
virtual bool equals(const NonlinearFactor& f, double tol = 1e-9) const; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,13 @@ namespace gtsam { | |
/** Check equality */ | ||
GTSAM_EXPORT bool equals(const This& bn, double tol = 1e-9) const; | ||
|
||
GTSAM_EXPORT void print( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this the only one with GTSAM_EXPORT? Should we have that everywhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good question. My intent was to be consistent (since |
||
const std::string& s = "SymbolicBayesNet", | ||
const KeyFormatter& formatter = DefaultKeyFormatter) const override { | ||
Base::print(s, formatter); | ||
} | ||
|
||
/// @} | ||
|
||
/// @name Standard Interface | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no virtual if override