LAPACK

LAPACK (Netlib reference implementation)

Initial release| 1992; 34 years ago (1992)
Written in| Fortran 90
Type| Software library
License| BSD-new

LAPACK ("Linear Algebra Package") is a standard software library for numerical linear algebra. It provides routines for solving systems of linear equations and linear least squares, eigenvalue problems, and singular value decomposition. It also includes routines to implement the associated matrix factorizations such as LU, QR, Cholesky and Schur decomposition.[1] LAPACK was originally written in FORTRAN 77, but moved to Fortran 90 in version 3.2 (2008).[2] The routines handle both real and complex matrices in both single and double precision. LAPACK relies on an underlying BLAS implementation to provide efficient and portable computational building blocks for its routines.[1]: "The BLAS as the Key to Portability"

LAPACK was designed as the successor to the linear equations and linear least-squares routines of LINPACK and the eigenvalue routines of EISPACK. LINPACK, written in the 1970s and 1980s, was designed to run on the then-modern vector computers with shared memory. LAPACK, in contrast, was designed to effectively exploit the caches on modern cache-based architectures and the instruction-level parallelism of modern superscalar processors,[1]: "Factors that Affect Performance" and thus can run orders of magnitude faster than LINPACK on such machines, given a well-tuned BLAS implementation.[1]: "The BLAS as the Key to Portability" LAPACK has also been extended to run on distributed memory systems in later packages such as ScaLAPACK and PLAPACK.[3]

Netlib LAPACK is licensed under a three-clause BSD style license, a permissive free software license with few restrictions.[4]

## Contents

* 1 Naming scheme
* 2 Use with other programming languages and libraries
* 3 Implementations
* 3.1 Similar projects
* 4 See also
* 5 References

## Naming scheme

Subroutines in LAPACK have a naming convention which makes the identifiers very compact. This was necessary as the first Fortran standards only supported identifiers up to six characters long, so the names had to be shortened to fit into this limit.[1]: "Naming Scheme"

A LAPACK subroutine name is in the form `pmmaaa`, where:

* `p` is a one-letter code denoting the type of numerical constants used. `S`, `D` stand for real floating-point arithmetic respectively in single and double precision, while `C` and `Z` stand for complex arithmetic with respectively single and double precision. The newer version, LAPACK95, uses generic subroutines in order to overcome the need to explicitly specify the data type.
* `mm` is a two-letter code denoting the kind of matrix expected by the algorithm. The codes for the different kind of matrices are reported below; the actual data are stored in a different format depending on the specific kind; e.g., when the code `DI` is given, the subroutine expects a vector of length `n` containing the elements on the diagonal, while when the code `GE` is given, the subroutine expects an n×n array containing the entries of the matrix.
* `aaa` is a one- to three-letter code describing the actual algorithm implemented in the subroutine, e.g. `SV` denotes a subroutine to solve linear system, while `R` denotes a rank-1 update.

For example, the subroutine to solve a linear system with a general (non-structured) matrix using real double-precision arithmetic is called `DGESV`.[1]: "Linear Equations"

Matrix types in the LAPACK naming scheme  Name  | Description

|

BD  | bidiagonal matrix
DI  | diagonal matrix
GB  | general band matrix
GE  | general matrix (i.e., unsymmetric, in some cases rectangular)
GG  | general matrices, generalized problem (i.e., a pair of general matrices)
GT  | general tridiagonal matrix
HB  | (complex) Hermitian band matrix
HE  | (complex) Hermitian matrix
HG  | upper Hessenberg matrix, generalized problem (i.e. a Hessenberg and a triangular matrix)
HP  | (complex) Hermitian, packed storage matrix
HS  | upper Hessenberg matrix
OP  | (real) orthogonal matrix, packed storage matrix
OR  | (real) orthogonal matrix
PB  | symmetric matrix or Hermitian matrix positive definite band
PO  | symmetric matrix or Hermitian matrix positive definite
PP  | symmetric matrix or Hermitian matrix positive definite, packed storage matrix
PT  | symmetric matrix or Hermitian matrix positive definite tridiagonal matrix
SB  | (real) symmetric band matrix
SP  | symmetric, packed storage matrix
ST  | (real) symmetric matrix tridiagonal matrix
SY  | symmetric matrix
TB  | triangular band matrix
TG  | triangular matrices, generalized problem (i.e., a pair of triangular matrices)
TP  | triangular, packed storage matrix
TR  | triangular matrix (or in some cases quasi-triangular)
TZ  | trapezoidal matrix
UN  | (complex) unitary matrix
UP  | (complex) unitary, packed storage matrix

## Use with other programming languages and libraries

Many programming environments today support the use of libraries with C binding (LAPACKE, a standardised C interface,[5] has been part of LAPACK since version 3.4.0[6]), allowing LAPACK routines to be used directly so long as a few restrictions are observed. Additionally, many other software libraries and tools for scientific and numerical computing are built on top of LAPACK, such as R,[7] MATLAB,[8] and SciPy.[9]

