Skip to content
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

Need for shared pointers as arguments? #320

Closed
varunagrawal opened this issue Dec 8, 2021 · 2 comments · Fixed by #323
Closed

Need for shared pointers as arguments? #320

varunagrawal opened this issue Dec 8, 2021 · 2 comments · Fixed by #323

Comments

@varunagrawal
Copy link
Collaborator

Great stuff on the new updates.

However I had a question about using shared pointers as function and constructor args. Is there a reason we're doing Optimizer(const boost::shared_ptr<const OptimizationParameters>& parameters) instead of Optimizer(const OptimizationParameters& parameters)?

Seems like unnecessary verbosity to me especially when OptimizationParameters is a simple struct (aka an encapsulation of various parameters).

@varunagrawal varunagrawal changed the title Need for shared pointers are arguments? Need for shared pointers as arguments? Dec 8, 2021
@dellaert
Copy link
Member

dellaert commented Dec 8, 2021

ShareD Pointers are great for noise models, which could be used in thousands of factors or even millions. If we only create a handful or one optimizer ever, I agree it is not needed here.

@varunagrawal
Copy link
Collaborator Author

That's what I figured as well. Highly unlikely we'll need hundreds of optimizer parameters ever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants