-
Notifications
You must be signed in to change notification settings - Fork 767
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
Fix rekey of LinearContainerFactor #777
Conversation
} | ||
|
||
/* ************************************************************************* */ | ||
NonlinearFactor::shared_ptr LinearContainerFactor::rekey( |
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.
Maybe we can just reuse the method for std::map
here?
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.
Can you please explain more?
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.
Oh I understand now. I don't think that is doable, because the std::map
version is doing a replacement, while the other one is doing an update. The assignment in the KeyVector
version makes it cleaner and I am not sure how we would create the map without making some assumptions about what the user intended.
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
I’m ok if this fixes a bug , but I do want to note, for the record, that “re-keying” goes against the functional nature of GTSAM. I question the need for it and would recommend people using this to re-examine why they’re using it :-) Try to be functional unless it is really affecting performance. |
As per #568,
LinearContainerFactor
's rekey method fails because therekey
method doesn't update the keys for the Gaussian Factor and Linearization point properties.This PR fixes #568 by overriding
rekey
and doing the necessary updates.