CIMPL LAPACK Toolbox Documentation CIMPL includes a simplified C++ interface to LAPACK—a very popular fortran library for linear algebra operations—by using Intel optimized version of LAPACK. Parts of the following documentation is adapted from LAPACK User Guide written by Susan Blackford. LAPACK provides two sets of routines: Driver routines—functions that solve a complete problem, e.g. singular value decomposition—and computational routines—functions that solve part of a large problem, e.g. factorization of a matrix. Currently almost all driver routines are implemented. Computational routines are not yet implemented. The following are the implemented functions. Linear Equation Solver: Gesv (general
matrix), Posv (positive definite matrix), Sysv
(symmetric matrix), Hesv (hermitian matrix) Linear Equations Solver Gesv: Solves the system AX = B by factorizing A. It can handle multiple right hand sides (the columns of B). Matrix<float>
Gesv(Matrix<float>& A, Matrix<float>& B); Posv: Solves the system AX = B by factorizing positive definite A. It can handle multiple right hand sides (the columns of B). Matrix<float>
Posv(Matrix<float>& A, Matrix<float>& B); Sysv: Solves the system AX = B by factorizing symmetric matrix A. It can handle multiple right hand sides (the columns of B). Being symmetric is not checked but assumed. Only the upper triangle of the matrix is read and the rest of the values are ignored. Matrix<float>
Sysv(Matrix<float>& A, Matrix<float>& B); Hesv: Solves the system AX = B by factorizing an hermitian matrix A. It can handle multiple right hand sides (the columns of B). Being hermitian is not checked but assumed. Only the upper triangle of the matrix is read and the rest of the values are ignored. Matrix<ComplexFloat>
Hesv(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>&
B); Linear Least Squares Problems Gels: Finds X that minimizes ||b-Ax||. Assumes that the m-by-n matrix A has full rank. Finds a least squares solution of an overdetermined system when m > n, and a minimum norm solution of an underdetermined system when m < n. Gels uses a QR or LQ factorization of A. Gels allows several right hand side vectors b and corresponding solutions x to be handled in a single call, storing these vectors as columns of matrices B and X, respectively. Note however that each right hand side vector is solved independently; this is not the same as finding a matrix X which minimizes ||B-AX||. Matrix<float>
Gels(Matrix<float>& A, Matrix<float>& B); Gelsy: Finds X that minimizes ||b-Ax||. Allows the m-by-n matrix A to be rank deficient. Finds a least squares solution of an overdetermined system when m > n, and a minimum norm solution of an underdetermined system when m < n. If A is rank deficient, we seek the minimum norm least squares solution x which minimizes both ||x|| and ||b - Ax||.Gelsy uses a complete orthogonal factorization of A. Gelsy allows several right hand side vectors b and corresponding solutions x to be handled in a single call, storing these vectors as columns of matrices B and X, respectively. Note however that each right hand side vector is solved independently; this is not the same as finding a matrix X which minimizes ||B-AX||. Matrix<float>
Gelsy(Matrix<float>& A, Matrix<float>& B); Gelss: Finds X that minimizes ||b-Ax||. Allows the m-by-n matrix A to be rank deficient. Finds a least squares solution of an overdetermined system when m > n, and a minimum norm solution of an underdetermined system when m < n. If A is rank deficient, we seek the minimum norm least squares solution x which minimizes both ||x|| and ||b - Ax||.Gelss uses the singular value decomposition of A. Gelss allows several right hand side vectors b and corresponding solutions x to be handled in a single call, storing these vectors as columns of matrices B and X, respectively. Note however that each right hand side vector is solved independently; this is not the same as finding a matrix X which minimizes ||B-AX||. Matrix<float>
Gelss(Matrix<float>& A, Matrix<float>& B); Gelsd: Finds X that minimizes ||b-Ax||. Allows the m-by-n matrix A to be rank deficient. Finds a least squares solution of an overdetermined system when m > n, and a minimum norm solution of an underdetermined system when m < n. If A is rank deficient, we seek the minimum norm least squares solution x which minimizes both ||x|| and ||b - Ax||.Gelsd uses the singular value decomposition (based on divide and conquer ) of A. Gelsd allows several right hand side vectors b and corresponding solutions x to be handled in a single call, storing these vectors as columns of matrices B and X, respectively. Note however that each right hand side vector is solved independently; this is not the same as finding a matrix X which minimizes ||B-AX||. Gelsd is faster than Gelss but may use more memory. Matrix<float>
Gelsd(Matrix<float>& A, Matrix<float>& B); Gglse: This routine solves the linear equality-constrained least squares (LSE) problem that minimizes || c - A x || subject to B x = d, where A is an m-by-n matrix, B is a p-by-n matrix, c is a given m-vector, and d is a given p-vector. It is assumed that p = n = m+p, and rank(B) = p and |A| rank(|B|) = n .These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized RQ factorization of the matrices B and A. Vector<float>
Gglse(Matrix<float>& A, Matrix<float>& B,
Vector<float>& c, Vector<float>& d); Ggglm: This routine solves a general Gauss-Markov linear model (GLM) problem: minimize || y || subject to d = Ax + By where A is an n-by-m matrix, B is an n-by-p matrix, and d is a given n-vector. It is assumed that m <= n <= m+p, and rank(A) = m and rank( A B ) = n . Under these assumptions, the constrained equation is always consistent, and there is a unique solution x and a minimal 2-norm solution y, which is obtained using a generalized QR factorization of A and B. In particular, if matrix B is square nonsingular, then the problem GLM is equivalent to the following weighted linear least squares problem minimize || B^-1 (d-Ax) || . void Ggglm(Matrix<float>&
A, Matrix<float>& B, Vector<float>& d, Vector<float>&
x, Vector<float>& y); Singular Value Decomposition Gesdd: Calculates the singular value decomposition of A: A = U*E*transp(V). Computes all the singular values and (optionally) left (U) and right (V) singular vectors. Uses a divide and conquer approach to create the singular value decomposition. Vector<float>
Gesdd(Matrix<float>& A); Eigen Problems Syevd: This routine computes all the eigenvalues, and optionally all the eigenvectors, of a real symmetric matrix A. In other words, it can compute the spectral factorization of A as: A = Z*E*transp(Z). Here E is a diagonal matrix whose diagonal elements are the eigenvalues ei, and Z is the orthogonal matrix whose columns are the eigenvectors zi. Thus, A*zi = ei*zi for i = 1, 2, ..., n. If the eigenvectors are requested, then this routine uses a divide and conquer algorithm to compute eigenvalues and eigenvectors. However, if only eigenvalues are required, then it uses the Pal-Walker-Kahan variant of the QL or QR algorithm. Being symmetric is not checked but assumed. Only the upper triangle of the matrix A is read and the rest of the values are ignored. Vector<float>
Syevd(Matrix<float>& A); Heevd: This routine computes all the eigenvalues, and optionally all the eigenvectors, of a complex hermitian matrix A. In other words, it can compute the spectral factorization of A as: A = Z*E*hermitian(Z). Here E is a diagonal matrix whose diagonal elements are the eigenvalues ei, and Z is the orthogonal matrix whose columns are the eigenvectors zi. Thus, A*zi = ei*zi for i = 1, 2, ..., n. If the eigenvectors are requested, then this routine uses a divide and conquer algorithm to compute eigenvalues and eigenvectors. However, if only eigenvalues are required, then it uses the Pal-Walker-Kahan variant of the QL or QR algorithm. Being hermitian is not checked but assumed. Only the upper triangle of the matrix A is read and the rest of the values are ignored. Vector<float>
Heevd(Matrix<ComplexFloat>& A); Syevr: This routine computes selected eigenvalues and, optionally, eigenvectors of a real symmetric matrix A. Eigenvalues and eigenvectors can be selected by specifying a range of indices for the desired eigenvalues. Whenever possible, the eigenspectrum is computed using Relatively Robust Representations. Eigenvalues are computed by the dqds algorithm, while orthogonal eigenvectors are computed from various “good'' LDLT representations (also known as Relatively Robust Representations). Gram-Schmidt orthogonalization is avoided as far as possible. Being symmetric is not checked but assumed. Only the upper triangle of the matrix A is read and the rest of the values are ignored. Vector<float>
Syevr(Matrix<float>& A); Heevr: This routine computes selected eigenvalues and, optionally, eigenvectors of a complex hermitian matrix A. Eigenvalues and eigenvectors can be selected by specifying a range of indices for the desired eigenvalues. Whenever possible, the eigenspectrum is computed using Relatively Robust Representations. Eigenvalues are computed by the dqds algorithm, while orthogonal eigenvectors are computed from various “good'' LDLT representations (also known as Relatively Robust Representations). Gram-Schmidt orthogonalization is avoided as far as possible. Being hermitian is not checked but assumed. Only the upper triangle of the matrix A is read and the rest of the values are ignored. Vector<float>
Heevr(Matrix<ComplexFloat>& A); Gees: This routine computes for an n-by-n real/complex nonsymmetric matrix A, the eigenvalues, the real Schur form T, and, optionally, the matrix of Schur vectors Z. This gives the Schur factorization A = Z*T*hermitian(Z). Vector<ComplexFloat>
Gees(Matrix<float>& A, Matrix<float>&
T); Geev: This routine computes for an n-by-n real/complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and right eigenvectors. The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real. Vector<ComplexFloat>
Geev(Matrix<float>& A); Vector<float>
Sygvd(Matrix<float>& A, Matrix<float>&
B, int ptype); Vector<float>
Hegvd(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>&
B, int ptype); void
Gges(Matrix<float>& A, Matrix<float>&
B, Vector<ComplexFloat>& alpha, Vector<float>&
beta, void
Ggev(Matrix<float>& A, Matrix<float>&
B, Vector<ComplexFloat>& alpha, Vector<float>&
beta);
|
||