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

[PR Suggestion] Remove runtime exceptions #17

Closed
Svalorzen opened this issue Nov 20, 2020 · 2 comments
Closed

[PR Suggestion] Remove runtime exceptions #17

Svalorzen opened this issue Nov 20, 2020 · 2 comments

Comments

@Svalorzen
Copy link

I was wondering whether you would be interested in a patch that removed runtime exceptions, opting instead for returning either a boolean, enumeration or some sort of std::optional value to report whether a minimization went well or not.

I am not proposing removing exception related to erroneous parameters (so all std::invalid_arguments make sense for me).

I ask as exceptions can be relatively costly computationally when used as a failure status report, and given that one has no way to know in advance whether the provided inputs will result in failure or not, throwing an exception seems unduly harsh on the caller. In my current usage, for example, I am simply wrapping minimize calls in a try/except block that simply logs failures.

Please let me know if you would be interested in this, and I can try to provide a PR :)

@GPrathap
Copy link

+1

@yixuan
Copy link
Owner

yixuan commented May 25, 2023

This commit has removed major runtime exceptions when maximum number of line searches is reached, which should resolve most of the common issues.

There remain some exceptions in the code, which are mostly "serious" issues that are hard to proceed.

Let me first mark this as closed. Feel free to reopen if further issues occur.

@yixuan yixuan closed this as completed May 25, 2023
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

No branches or pull requests

3 participants