-
Notifications
You must be signed in to change notification settings - Fork 794
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
Enum to categorize HybridFactor #1832
Conversation
gtsam/hybrid/HybridFactor.h
Outdated
@@ -41,6 +41,9 @@ KeyVector CollectKeys(const KeyVector &keys1, const KeyVector &keys2); | |||
DiscreteKeys CollectDiscreteKeys(const DiscreteKeys &key1, | |||
const DiscreteKeys &key2); | |||
|
|||
/// Enum to help with categorizing hybrid factors. | |||
enum class HybridCategory { None, Discrete, Continuous, Hybrid }; |
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.
I like this a lot, but could we just make it an inner inside the HF class?
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.
Done. I renamed it to Category
so it reads nicer as HybridFactor::Category
.
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.
LGTM, why not target develop? Prefer smaller PRs into develop than having to see this code again in another review…
I was trying to avoid major merge conflicts. I guarantee you won't see this code in another review. :) |
Replaced the previous boolean based checks for whether a
HybridFactor
isDiscrete
,Continuous
orHybrid
with an enum.This would prevent a
HybridFactor
from having multiple flags true accidentally.