* 起源-BLAS
“BLAS(Basic Linear Algebra Subprograms基本线性代数子程序)是一个高质量的程序包,用于基本的矢量和矩阵运算。一级BLAS负责矢量-矢量运算,二级BLAS负责矢量-矩阵运算,而三级BLAS负责矩阵-矩阵运算。由于BLAS高效,可移植和广泛可用,在高质量线性代数软件中常常使用它。”
“The BLAS (Basic Linear Algebra Subprograms) are high quality ‘building block’ routines for performing basic vector and matrix operations. Level 1 BLAS do vector-vector operations, Level 2 BLAS do matrix-vector operations, and Level 3 BLAS do matrix-matrix operations. Because the BLAS are efficient, portable, and widely available, they’re commonly used in the development of high quality linear algebra software” --BLAS FAQ
BLAS常见问题(FAQ)是初学者最好的起点,可以了解BLAS以及它与ATLAS,LAPACK已经其他BLAS实现的关系。
* 优化的BLAS-Atlas
“ATLAS(Automatically Tuned Linear Algebra Software自动优化的线性代数软件)项目是一个进行中的研究项目,集中在使用实际经验技巧提供可移植的性能。目前它提供了C和Fortran77的编程界面用于连接一个可移植的高效BLAS实现,以及从LAPACK移植的几个子程序。”
“The ATLAS (Automatically Tuned Linear Algebra Software) project is an ongoing research effort focusing on applying empirical techniques in order to provide portable performance. At present, it provides C and Fortran77 interfaces to a portably efficient BLAS implementation, as well as a few routines from LAPACK.”
常见问题(FAQ)是学习的起点。ATLAS被使用在MAPLE,Matlab,Mathematica,Octave,GSL,R,Scilab。在Debian,Suse, FreeBSD和Mac OS X中都有。
* 超集-LAPACK(Linear Algebra PACKage线性代数包)
“LAPACK是用Fotran77写成,提供了子程序用来解线性方程组,最小二乘法,本征值问题和奇值问题。同时还提供了矩阵分解的子程序-LU,Cholesky, QR, SVD, Schur, 通用Schur,以及相关的运算例如Schur分解的重排,和条件数值的确定。它可以处理密集和条状矩阵,但不包括一般稀疏矩阵。所有这些子程序都提供了实数和复数的单精度和双精度版本。
“LAPACK is written in Fortran77 and provides routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems. The associated matrix factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are also provided, as are related computations such as reordering of the Schur factorizations and estimating condition numbers. Dense and banded matrices are handled, but not general sparse matrices. In all areas, similar functionality is provided for real and complex matrices, in both single and double precision.
LAPACK子程序尽量使用BLAS中的功能。LAPACK起初是为了更好的使用三级BLAS-一组进行不同矩阵乘法和解三角矩阵的Fortran子程序。因为三级BLAS运算的粗糙颗粒性(?),使用BLAS会在高性能计算机上有很高的效率,特别是如果制造商提供了特别的BLAS实现。” --LAPACK常见问题
LAPACK routines are written so that as much as possible of the computation is performed by calls to the Basic Linear Algebra Subprograms (BLAS). … LAPACK was designed at the outset to exploit the Level 3 BLAS — a set of specifications for Fortran subprograms that do various types of matrix multiplication and the solution of triangular systems with multiple right-hand sides. Because of the coarse granularity of the Level 3 BLAS operations, their use promotes high efficiency on many high-performance computers, particularly if specially coded implementations are provided by the manufacturer.” --LAPACK FAQ
LAPACK是BLAS的一个超集,它有自己的BLAS实现,以及额外的子程序。它是Linux/x86平台上最流行的两种BLAS实现之一,另一个是Intel Math Kernel Library数学核心裤。
LAPACK is superset of BLAS, it has its own implementation of BLAS, and several extra routines too. It is one of two most popular implementations of BLAS on Linux/x86 platform besides Intel Math Kernel Library.
* 参考:
- 快速安装指南
- LAPACK安装指南
- LAPACK用户指南
* 附录:
开源的科学和工程库:
- uBLAS in Boost
- GNU科学库(GNU Scientific Library)(GSL)
- GSLwrap(C++ wrapper of GSL)