Accelerating the pace of engineering and science

This is a Supplement to the Cleve's Corner Article MATLAB Incorporates LAPACK

This is a supplement to the Cleve's Corner article, MATLAB Incorporates LAPACK

March 29, 2000: Today we are posting versions of the numerics library that correct a bug in earlier versions. The bug involves "balancing" or scaling in eigenvector computations and leads to incorrect eigenvectors for some matrices. Please replace earlier versions with these corrected versions.

This supplement provides access to new versions of the numerics library for use with MATLAB 5.3 (Release 11 of the MathWorks CD).

The new library uses LAPACK and machine-dependent optimized BLAS (Basic Linear Algebra Subprograms) for matrix computations. The built-in functions involved include matrix multiplication (*), linear equation solution (/ and \), chol, lu, qr, eig, svd, qz, schur, hess, rcond, det and inv. The command-line and M-file interface to these functions is unchanged, but both execution time performace and numerical results are affected. Expected performance improvments depend upon the matrix size, the function and the machine. We have seen speedups by factors as large as eight for matrix multiplication and Gaussian elimination on matrices of order a few hundred.

Numerical results are affected by changes in floating point round off error and by possibly different determination of quantities that are not uniquely determined mathematically. Eigenvalues and singular values may occur in different orders and eigenvectors and singular vectors may be normalized differently. For example:

A = pascal(3)
B = hilb(3)
[V,D] = eig(A,B)

With previous libraries, the eigenvalues in diag(D) can occur in any order and the eigenvectors in the columns of V have length one. With the new library, the eigenvalues occur in increasing order and the eigenvectors are normalized so that V'*B*V is the identity matrix.

Note that the new library affects only MATLAB itself. The performance and numerical results of other MathWorks products, such as Simulink and the C Math library, will not change.

You can download a preliminary distribution of the new numerics library that will work with MATLAB 5.3. The download does not require any installers, license changes or passwords. You simply download a file for your machine, unpack it, and place it in the appropriate directory.

On Windows, the directory is

matlab/bin

In this directory, you will find a file named numerics.dll. Rename this to something like numerics.bak. Then download the following Windows self-extracting zip file:

When you execute this in the bin directory, you will produce a new numerics.dll and a Fortran support library, dformd.dll.

On Unix and Linux, the directory is

matlab/bin/arch

where arch</ code> is the abbreviation of the particular architecture. In this directory, you will find a file named libmwnumerics.so. Rename this to something like libmwnumerics.bak. Then download one of the following compressed files:

Uncompress or gunzip this file in the bin/arch directory and rename the file to eliminate the prefix up to the underscore. This will produce a new libmwnumerics.so shared library that includes LAPACK and the BLAS.

Some Web browsers automatically decompress these files during the download. In one case, the browser decompresses the file, but does not delete the ".gz" suffix in the file name.

If you have any difficulties, or see anything that should be changed before we include this in the next release of MATLAB, please let me know.

Published 2000

Products Used

Start a new search