TANGO Trustable Algorithms for Nonlinear General Optimization
The University of Campinas and University of São Paulo joint project for optimization software development.

ALGENCAN 1.0 AMPL interface

Note that this interface corresponds to an old version of ALGENCAN! Click here to download the ALGENCAN latest version (including all the interfaces).

algencanma.run
This file contains an AMPL script that loads the problem model and then calls the optimization solver (GENCAN for bound-constrainted problems and ALGENCAN for general nonlinear programming problems) to solve the problem.
toyprob.mod
This file contains the model in AMPL of a very easy problem. This is the file that the user should modify to solve his/her own problem.
amplwrapper.c
This is the file responsible for the interface between AMPL and C/C++.
amplwrapper.h
amplwrapper header file.
cfortran.h
This is the file responsible for the interface between C/C++ and Fortran.
Makefile
This (optionaly) file can be used to easily compile the codes using the make command.

Quick start

1)Copy the 6 files above.
2)Compile typing make or, manually, typing
g77 -O4 -c -xf77-cpp-input -DAMPL algencan.f
gcc -O4 -c -Df2cFortran -I$AMPLDIR/solvers amplwrapper.c
g77 -O4 -ldl -lstdc++ algencan.o amplwrapper.o \
$AMPLDIR/solvers/amplsolver.a -o algencan
3) Enter into AMPL and type include algencanma.run.
Obs1: To use this interface you need to have downloaded ALGENCAN 1.0.
Obs2: It is assumed that (i) the environment variable AMPLDIR points to the directory where AMPL is installed and that (ii) you have downloaded file solvers.tar from the AMPL page at Netlib and (following the instructions in the README file) built the file $AMPLDIR/solvers/amplsolver.a.
Obs3: Be sure that the current directory is in the PATH enviromental variable, so (at Step 3) AMPL will be able to find the executable file algencan generated at Step 2. To add the current directory to the path in a Linux platform, type export PATH=$PATH:..


UNICAMP
Page last modified: Nov 13, 2008.
Page URL: http://www.ime.usp.br/~egbirgin/tango/
Contact: egbirgin@ime.usp.br, egbirgin@gmail.com
USP