argmin-rs / argmin

Numerical optimization in pure Rust
http://argmin-rs.org
Apache License 2.0
975 stars 76 forks source link

New TerminationReason definition #316

Closed relf closed 1 year ago

relf commented 1 year ago

This PR implements a new version of TerminationReason enum as discussed here.

It introduces the variant SolverExit(String) which allows to define custom stopping reason and SolverConverged which is intended to gather all successful exit reasons under the same umbrella.

Some unwanted implementation consequences:

codecov-commenter commented 1 year ago

Codecov Report

Base: 93.39% // Head: 93.36% // Decreases project coverage by -0.04% :warning:

Coverage data is based on head (41cbaca) compared to base (1caaf44). Patch coverage: 58.46% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #316 +/- ## ========================================== - Coverage 93.39% 93.36% -0.04% ========================================== Files 119 119 Lines 19012 18986 -26 ========================================== - Hits 17756 17726 -30 - Misses 1256 1260 +4 ``` | [Impacted Files](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs) | Coverage Δ | | |---|---|---| | [argmin/src/core/state/mod.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9jb3JlL3N0YXRlL21vZC5ycw==) | `100.00% <ø> (ø)` | | | [argmin/src/solver/brent/brentroot.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9zb2x2ZXIvYnJlbnQvYnJlbnRyb290LnJz) | `0.97% <0.00%> (ø)` | | | [...n/src/solver/gaussnewton/gaussnewton\_linesearch.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9zb2x2ZXIvZ2F1c3NuZXd0b24vZ2F1c3NuZXd0b25fbGluZXNlYXJjaC5ycw==) | `92.69% <0.00%> (ø)` | | | [...rgmin/src/solver/gaussnewton/gaussnewton\_method.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9zb2x2ZXIvZ2F1c3NuZXd0b24vZ2F1c3NuZXd0b25fbWV0aG9kLnJz) | `96.52% <0.00%> (ø)` | | | [argmin/src/solver/goldensectionsearch/mod.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9zb2x2ZXIvZ29sZGVuc2VjdGlvbnNlYXJjaC9tb2QucnM=) | `95.29% <0.00%> (ø)` | | | [argmin/src/solver/neldermead/mod.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9zb2x2ZXIvbmVsZGVybWVhZC9tb2QucnM=) | `94.31% <0.00%> (ø)` | | | [argmin/src/solver/quasinewton/sr1.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9zb2x2ZXIvcXVhc2luZXd0b24vc3IxLnJz) | `76.50% <0.00%> (ø)` | | | [argmin/src/solver/quasinewton/sr1\_trustregion.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9zb2x2ZXIvcXVhc2luZXd0b24vc3IxX3RydXN0cmVnaW9uLnJz) | `72.25% <0.00%> (ø)` | | | [argmin/src/solver/simulatedannealing/mod.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9zb2x2ZXIvc2ltdWxhdGVkYW5uZWFsaW5nL21vZC5ycw==) | `85.65% <0.00%> (-0.72%)` | :arrow_down: | | [argmin/src/solver/trustregion/steihaug.rs](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs#diff-YXJnbWluL3NyYy9zb2x2ZXIvdHJ1c3RyZWdpb24vc3RlaWhhdWcucnM=) | `60.55% <0.00%> (ø)` | | | ... and [12 more](https://codecov.io/gh/argmin-rs/argmin/pull/316?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argmin-rs)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.