Search code examples
matlaboptimizationampl

Hooking AMPL with Matlab using amplfunc and spamfunc


I'm interested in hooking up AMPL with Matlab to obtain objective values, gradients, and Jacobians to test ideas for optimization algorithms on a wide set of problems. I'm aware that I can use amplfunc.mex or spamfunc.mex to do this; however, I'm having trouble compiling the .mex files using the old netlib files on Windows. The link also given in a previous question:

Using MATLAB with AMPL

is outdated. Does anyone know where I can obtain these .mex files or offer any alternative solutions? Thanks in advance.


Solution

  • The mex files amplfunc.c and spamfunc.c are still available at http://www.ampl.com/netlib/ampl/solvers/examples. We aren't aware of a reason why these wouldn't compile, but if you are having trouble you could write to the AMPL user forum, [email protected]. Be sure to explain which function you are using and to give the complete text of any error messages you see.