Several alternative language bindings are also available:

* Armadillo for C++
* IT++ for C++
* LAPACK++ for C++
* Lacaml for OCaml
* SciPy for Python
* Gonum for Go
* PDL::LinearAlgebra for Perl Data Language
* Math::Lapack for Perl
* NLapack for .NET
* CControl for C in embedded systems
* lapack for rust

## Implementations

As with BLAS, LAPACK is sometimes forked or rewritten to provide better performance on specific systems. Some of the implementations are:

Accelerate
Apple's framework for macOS and iOS, which includes tuned versions of BLAS and LAPACK.[10][11]
Netlib LAPACK
The official LAPACK.
Netlib ScaLAPACK
Scalable (multicore) LAPACK, built on top of PBLAS.
Intel MKL
Intel's Math routines for their x86 CPUs.
OpenBLAS
Open-source reimplementation of BLAS and LAPACK.
Gonum LAPACK
A partial native Go implementation.

Since LAPACK typically calls underlying BLAS routines to perform the bulk of its computations, simply linking to a better-tuned BLAS implementation can be enough to significantly improve performance. As a result, LAPACK is not reimplemented as often as BLAS is.

### Similar projects

These projects provide a similar functionality to LAPACK, but with a main interface differing from that of LAPACK:

Libflame
A dense linear algebra library. Has a LAPACK-compatible wrapper. Can be used with any BLAS, although BLIS is the preferred implementation.[12]
Eigen
A header library for linear algebra. Has a BLAS and a partial LAPACK implementation for compatibility.
MAGMA
Matrix Algebra on GPU and Multicore Architectures (MAGMA) project develops a dense linear algebra library similar to LAPACK but for heterogeneous and hybrid architectures including multicore systems accelerated with GPGPUs.
PLASMA
The Parallel Linear Algebra for Scalable Multi-core Architectures (PLASMA) project is a modern replacement of LAPACK for multi-core architectures. PLASMA is a software framework for development of asynchronous operations and features out of order scheduling with a runtime scheduler called QUARK that may be used for any code that expresses its dependencies with a directed acyclic graph.[13]

## See also

* List of numerical libraries
* Math Kernel Library (MKL)
* NAG Numerical Library
* SLATEC, a FORTRAN 77 library of mathematical and statistical routines
* QUADPACK, a FORTRAN 77 library for numerical integration

## References

1. ↑ 1.0 1.1 1.2 1.3 1.4 1.5 Anderson, E.; Bai, Z.; Bischof, C.; Blackford, S.; Demmel, J.; Dongarra, J.; Du Croz, J.; Greenbaum, A. et al. (1999). LAPACK Users' Guide (Third ed.). Philadelphia, PA: Society for Industrial and Applied Mathematics. ISBN 0-89871-447-8. https://www.netlib.org/lapack/lug/. Retrieved 28 May 2022.
2. ↑ "LAPACK 3.2 Release Notes". 16 November 2008. https://www.netlib.org/lapack/lapack-3.2.html.
3. ↑ "PLAPACK: Parallel Linear Algebra Package". University of Texas at Austin. 12 June 2007. https://www.cs.utexas.edu/users/plapack/.
4. ↑ "LICENSE.txt". https://www.netlib.org/lapack/LICENSE.txt.
5. ↑ "The LAPACKE C Interface to LAPACK". https://netlib.org/lapack/lapacke.html.
6. ↑ "LAPACK 3.4.0". https://netlib.org/lapack/lapack-3.4.0.html.
7. ↑ "R: LAPACK Library". https://stat.ethz.ch/R-manual/R-patched/library/base/html/La_library.html.
8. ↑ "LAPACK in MATLAB". https://www.mathworks.com/help/matlab/math/lapack-in-matlab.html.
9. ↑ "Low-level LAPACK functions". https://docs.scipy.org/doc/scipy/reference/linalg.lapack.html.
10. ↑ "Guides and Sample Code". https://developer.apple.com/library/mac/#releasenotes/Performance/RN-vecLib/.
11. ↑ "Guides and Sample Code". https://developer.apple.com/library/ios/#documentation/Accelerate/Reference/AccelerateFWRef/.
12. ↑ "amd/libflame: High-performance object-based library for DLA computations". AMD. 25 August 2020. https://github.com/amd/libflame.
13. ↑ "ICL". http://icl.eecs.utk.edu/.

* v
* t
* e

Numerical linear algebra

Key concepts|

* Floating point
* Numerical stability

Problems|

* System of linear equations
* Matrix decompositions
* Matrix multiplication (algorithms)
* Matrix splitting
* Sparse problems

Hardware|

* CPU cache
* TLB
* Cache-oblivious algorithm
* SIMD
* Multiprocessing

Software|

* MATLAB
* Basic Linear Algebra Subprograms (BLAS)
* LAPACK
* Specialized libraries
* General purpose software

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/LAPACK. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:LAPACK&oldid=4149881"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template