Reputation: 300
I've been trying to port a code from MATLAB to C++, and stumbled on a very unexpected difficulty. I can't seem to find the C++ equivalant to MATLAB's fminunc.
Simply put, the problems definition is minimizing f(x), for a vector x, a scalar function f(x), and intial guess x_0.
My search endeavors thus far have only cropped up a library called MinPack, which fails to adress the case where f(x) is a scalar and x is vector.
Surely a programming language that's as old as time has some freely available implementation of classic numerical recipes for nonlinear optimization? Or am I being overly optimistic here? Even basic approaches such as gradient descent would be a huge improvement over nothing...
Upvotes: 0
Views: 2304
Reputation: 582
Here's another good one: GSL, in particular http://www.gnu.org/software/gsl/manual/gsl-ref_36.html#SEC498
Upvotes: 1
Reputation: 58501
My personal choice would be IPOPT, a general purpose nonlinear solver. It knows far more than you asked for.
The other options would include:
The latter would unfortunately involve interfacing with FORTRAN; it is painful and boring but really not a rocket science.
Upvotes: 1