I’ve summarized some of my thinking on this topic in a few places:
- Modern Fortran interface for NLopt
- Callback function design · Issue #16 · grimme-lab/nlopt-f · GitHub
I’ve gone down this path a bit too. Digging through my long list of stale private repositories there is one with the following README:
optimization-shed
Ivan’s optimization shed - a workspace for tinkering with optimization codes in Fortran, C, and C++
My goals for this repository include:
- defining one or more canonical interfaces for (Fortran) callback routines used in mathematical optimization
- experimenting with design patterns to develop robust, composable, flexible, and extensible solver libraries
- develop adaptor patterns for mixed-language programming in Fortran/C/C++
Instead of re-implementing algorithms from scratch, we can start by integrating and evaluating existing libraries. The discovery process should feed information into achieving the goals above.