View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
mex interface for bound constrained optimization via ASA

4.0 | 2 ratings Rate this file 8 Downloads (last 30 days) File Size: 10.9 KB File ID: #35814 Version: 1.2

mex interface for bound constrained optimization via ASA


Stephen Becker (view profile)


22 Mar 2012 (Updated )

ASA solves bound constrained problems; the user provides routines to calculate the function and grad

| Watch this File

File Information

ASA (Active-Set Algorithm) is a bound constrained optimization program developed W. W. Hager and H. Zhang. In recent academic tests (e.g. "Evaluating bound-constrained minimization software" by E. Birgin and J. Gentil, 2011) it has been shown to be very fast (even faster than L-BFGS-B).

The original code (see and is written in C. This Matlab package is a mex gateway routine, along with a simple sample file that gets you started.

It requires you to compile with the mex compiler, but there are no necessary libraries, so if you have a C compiler, it should be very straightforward.

The test_ASA.m file installs everything: it downloads the C files, and it runs the mex compiler. The file also has a little test, and it shows how to make an example with non-negative least-squares (NNLS). For the NNLS problem, I include 3 driver routines that use an additional input of parameters so that you can re-use those functions even when parameters change; this trick should be useful for other problems.

The ASA method uses an active-set approach, and a state-of-the-art non-linear CG algorithm ("cg_descent") to solve the subproblems. Info available at

This mex interface works with v2.2 of their code; there are no guarantees it will work with a future version. It should work with any version of Matlab.


This file inspired Zero Sr1.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
07 Jun 2016 babaoglu

babaoglu (view profile)

Link update:

13 Apr 2016 neiho

neiho (view profile)

Links are dead. Could you give new ones? Thank you:)

27 Mar 2012 1.1

Making it more powerful by allowing extra options parameter, and showing an example with NNLS. Also incorporating suggestions by James Tursa.

23 Jul 2012 1.2

The new mex file is compatible with a wider variety of compilers now

Contact us