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 C/C++ 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.c
This file contains an example of a main program that sets the problem data and calls the optimization solver (GENCAN for bound-constrainted problems and ALGENCAN for general nonlinear programming problems).
algencanma.h
algencanma header file.
toyprob.c
This file contains the definition (objective function, constraints, initial point, bounds on the variables, etc.) of a very easy problem. This is the file that the user should modify to solve his/her own problem.
cwrapper.c
This is the file responsible for the interface between C/C++ and Fortran.
cwrapper.h
cwrapper 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 7 files above.
2)Compile typing make or, manually, typing
gcc -O4 -c -Df2cFortran algencanma.c toyprob.c cwrapper.c
g77 -O4 -c -xf77-cpp-input algencan.f
g77 -O4 -lstdc++ algencanma.o toyprob.o cwrapper.o algencan.o \
-o algencanma
3)Run with algencanma.
4)If everything was ok, the output in the screen should be very similar to the content of the file algencan.out that comes with ALGENCAN.
5) Modify the toyprob.c file to solve your own problem.
Obs1: To use this interface you need to have downloaded ALGENCAN 1.0.
Obs2: Just change compiler gcc by g++ to compile e C++ program.


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