argmin-rs / argmin

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

Make the LineSearch gradient parameter in BFGS consistent with the impl #508

Closed dspyz-matician closed 1 month ago

dspyz-matician commented 1 month ago

I want to implement my own custom Param type, but use Array1<f32> as the gradient type. However, the current constraints essentially force these types to be the same because the BacktrackingLineSearch trait is only implemented for <G, F> not for <P, F>

This PR fixes BFGS's constraints so that G is used consistently as the parameter to BFGS's associated LineSearch

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.48%. Comparing base (a9e3eb7) to head (15d60af). Report is 11 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #508 +/- ## ========================================== - Coverage 92.08% 91.48% -0.61% ========================================== Files 178 178 Lines 24455 23623 -832 ========================================== - Hits 22520 21612 -908 - Misses 1935 2011 +76 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.