OptimPack
New:a new version of OptimPack is available at GitHub.
OptimPack is a portable C library which implements algorithms for optimization of large scale problems with bound constraints. I wrote this library for my image reconstruction algorithms by inverse problem approach. Hence large scale means some 106 variables (the pixel values) or more.
The most important algorithm is VMLM-B: a variable metric method with limited memory requirements and, possibly, bound constraints on the parameters. The algorithm is based on limited memory BFGS updates [1] with Moré & Thuente inexact line search [2] and gradient projection to account for bounds. The method has been described in [3].
In order to make embedding OptimPack into another language as easy as possible, the routines use reverse communication: all local variables needed by the optimization routines get saved into workspace arrays provided by the caller and the optimization routines never explicitely call the penalty function to optimize. OptimPack routines can be used in different languages via bindings to C, IDL and Yorick:
- Sub-directory idl contains an implementation of OptimPack support in IDL (using CALL_EXTERNAL).
- Sub-directory yorick contains an implementation of OptimPack support in Yorick.
Documentation
Most of the documention is in the header file "optimpack.h".
Installation
- Download the source archive OptimPack-1.3.2.tar.bz2 and unpack it.
- Edit the Makefile (see "Portability Issues" below).
- Compile the library:
make
- Optionaly install the software, for instance:
make PREFIX=/usr/local install
which will:- copy file liboptimpack.a into directory /usr/local/lib;
- copy file optimpack.h into directory /usr/local/include;
- creates directory /usr/local/doc/OptimPack-$VERSION with some documentation and legal stuff.
Yorick Installation
- After unpacking the archive (you don't need to build the library), go to directory "yorick".
- Edit the very first part of makefile whether you want or don't want support for LBFGS and LBFGSB algorithms.
- Setup for compilation and compile the plugin code:
yorick -batch make.i make clean make
- Optionaly install plugin in Yorick tree:
make install
Portability Issues
OptimPack is written in standard ANSI-C and should pose no problem of portability. However, in order to match the data types used in your software, you may have to set the values of the following macros:
- OP_INTEGER = data type used to store array indices
- OP_LOGICAL = data type of the result of a logical test
This must be done before "optimpack.h" get included. If these macros are not defined, the default assumed in "optimpack.h" is:
OP_INTEGER = int OP_LOGICAL = int
For instance, one should write:
#define OP_INTEGER long #define OP_LOGICAL int #include "optimpack.h" ...
Of course, the installed OptimPack library must have been compiled with the correct data types. Another possibility is to define these macros when calling CPP (the C preprocessor) e.g. in Makefile:
CPPFLAGS = -DOP_INTEGER=long -DOP_LOGICAL=int -I.
a final possibility is to edit optimpack.h and to adjust the default values of these macros (at the very beginning of this file). If you plan to install in your system, the best is probably to fix the definitions in optimpack.h, then compile the library and finally install the library and the header file optimpack.h in proper system directories (e.g. with:
make install PREFIX=...