Ivan Pribec
Ivan Pribec
I've been playing around with the idea of placing the function and constraints inside of a nonlinear optimization problem derived type. The interface becomes closer to the Julia [NLopt.jl](https://github.com/JuliaOpt/NLopt.jl) wrapper....
Isn't this a problem of the C interface too (see [forced termination](https://nlopt.readthedocs.io/en/latest/NLopt_Reference/#forced-termination))? The only way you can pass a `nlopt_opt` instance to the callback is either you have a global...
Maybe using a derived type as the result could reduce interface verbosity: ```fortran function nlopt_func_interface(x, gradient, func_data) result(f) import :: c_int, c_double, c_ptr implicit none real(c_double), intent(in) :: x(:) real(c_double),...
In the C++ wrapper, they assume users will [throw an exception](https://nlopt.readthedocs.io/en/latest/NLopt_C-plus-plus_Reference/#forced-termination) to force a stop. They then pass the `opt` object as the `f_data`: https://github.com/stevengj/nlopt/blob/42c43f3938b201042798c3925935a914b3049ed8/src/api/nlopt-in.hpp#L126 Seeing this solution, the lowest...
> Having the handle as part of the objective function would defeat the point of separating the problem from the solver. Indeed. If you can roll out an interface with...
NAG uses the following interface in [e04kdf](https://www.nag.com/numeric/nl/nagdoc_latest/flhtml/e04/e04kdf.html) ```fortran ! NAG E04KDF (bounds_mod_deriv_comp) ! Subroutine funct ( iflag, n, xc, fc, gc, iw, liw, w, lw) Integer, Intent (In) :: n,...
In many cases NAG has two sets of routines (and accompanying interfaces): "easy" routines, with no option to force stop or recover from errors, and expert routines for edge cases....
A few points I've noticed: * you are missing the `version`, `version_major`, `version_minor`, `version_bugfix` routines * `handle_result` could be expanded to report the reason it stopped (see https://github.com/stevengj/nlopt/blob/304137ff414be4c0f5abf72cda25bfb3ec2775d1/src/api/nlopt-in.hpp#L78 in the...
> Instead I decided it would be preferable to use the excellent stability of the C-ABI and create a separate project that can be easily redistributed with the dependent projects....
Hi Fabio, it's been a few years since I wrote these modules. I was still learning CMake at the time and wasn't really aware of all the best practices. I...