You are here: Home > Software > 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.


Most of the documention is in the header file "optimpack.h".


  1. Download the source archive OptimPack-1.3.2.tar.bz2 and unpack it.
  2. Edit the Makefile (see "Portability Issues" below).
  3. Compile the library:
  4. 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

  1. After unpacking the archive (you don't need to build the library), go to directory "yorick".
  2. Edit the very first part of makefile whether you want or don't want support for LBFGS and LBFGSB algorithms.
  3. Setup for compilation and compile the plugin code:
    yorick -batch make.i
    make clean
  4. 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:


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:


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=...


[1] J. Nocedal, "Updating Quasi-Newton Matrices with Limited Storage," Mathematics of Computation 35, pp. 773—782, 1980. [2] Jorge J. Moré & and David J. Thuente, "Line search algorithms with guaranteed sufficient decrease," in ACM Transactions on Mathematical Software (TOMS) Volume 20, Issue 3, Pages 286—307, September 1994.
[3] pdf É. Thiébaut, "Optimization issues in blind deconvolution algorithms," Proc. SPIE 4847, pp. 174—183, 2002.

Yeti 6.4.0

Yeti version 6.4.0 has been released (2015-02-06). This version has no new feature compared to 6.3.3 but is now hosted on GitHub. [more]


MiRA won 2008' Beauty Contest

MiRA has won the 2008' edition of the Beauty Contest for image reconstruction algorithms from optical interferometry data.