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 R 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.r
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).
toyprob.r
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.
rwrapper.c
This is the file responsible for the interface between R and C/C++.
rwrapper.h
rwrapper 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
gfortran-4.2 -O4 -c -shared -fPIC -xf77-cpp-input algencan.f
gcc-4.2 -O4 -c -shared -fPIC -Df2cFortran -I/usr/share/R/include rwrapper.c
R CMD SHLIB -lg2c rwrapper.o algencan.o -o algencan.so
3)Run with R --vanilla < algencanma.r.
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.r file to solve your own problem.
Obs1: To use this interface you need to have downloaded ALGENCAN 1.0.


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