171 votesDoug commented
It would be very cool to have this in Numerics. We use an independent port of the Fortran but it's far from pretty.
I vote for L-BFGS-B. We've used it extensively on high (20+) dimensional problems with slow fn evaluations (10-100ms) and it works as advertised for multivariate bounded minimization. DIY gradient. An automated gradient is numerically risky due to scaling and rounding, but could be a nice option.
6 votesDoug commented
Designed for HPC and the performance obsessed. We hit this class very hard with inner loops running billions of times by the end of a run. Tested up to A = 1000x1000 and B = 1000x8. It will run into stack out of memory issues for untested sizes.
The stackalloc on the unsafe version is a significant heap (garbage collector) saver, and eliminating the array bounds checking in the rest of the code leads to significant performance gains.
In a non-toy application this gives us a 20% performance boost.Doug shared this idea ·