Levenberg-Marquart + SLSQP for Proximity
Overview
Adds Levenberg-Marquart and SLSQP for proximity. Current implementation wouldn't work for some situations (see #389). Source for SLSQP is from current scipy's fortran version. To avoid difficulties of fortran-compiler-setup in CI systems, the source is translated to c using f2c. Then, removed some static variables and add const keywords.
Now, the search looks like this:
Initial guess
|
Newton
|
Converged? -- yes -- return
|
No
|
Reset initial guess, max_iterations *= 5
|
SLSQP
|
Converged? -- yes -- return
|
No
|
Reset initial guess, max_iterations *= 5
|
LM
Also, SLSQP can incorporate bounds. Nice.
Addressed Issues
- fixes #389
- Sometimes, newton iterations does not converge
- Sometimes, we needed to sample a lot of points for k-d tree
- Sometimes, we really want to get correct values at any cost.
Checklists
- [ ] Documentations are up-to-date.
- [ ] Added example(s)
- [ ] Added test(s)
super cool!
Do you have scripts/notes of the origin of this implementation?
never mind, found it in #389
one thing to note in general is that we probably had to call system.ResetRowOrder(); at each iteration.
one thing to note in general is that we probably had to call
system.ResetRowOrder();at each iteration.
On the other hand, it would have iterated through this order and reordered it, so maybe it is irrelevant
If you get a chance, I'd appreciate if you can take a look at proximity.hpp / proximity.cpp @danielwolff1 :)
Thanks for incorporating the changes, from my point of view this can be merged! 🚀
Thanks for the review @danielwolff1 !