Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
LAPACK
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Software library for numerical linear algebra}} {{Infobox software | name = LAPACK (Netlib reference implementation) | logo = LAPACK logo.svg | logo size = 120px | screenshot = | caption = | collapsible = | author = | developer = | released = {{Start date and age|1992}} | latest release version = {{Wikidata|property|reference|edit|P348}} | latest release date = {{Start date and age|{{wikidata|qualifier|P348|P577}}|df=yes}} | latest preview version = | latest preview date = | programming language = [[Fortran 90]] | operating system = | platform = | size = | language = | genre = [[Software library]] | license = [[BSD-new]] | website = <!-- Wikidata --> }} '''LAPACK''' ("Linear Algebra Package") is a standard [[software library]] for [[numerical linear algebra]]. It provides [[subroutine|routines]] for solving [[systems of linear equations]] and [[numerical methods for linear least squares|linear least squares]], [[eigendecomposition of a matrix|eigenvalue problems]], and [[singular value decomposition]]. It also includes routines to implement the associated [[matrix factorization]]s such as [[LU decomposition|LU]], [[QR decomposition|QR]], [[Cholesky decomposition|Cholesky]] and [[Schur decomposition]].<ref name="LAPACK User Manual">{{cite book|last1=Anderson|first1=E.|last2=Bai|first2=Z.|last3=Bischof|first3=C.|last4=Blackford|first4=S.|last5=Demmel|first5=J.|author-link5=James Demmel|last6=Dongarra|first6=J.|author-link6=Jack Dongarra|last7=Du Croz|first7=J.|last8=Greenbaum|first8=A.|author-link8=Anne Greenbaum|last9=Hammarling|first9=S.|last10=McKenney|first10=A.|last11=Sorensen|first11=D. | title =LAPACK Users' Guide | edition = Third | publisher = Society for Industrial and Applied Mathematics | year = 1999 | location = Philadelphia, PA | isbn = 0-89871-447-8 | url = https://www.netlib.org/lapack/lug/ | access-date=28 May 2022 }}</ref> LAPACK was originally written in [[FORTRAN 77]], but moved to [[Fortran 90]] in version 3.2 (2008).<ref>{{cite web|url=https://www.netlib.org/lapack/lapack-3.2.html|title=LAPACK 3.2 Release Notes|date=16 November 2008}}</ref> The routines handle both [[real number|real]] and [[complex number|complex]] matrices in both [[single precision|single]] and [[double precision]]. LAPACK relies on an underlying [[Basic Linear Algebra Subprograms|BLAS]] implementation to provide efficient and portable computational building blocks for its routines.<ref name="LAPACK User Manual" />{{rp|at=[https://www.netlib.org/lapack/lug/node65.html "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 processor|vector computer]]s with shared memory. LAPACK, in contrast, was designed to effectively exploit the [[CPU cache|cache]]s on modern cache-based architectures and the [[instruction-level parallelism]] of modern [[superscalar processor]]s,<ref name="LAPACK User Manual" />{{rp|at=[https://www.netlib.org/lapack/lug/node61.html "Factors that Affect Performance"]}} and thus can run orders of magnitude faster than LINPACK on such machines, given a well-tuned [[Basic Linear Algebra Subprograms|BLAS]] implementation.<ref name="LAPACK User Manual" />{{rp|at=[https://www.netlib.org/lapack/lug/node65.html "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.<ref>{{cite web|access-date=20 April 2017| date=12 June 2007| title=PLAPACK: Parallel Linear Algebra Package| url=https://www.cs.utexas.edu/users/plapack/| website=www.cs.utexas.edu| publisher=[[University of Texas at Austin]]}}</ref> Netlib LAPACK is licensed under a three-clause [[BSD licenses|BSD style]] license, a [[permissive free software license]] with few restrictions.<ref>{{cite web |title=LICENSE.txt |url=https://www.netlib.org/lapack/LICENSE.txt |website=Netlib |access-date=28 May 2022}}</ref> ==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.<ref name="LAPACK User Manual" />{{rp|at=[https://www.netlib.org/lapack/lug/node24.html "Naming Scheme"]}} A LAPACK subroutine name is in the form <code>pmmaaa</code>, where: * <code>p</code> is a one-letter code denoting the type of numerical constants used. <code>S</code>, <code>D</code> stand for real [[floating-point arithmetic]] respectively in single and double precision, while <code>C</code> and <code>Z</code> stand for [[complex number|complex arithmetic]] with respectively single and double precision. The newer version, LAPACK95, uses [[generic function|generic]] subroutines in order to overcome the need to explicitly specify the data type. * <code>mm</code> 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 <code>DI</code> is given, the subroutine expects a vector of length <code>n</code> containing the elements on the diagonal, while when the code <code>GE</code> is given, the subroutine expects an {{math|''n''Γ''n''}} array containing the entries of the matrix. * <code>aaa</code> is a one- to three-letter code describing the actual algorithm implemented in the subroutine, e.g. <code>SV</code> denotes a subroutine to solve [[linear system]], while <code>R</code> 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 <code>DGESV</code>.<ref name="LAPACK User Manual" />{{Rp|at=[https://www.netlib.org/lapack/lug/node26.html "Linear Equations"]}} {|class="wikitable" |+ Matrix types in the LAPACK naming scheme |- ! Name ! Description |- | BD | [[bidiagonal matrix]] |- | DI | [[diagonal matrix]] |- | GB | general [[band matrix]] |- | GE | general [[matrix (mathematics)|matrix]] (i.e., [[symmetric matrix|unsymmetric]], in some cases rectangular) |- | GG | general matrices, generalized problem (i.e., a pair of general matrices) |- | GT | general [[tridiagonal matrix]] |- | HB | ([[Complex number|complex]]) [[Hermitian matrix|Hermitian]] [[band matrix]] |- | HE | ([[Complex number|complex]]) [[Hermitian matrix]] |- | HG | [[upper Hessenberg matrix]], generalized problem (i.e. a Hessenberg and a [[triangular matrix]]) |- | HP | ([[Complex number|complex]]) [[Hermitian matrix|Hermitian]], [[packed storage matrix]] |- | HS | [[upper Hessenberg matrix]] |- | OP | ([[Real number|real]]) [[orthogonal matrix]], [[packed storage matrix]] |- | OR | ([[Real number|real]]) [[orthogonal matrix]] |- | PB | [[symmetric matrix]] or [[Hermitian matrix]] [[positive definite matrix|positive definite]] band |- | PO | [[symmetric matrix]] or [[Hermitian matrix]] [[positive definite matrix|positive definite]] |- | PP | [[symmetric matrix]] or [[Hermitian matrix]] [[positive definite matrix|positive definite]], [[packed storage matrix]] |- | PT | [[symmetric matrix]] or [[Hermitian matrix]] [[positive definite matrix|positive definite]] [[tridiagonal matrix]] |- | SB | ([[Real number|real]]) [[symmetric matrix|symmetric]] [[band matrix]] |- | SP | [[Symmetric matrix|symmetric]], [[packed storage matrix]] |- | ST | ([[Real number|real]]) [[symmetric matrix]] [[tridiagonal matrix]] |- | SY | [[symmetric matrix]] |- | TB | [[Triangular matrix|triangular]] [[band matrix]] |- | TG | [[Triangular matrix|triangular matrices]], generalized problem (i.e., a pair of [[triangular matrix|triangular matrices]]) |- | TP | [[Triangular matrix|triangular]], [[packed storage matrix]] |- | TR | [[triangular matrix]] (or in some cases quasi-triangular) |- | TZ | [[trapezoidal matrix]] |- | UN | ([[Complex number|complex]]) [[unitary matrix]] |- | UP | ([[Complex number|complex]]) [[unitary matrix|unitary]], [[packed storage matrix]] |} ==Use with other programming languages and libraries== Many programming environments today support the use of libraries with [[C (programming language)|C]] binding (LAPACKE, a standardised C interface,<ref>{{cite web |title=The LAPACKE C Interface to LAPACK |url=https://netlib.org/lapack/lapacke.html |website=LAPACK β Linear Algebra PACKage |access-date=2024-09-22 }}</ref> has been part of LAPACK since version 3.4.0<ref>{{cite web |title=LAPACK 3.4.0 |url=https://netlib.org/lapack/lapack-3.4.0.html |website=LAPACK β Linear Algebra PACKage |access-date=2024-09-22 }}</ref>), 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 (programming language)|R]],<ref>{{Cite web |title=R: LAPACK Library |url=https://stat.ethz.ch/R-manual/R-patched/library/base/html/La_library.html |access-date=2022-03-19 |website=stat.ethz.ch }}</ref> [[MATLAB]],<ref>{{cite web |title=LAPACK in MATLAB |url=https://www.mathworks.com/help/matlab/math/lapack-in-matlab.html |website=Mathworks Help Center |access-date=28 May 2022 }}</ref> and [[SciPy]].<ref>{{cite web |title=Low-level LAPACK functions |url=https://docs.scipy.org/doc/scipy/reference/linalg.lapack.html |website=SciPy v1.8.1 Manual |access-date=28 May 2022 }}</ref> Several alternative [[language binding]]s are also available: * [[Armadillo (C++ library)|Armadillo]] for [[C++]] * [[IT++]] for C++ * [[LAPACK++]] for C++ * Lacaml for [[OCaml]] * [[SciPy]] for [[Python (programming language)|Python]] * Gonum for [[Go (programming language)|Go]] * [https://metacpan.org/pod/PDL::LinearAlgebra PDL::LinearAlgebra] for [[Perl Data Language]] * [https://metacpan.org/pod/Math::Lapack Math::Lapack] for [[Perl]] * [https://github.com/2xmax/NLapack NLapack] for [[.NET_Framework|.NET]] * [https://github.com/DanielMartensson/CControl CControl] for [[C (programming language)|C]] in embedded systems * [https://docs.rs/lapack/latest/lapack/ lapack] for [[rust (programming language)|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 Inc.|Apple]]'s framework for [[macOS]] and [[IOS (Apple)|iOS]], which includes tuned versions of [[BLAS]] and LAPACK.<ref>{{Cite web|url=https://developer.apple.com/library/mac/#releasenotes/Performance/RN-vecLib/|title=Guides and Sample Code|website=developer.apple.com|access-date=2017-07-07}}</ref><ref>{{Cite web|url=https://developer.apple.com/library/ios/#documentation/Accelerate/Reference/AccelerateFWRef/|title=Guides and Sample Code|website=developer.apple.com|access-date=2017-07-07}}</ref> ; 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 (programming language)|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 (software)|BLIS]] is the preferred implementation.<ref>{{cite web |title=amd/libflame: High-performance object-based library for DLA computations |url=https://github.com/amd/libflame |website=GitHub |publisher=AMD |date=25 August 2020}}</ref> ; [[Eigen (C++ library)|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 [[GPGPU]]s. ; 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]].<ref>{{Cite web |url=http://icl.eecs.utk.edu/ |title=ICL |website=icl.eecs.utk.edu |access-date=2017-07-07 }}</ref> {{See also|Basic Linear Algebra Subprograms#Similar libraries (not compatible with BLAS)}} ==See also== {{Portal|Free and open-source software}} * [[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== {{Reflist}} {{Numerical linear algebra}} [[Category:Fortran libraries]] [[Category:Free software programmed in Fortran]] [[Category:Numerical linear algebra]] [[Category:Numerical software]] [[Category:Software using the BSD license]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox software
(
edit
)
Template:Math
(
edit
)
Template:Numerical linear algebra
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Rp
(
edit
)
Template:See also
(
edit
)
Template:Short description
(
edit
)