STK++ 0.9.13
|
The Algebra project provides structures, tools and methods of the usual algebra techniques. More...
Namespaces | |
namespace | STK::lapack |
namespace enclosing the wrappers of the lapack routines. | |
Classes | |
class | STK::CG< MultFunctor, ColVector, InitFunctor > |
The conjugate gradient method is an algorithm for the numerical solution of particular systems of linear equations, namely those whose matrix is symmetric and positive-definite. More... | |
class | STK::PCG< MultFunctor, CondFunctor, ColVector, InitFunctor > |
In most cases, preconditioning is necessary to ensure fast convergence of the conjugate gradient method. More... | |
class | STK::ILeastSquare< Derived > |
The class ILeastSquare is an interface class for the methods solving the least-square problem. More... | |
class | STK::InvertMatrix< Matrix, Size_ > |
The InvertMatrix class is a functor class allowing to compute the inverse of a symmetric matrix. More... | |
class | STK::IQr< Derived > |
The class IQr is an interface class for the method computing the QR Decomposition of a ArrayXX. More... | |
class | STK::ISvd< Derived > |
Compute the Singular Value Decomposition of an array. More... | |
class | STK::ISymEigen< Derived > |
The class ISymEigen is an interface class for the method computing the eigenvalue Decomposition of a symmetric ArrayXX. More... | |
class | STK::lapack::MultiLeastSquare< ArrayB, ArrayA > |
The class MultiLeastSQquare solve the least square problem when the response b is multidimensional. More... | |
class | STK::MultiLeastSquare< ArrayB, ArrayA > |
The class MultiLeastSQquare solve the least square problem when the response b is multidimensional. More... | |
class | STK::Qr |
The class Qr perform the QR decomposition of an ArrayXX. More... | |
class | STK::Svd< Array > |
The class Svd compute the Singular Value Decomposition of a Array with the Golub-Reinsch Algorithm. More... | |
class | STK::SymEigen< SquareArray > |
The class SymEigen compute the eigenvalue Decomposition of a symmetric ArrayXX. More... | |
class | STK::lapack::Qr |
{ More... | |
class | STK::lapack::Svd |
{ More... | |
class | STK::lapack::SymEigen< SquareArray > |
{ More... | |
Functions | |
template<class Lhs > | |
bool | STK::cholesky (ExprBase< Lhs > const &A, Array2DDiagonal< typename Lhs::Type > &D, Array2DLowerTriangular< typename Lhs::Type > &L) |
Compute the Cholesky decomposition of a symmetric matrix. | |
template<class Type > | |
Real | STK::compGivens (Type const &y, Type const &z, Type &cosinus, Type &sinus) |
Compute Givens rotation. | |
template<class TContainer2D > | |
void | STK::rightGivens (ArrayBase< TContainer2D > &M, int j1, int j2, typename TContainer2D::Type const &cosinus, typename TContainer2D::Type const &sinus) |
Apply Givens rotation. | |
template<class TContainer2D > | |
void | STK::leftGivens (ArrayBase< TContainer2D > &M, int i1, int i2, typename TContainer2D::Type const &cosinus, typename TContainer2D::Type const &sinus) |
left multiplication by a Givens ArrayXX. | |
template<class TContainer2D > | |
void | STK::gramSchmidt (ArrayBase< TContainer2D > &A) |
The gramSchmidt method perform the Gram Schmidt orthonormalization of an Array of Real. | |
template<class Vector > | |
Real | STK::house (ArrayBase< Vector > &x) |
Compute the Householder vector v of a vector x. | |
template<class Lhs , class Rhs > | |
Real | STK::dotHouse (ExprBase< Lhs > const &x, ExprBase< Rhs > const &v) |
dot product with a Householder vector. | |
template<class Lhs , class Rhs > | |
void | STK::applyLeftHouseholderVector (ArrayBase< Lhs > const &M, ExprBase< Rhs > const &v) |
left multiplication by a Householder vector. | |
template<class Lhs , class Rhs > | |
void | STK::applyLeftHouseholderArray (ArrayBase< Lhs > const &M, ArrayBase< Rhs > const &H) |
left multiplication by a Householder array. | |
template<class Lhs , class Rhs > | |
void | STK::applyRightHouseholderVector (ArrayBase< Lhs > const &M, ExprBase< Rhs > const &v) |
right multiplication by a Householder vector. | |
template<class TContainer2D , class Rhs > | |
void | STK::applyRightHouseholderArray (ArrayBase< TContainer2D > const &M, ArrayBase< Rhs > const &H) |
left multiplication by a Householder ArrayXX. | |
template<class Matrix > | |
hidden::AlgebraTraits< InvertMatrix< Matrix, hidden::Traits< Matrix >::sizeRows_ > >::Result | STK::invert (Matrix const &mat) |
Utility function allowing to compute the inverse of a matrix. | |
int | STK::lapack::gelsd (int m, int n, int nrhs, Real *a, int lda, Real *b, int ldb, Real *s, Real *rcond, int *rank, Real *work, int lWork, int *iwork) |
wrapper of the LAPACK GELSD routine: computes the minimum-norm solution to a real linear least squares problem. | |
int | STK::lapack::geqrf (int m, int n, Real *a, int lda, Real *tau, Real *work, int lWork) |
wrapper of the LAPACK DGEQRF routine: computes the Qr decomposition of a matrix. | |
int | STK::lapack::gesdd (char jobz, int m, int n, Real *a, int lda, Real *s, Real *u, int ldu, Real *vt, int ldvt, Real *work, int lWork, int *iWork) |
wrapper of the LAPACK DGESDD routine. | |
int | STK::lapack::syevr (char jobz, char range, char uplo, int n, Real *a, int lda, Real vl, Real vu, int il, int iu, Real abstol, int *m, Real *w, Real *z, int ldz, int *isuppz, Real *work, int lWork, int *iwork, int liwork) |
wrapper of the LAPACK SYEVR routine. | |
template<class TContainer2D > | |
TContainer2D & | STK::transpose (ArrayBase< TContainer2D > &A) |
The transpose method allow to transpose an array in place. | |
void | STK::blas::dgemm (int m, int n, int nrhs, Real *a, int lda, Real *b, int ldb, Real *s, Real *rcond, int *rank, Real *work, int lWork, int *iwork) |
wrapper of the BLAS gemm routine: performs one of the matrix-matrix operations | |
void | STK::blas::dgesv_ (int *n, int *nrhs, double *A, int *lda, int *ipiv, double *B, int *ldb, int *info) |
wrapper of the BLAS gesv routine: | |
The Algebra project provides structures, tools and methods of the usual algebra techniques.
The Algebra project proposes some set of template function for computing dot product, weighted dot product, vector norm, weighted vector norm and so on... It implement also linear algebra methods for the ArrayXX and the ArraySquareX classes:
It proposes also some set of method for performing
left multiplication by a Householder array.
Perform a left multiplication of the Array M by a Householder Matrix H. M
<- HM with H
= I + WZ'. The matrix H
is represented as a product of elementary reflectors H = H(1) H(2) . . . H(k)
M | the matrix to multiply |
H | the matrix with the Householder vectors |
Definition at line 142 of file STK_Householder.h.
References STK::applyLeftHouseholderVector().
Referenced by main().
left multiplication by a Householder vector.
Perform a left multiplication of the matrix M with a Householder matrix
M | the matrix to multiply (input/output) |
v | the Householder vector (input) |
Definition at line 109 of file STK_Householder.h.
References STK::dotHouse().
Referenced by STK::applyLeftHouseholderArray(), STK::bidiag(), STK::IQr< Derived >::compQ(), and STK::Qr::qr().
void STK::applyRightHouseholderArray | ( | ArrayBase< TContainer2D > const & | M, |
ArrayBase< Rhs > const & | H | ||
) |
left multiplication by a Householder ArrayXX.
Perform a right multiplication of the matrix M with a Householder Marix H. M <- MP with H = I + WZ'. The Householder vectors are stored in the rows of H.
M | the Array to multiply |
H | the Householder ArrayXX |
Definition at line 202 of file STK_Householder.h.
References STK::applyRightHouseholderVector().
right multiplication by a Householder vector.
Perform a right multiplication of the matrix M with a Householder matrix
M | the matrix to multiply (input/output) |
v | the Householder vector (input) |
Definition at line 170 of file STK_Householder.h.
References STK::dotHouse().
Referenced by STK::applyRightHouseholderArray(), and STK::bidiag().
bool STK::cholesky | ( | ExprBase< Lhs > const & | A, |
Array2DDiagonal< typename Lhs::Type > & | D, | ||
Array2DLowerTriangular< typename Lhs::Type > & | L | ||
) |
Compute the Cholesky decomposition of a symmetric matrix.
Compute a closely related variant of the classical Cholesky decomposition, the LDL decomposition
A | the square and symmetric matrix to decompose, only the lower part is used |
D | diagonal matrix of the decomposition |
L | lower triangular matrix of the decomposition |
true
if no error, false
otherwise (results are misleading) Definition at line 63 of file STK_Cholesky.h.
References STK::cholesky(), and STKRUNTIME_ERROR_NO_ARG.
Referenced by STK::cholesky(), and main().
Real STK::compGivens | ( | Type const & | y, |
Type const & | z, | ||
Type & | cosinus, | ||
Type & | sinus | ||
) |
Compute Givens rotation.
Compute the Givens rotation
in order to eliminate the coefficient z and return the value r of the rotated element.
y | The coefficient to rotate (input) |
z | the coefficient to eliminate (input) |
cosinus | the cosinus of the Givens rotation (output) |
sinus | the sinus of the Givens rotation rotation (output) |
Definition at line 75 of file STK_Givens.h.
References STK::sign().
Referenced by STK::IQr< Derived >::eraseCol(), STK::IQr< Derived >::insertCol(), and STK::IQr< Derived >::pushBackCol().
|
inline |
wrapper of the BLAS gemm routine: performs one of the matrix-matrix operations
C := alpha*op( A )*op( B ) + beta*C, where op( X ) is one of op( X ) = X or op( X ) = X**T, @verbatim alpha and beta are scalars, and A, B and C are matrices, with op( A ) an m by k matrix, op( B ) a k by n matrix and C an m by n matrix.
[in] | TRANSA | CHARACTER*1 On entry, TRANSA specifies the form of op( A ) to be used in the matrix multiplication as follows: TRANSA = 'N' or 'n', op( A ) = A. TRANSA = 'T' or 't', op( A ) = A**T. TRANSA = 'C' or 'c', op( A ) = A**T. |
[in] | TRANSB | Char[0] On entry, TRANSB specifies the form of op( B ) to be used in the matrix multiplication as follows: TRANSB = 'N' or 'n', op( B ) = B. TRANSB = 'T' or 't', op( B ) = B**T. TRANSB = 'C' or 'c', op( B ) = B**T. |
[in] | M | int On entry, M specifies the number of rows of the matrix op( A ) and of the matrix C. M must be at least zero. |
[in] | N | int On entry, N specifies the number of columns of the matrix op( B ) and the number of columns of the matrix C. N must be at least zero. |
[in] | K | int On entry, K specifies the number of columns of the matrix op( A ) and the number of rows of the matrix op( B ). K must be at least zero. |
[in] | ALPHA | Real. On entry, ALPHA specifies the scalar alpha. |
[in] | A | a Real array of dimension (LDA, ka), where ka is k when TRANSA = 'N' or 'n', and is m otherwise. Before entry with TRANSA = 'N' or 'n', the leading m by k part of the array A must contain the matrix A, otherwise the leading k by m part of the array A must contain the matrix A. |
[in] | LDA | int On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANSA = 'N' or 'n' then LDA must be at least max( 1, m ), otherwise LDA must be at least max( 1, k ). |
[in] | B | Real array of dimension (LDB, kb), where kb is n when TRANSB = 'N' or 'n', and is k otherwise. Before entry with TRANSB = 'N' or 'n', the leading k by n part of the array B must contain the matrix B, otherwise the leading n by k part of the array B must contain the matrix B. |
[in] | LDB | INTEGER On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANSB = 'N' or 'n' then LDB must be at least max( 1, k ), otherwise LDB must be at least max( 1, n ). |
[in] | BETA | DOUBLE PRECISION. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then C need not be set on input. |
[in,out] | C | Real array of dimension (LDC, N) Before entry, the leading m by n part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the array C is overwritten by the m by n matrix ( alpha*op( A )*op( B ) + beta*C ). |
[in] | LDC | int On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, m ). |
Definition at line 148 of file STK_blas_util.h.
void STK::blas::dgesv_ | ( | int * | n, |
int * | nrhs, | ||
double * | A, | ||
int * | lda, | ||
int * | ipiv, | ||
double * | B, | ||
int * | ldb, | ||
int * | info | ||
) |
wrapper of the BLAS gesv routine:
dot product with a Householder vector.
Scalar product of an 1D container with a Householder vector d = < x,v>. The first componant of a Householder vector is 1.0
x | first vector |
v | the Householder vector |
Definition at line 90 of file STK_Householder.h.
References STK::sum().
Referenced by STK::applyLeftHouseholderVector(), and STK::applyRightHouseholderVector().
|
inline |
wrapper of the LAPACK GELSD routine: computes the minimum-norm solution to a real linear least squares problem.
GELSD computes the minimum-norm solution to a real linear least squares problem: minimize 2-norm(| b - A*x |) using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.
[in] | m | The number of rows of A. m >= 0 . |
[in] | n | The number of columns of A. n>= 0 . |
[in] | nrhs | The number of right hand sides, i.e., the number of columns of the matrices B and X. nrhs >= 0. |
[in] | a | On entry, the M-by-N matrix A. On exit, A has been destroyed. |
[in] | lda | The leading dimension of the array A. lda >= max(1,m). |
[in,out] | b | On entry, the M-by-NRHS right hand side matrix B. * On exit, B is overwritten by the N-by-NRHS solution matrix X. * If m >= n and RANK = n, the residual sum-of-squares for the solution in * the i-th column is given by the sum of squares of elements n+1:m in that * column. * |
[in] | ldb | The leading dimension of the array B. ldb >= max(1,max(m,n)) . |
[out] | s | The singular values of A in decreasing order. * The condition number of A in the 2-norm = s(1)/s(min(m,n)). * |
[out] | rcond | used to determine the effective rank of A. * Singular values s(i) <= RCOND*s(1) are treated as zero. * If RCOND < 0, machine precision is used instead. * |
[out] | rank | The effective rank of A, i.e., the number of singular values which are greater than RCOND*S(1). |
[out] | work | On exit, if info = 0, work(1) returns the optimal lWork. |
[in] | lWork | The dimension of the array work . lWork must be at least 1. * The exact minimum amount of workspace needed depends on M, N and NRHS. * As long as lWork is at least 12*N + 2*N*SMLSIZ + 8*N*NLVL + N*NRHS + (SMLSIZ+1)**2, * if M is greater than or equal to N or 12*M + 2*M*SMLSIZ + 8*M*NLVL + M*NRHS + (SMLSIZ+1)**2, * if M is less than N, the code will execute correctly. * SMLSIZ is returned by ILAENV and is equal to the maximum size of * the subproblems at the bottom of the computation tree (usually about 25), * and NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 ) * For good performance, lWork should generally be larger. * If lWork = -1, then a workspace query is assumed; the routine only * calculates the optimal size of the work array, returns this value as the * first entry of the work array, and no error message related to lWork is * issued by XERBLA. * |
iwork | array of integer of dimension (MAX(1,LiWork)) * LiWork >= 3 * MINMN * NLVL + 11 * MINMN, where MINMN = MIN( M,N ). * On exit, if info = 0, iWork(1) returns the minimum LiWork * |
* = 0: successful exit * < 0: if info = -i, the i-th argument had an illegal value. * > 0: the algorithm for computing the SVD failed to converge; * if info = i, i off-diagonal elements of an intermediate bidiagonal * form did not converge to zero. *
* Further Details * =============== * Based on contributions by * Ming Gu and Ren-Cang Li, Computer Science Division, University of * California at Berkeley, USA * Osni Marques, LBNL/NERSC, USA *
Definition at line 171 of file STK_lapack_Util.h.
Referenced by STK::lapack::MultiLeastSquare< ArrayB, ArrayA >::computeLS().
|
inline |
wrapper of the LAPACK DGEQRF routine: computes the Qr decomposition of a matrix.
[in] | m | The number of rows of the matrix A. M >= 0. |
[in] | n | The number of columns of the matrix A. N >= 0. |
[in,out] | a | Real array, dimension (lda, N) * On entry, the M-by-N matrix A. * On exit, the elements on and above the diagonal of the array * contain the min(M,N)-by-N upper trapezoidal matrix R (R is * upper triangular if m >= n); the elements below the diagonal, * with the array TAU, represent the orthogonal matrix Q as a * product of min(m,n) elementary reflectors (see Further Details). * |
[in] | lda | The leading dimension of the array A. lda >= max(1,M). |
[out] | tau | Real array, dimension min(M,N) The scalar factors of the elementary reflectors (see Further Details). |
[in,out] | work | Real array, dimension (MAX(1,lWork)) * On exit, if info = 0, work(1) returns the optimal lWork. * |
[in] | lWork | The dimension of the array work * lWork >= max(1,N). * For optimum performance lWork >= N*NB, where NB is the optimal blocksize. * * If lWork = -1, then a workspace query is assumed; the routine * only calculates the optimal size of the work array, returns * this value as the first entry of the work array, and no error * message related to lWork is issued by XERBLA. * |
* = 0: successful exit * < 0: if info = -i, the i-th argument had an illegal value *
* Further Details * =============== * * The matrix Q is represented as a product of elementary reflectors * * Q = H(1) H(2) . . . H(k), where k = min(m,n). * * Each H(i) has the form * * H(i) = I - tau * v * v' * * where tau is a real scalar, and v is a real vector with * v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), * and tau in TAU(i). *
Definition at line 250 of file STK_lapack_Util.h.
Referenced by STK::lapack::Qr::computeQr().
|
inline |
wrapper of the LAPACK DGESDD routine.
DGESDD computes the Svd decomposition of a matrix.
* DGESDD computes the singular value decomposition (SVD) of a real * m-by-n matrix a, optionally computing the left and right singular * vectors. If singular vectors are desired, it uses a * divide-and-conquer algorithm. * * The SVD is written * * a = u * SIGMA * transpose(v) * * where SIGMA is an m-by-n matrix which is zero except for its * min(m,n) diagonal elements, u is an m-by-m orthogonal matrix, and * v is an n-by-n orthogonal matrix. The diagonal elements of SIGMA * are the singular values of a; they are real and non-negative, and * are returned in descending order. The first min(m,n) columns of * u and v are the left and right singular vectors of a. *
[in] | jobz | * jobz is Char*1 * Specifies options for computing all or part of the matrix u: * = 'A': all m columns of u and all n rows of v**T are * returned in the arrays u and vt; * = 'S': the first min(m,n) columns of u and the first * min(m,n) rows of v**T are returned in the arrays U * and vt; * = 'O': If m >= n, the first n columns of u are overwritten * on the array a and all rows of v**T are returned in * the array vt; * otherwise, all columns of u are returned in the * array u and the first m rows of v**T are overwritten * in the array a; * = 'N': no columns of u or rows of v**T are computed. * |
[in] | m | * m is Integer * The number of rows of the input matrix a. m >= 0. * |
[in] | n | * n is Integer * The number of columns of the input matrix a. n >= 0. * |
[in,out] | a | * a is STK::Real array, dimension (lda,n) * On entry, the m-by-n matrix a. * On exit, * if jobz = 'O', a is overwritten with the first n columns * of u (the left singular vectors, stored * columnwise) if m >= n; * a is overwritten with the first m rows * of v**T (the right singular vectors, stored * rowwise) otherwise. * if jobz .ne. 'O', the contents of a are destroyed. * |
[in] | lda | * lda is Integer * The leading dimension of the array a. lda >= max(1,m). * |
[out] | s | * s is STK::Real array, dimension (min(m,n)) * The singular values of a, sorted so that s[i] >= s[i+1]. * |
[out] | u | * u is STK::Real array, dimension (ldu,ucol) * ucol = m if jobz = 'A' or jobz = 'O' and m < n; * ucol = min(m,n) if jobz = 'S'. * If jobz = 'A' or jobz = 'O' and m < n, u contains the m-by-m * orthogonal matrix u; * if jobz = 'S', u contains the first min(m,n) columns of u * (the left singular vectors, stored columnwise); * if jobz = 'O' and m >= n, or jobz = 'N', u is not referenced. * |
[in] | ldu | * ldu is Integer * The leading dimension of the array U. ldu >= 1; if * jobz = 'S' or 'A' or jobz = 'O' and m < n, ldu >= m. * |
[out] | vt | * vt is STK::Real array, dimension (ldvt,n) * If jobz = 'A' or jobz = 'O' and m >= n, vt contains the * N-by-N orthogonal matrix v**T; * if jobz = 'S', vt contains the first min(m,n) rows of * v**T (the right singular vectors, stored rowwise); * if jobz = 'O' and m < n, or jobz = 'N', vt is not referenced. * |
[in] | ldvt | * ldvt is Integer * The leading dimension of the array vt. ldvt >= 1; if * jobz = 'A' or jobz = 'O' and m >= n, ldvt >= n; * if jobz = 'S', ldvt >= min(m,n). * |
[out] | work | * work is STK::Real array, dimension (MAX(1,lWork)) * On exit, if info = 0, work(1) returns the optimal lWork; * |
[in] | lWork | * lWork is Integer * The dimension of the array work. lWork >= 1. * If jobz = 'N', * lWork >= 3*min(m,n) + max(max(m,n),7*min(m,n)). * If jobz = 'O', * lWork >= 3*min(m,n) + * max(max(m,n),5*min(m,n)*min(m,n)+4*min(m,n)). * If jobz = 'S' or 'A' * lWork >= min(m,n)*(6+4*min(m,n))+max(m,n) * For good performance, lWork should generally be larger. * If lWork = -1 but other input arguments are legal, work(1) * returns the optimal lWork. * |
[out] | iWork | * iWork is Integer array, dimension (8*min(m,n)) * |
* info is Integer * = 0: successful exit. * < 0: if info = -i, the i-th argument had an illegal value. * > 0: DBDSDC did not converge, updating process failed. *
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA
Definition at line 436 of file STK_lapack_Util.h.
Referenced by STK::lapack::Svd::computeSvd().
void STK::gramSchmidt | ( | ArrayBase< TContainer2D > & | A | ) |
The gramSchmidt method perform the Gram Schmidt orthonormalization of an Array of Real.
A | the container to orthnormalize |
Definition at line 52 of file STK_GramSchmidt.h.
References STK::dot(), and STK::norm().
Referenced by STK::LinearAAModel< Array >::simul().
Compute the Householder vector v of a vector x.
Given a vector x, compute the vector v of the matrix of Householder
x | the vector to rotate, it is overwritten by v |
Definition at line 56 of file STK_Householder.h.
References _R, and STK::sign().
Referenced by STK::bidiag(), STK::Qr::qr(), and STK::SymEigen< SquareArray >::tridiagonalize().
hidden::AlgebraTraits< InvertMatrix< Matrix, hidden::Traits< Matrix >::sizeRows_ > >::Result STK::invert | ( | Matrix const & | mat | ) |
Utility function allowing to compute the inverse of a matrix.
Definition at line 197 of file STK_InvertMatrix.h.
Referenced by main(), STK::BSplineRegression< YArray, XVector, Weights >::regressionStep(), STK::MultidimRegression< Array, Weight >::regressionStep(), STK::MultidimRegression< Array, Weight >::regressionStep(), and STK::BSplineRegression< YArray, XVector, Weights >::regressionStep().
void STK::leftGivens | ( | ArrayBase< TContainer2D > & | M, |
int | i1, | ||
int | i2, | ||
typename TContainer2D::Type const & | cosinus, | ||
typename TContainer2D::Type const & | sinus | ||
) |
left multiplication by a Givens ArrayXX.
Perform a left multiplication of the matrix M with a Givens ArrayXX on the row1 and row2. row1 should be less than row2. The Array M is passed as const as we are using reference on the two rows we want to rotate.
M | the matix to multiply |
i1,i2 | the first and second rows |
cosinus,sinus | the cosinus and sinus of the givens rotation |
Definition at line 148 of file STK_Givens.h.
Referenced by STK::IQr< Derived >::eraseCol(), and STK::IQr< Derived >::insertCol().
void STK::rightGivens | ( | ArrayBase< TContainer2D > & | M, |
int | j1, | ||
int | j2, | ||
typename TContainer2D::Type const & | cosinus, | ||
typename TContainer2D::Type const & | sinus | ||
) |
Apply Givens rotation.
Perform a right multiplication of the Container M with a Givens Array on the col1 and col2. col1 should be less than col2. The Array M is passed as const as we are using reference on the two cols we want to rotate.
M | the Container to multiply |
j1,j2 | the first and second columns |
cosinus,sinus | the cosinus and sinus of the givens rotation |
Definition at line 119 of file STK_Givens.h.
Referenced by STK::Svd< Array >::diag(), STK::SymEigen< SquareArray >::diagonalize(), STK::IQr< Derived >::eraseCol(), STK::IQr< Derived >::insertCol(), STK::leftEliminate(), STK::IQr< Derived >::pushBackCol(), and STK::Svd< Array >::rightEliminate().
|
inline |
wrapper of the LAPACK SYEVR routine.
SYEVR computes the eigenvalues of a symmetric square matrix.
[in] | jobz | * CHARACTER*1 * = 'N': Compute eigenvalues only; * = 'V': Compute eigenvalues and eigenvectors. * |
[in] | range | * CHARACTER*1 * = 'A': all eigenvalues will be found. * = 'V': all eigenvalues in the half-open interval (VL_,VU_] will be found. * = 'I': the IL_-th through IU_-th eigenvalues will be found. * |
[in] | uplo | * CHARACTER*1 * = 'U': Upper triangle of A is stored; * = 'L': Lower triangle of A is stored. * |
[in] | n | The order of the matrix A. N >= 0. |
[in,out] | a | Real array, dimension (lda, N) * On entry, the symmetric matrix A. If UPLO_ = 'U', the leading * N-by-N upper triangular part of A contains the upper triangular part * of the matrix A. If UPLO_ = 'L', the leading N-by-N lower triangular * part of A contains the lower triangular part of the matrix A. On * exit, the lower triangle (if UPLO_='L') or the upper triangle * (if UPLO_='U') of A, including the diagonal, is destroyed. * |
[in] | lda | The leading dimension of the array A. lda >= max(1,N). |
[in] | vl,vu | * Real If RANGE_='V', the lower and upper bounds * of the interval to be searched for eigenvalues. VL_ < VU_. Not * referenced if RANGE_ = 'A' or 'I'. * |
[in] | il,iu | * Integer If RANGE_='I', the indices (in ascending order) * of the smallest and largest eigenvalues to be returned. * 1 <= IL_ <= IU_ <= NL, if NL > 0; IL_ = 1 and IU_ = 0 if NL = 0. Not * referenced if RANGE_ = 'A' or 'V'. * |
[in] | abstol | * The absolute error tolerance for the eigenvalues. An approximate * eigenvalue is accepted as converged when it is determined * to lie in an interval [a,b] of width less than or equal to * ABSTOL + EPS * max( |a|,|b| ) , * where EPS is the machine precision. If ABSTOL is less than or * equal to zero, then EPS*|T| will be used in its place, where * |T| is the 1-norm of the tridiagonal matrix obtained by reducing A * to tridiagonal form. * If high relative accuracy is important, set ABSTOL to SLAMCH( * 'Safe minimum' ). Doing so will guarantee that eigenvalues are * computed to high relative accuracy when possible in future * releases. The current code does not make any guarantees about * high relative accuracy, but future releases will. See J. Barlow * and J. Demmel, "Computing Accurate Eigensystems of Scaled Diagonally * Dominant Matrices", LAPACK Working Note #7, for a discussion of * which matrices define their eigenvalues to high relative accuracy. * |
[out] | m | * The total number of eigenvalues found. 0 <= M <= NL. If RANGE_ * = 'A', M = NL, and if RANGE_ = 'I', M = IU_-IL_+1. * |
[out] | w | * array, dimension (NL) * The first M elements contain the selected eigenvalues in * ascending order. * |
[out] | z | * array, dimension (LDZ, max(1,M)) * If jobz_ = 'V', then if info = 0, the first M columns of Z contain * the orthonormal eigenvectors of the matrix A corresponding * to the selected eigenvalues, with the i-th column of Z holding * the eigenvector associated with W(i). If jobz_ = 'N', then Z is * not referenced. Note: the user must ensure that at least * max(1,M) columns are supplied in the array Z; if RANGE_ = 'V', * the exact value of M is not known in advance and an upper bound * must be used. Supplying N columns is always safe. * |
[in] | ldz | * The leading dimension of the array Z. LDZ >= 1, and if jobz_ = * 'V', LDZ >= max(1,N). * |
[out] | isuppz | array, dimension ( 2*max(1,M) ) * The support of the eigenvectors in Z, i.e., the indices indicating * the nonzero elements in Z. The i-th eigenvector is * nonzero only in elements ISUPPZ( 2*i-1 ) through ISUPPZ( 2*i ). * |
[in,out] | work | Real array, dimension (MAX(1,lWork)) * On exit, if info = 0, work(1) returns the optimal lWork. * |
[in] | lWork | The dimension of the array work * lWork >= max(1,26*N). For optimal efficiency, lWork >= (NB+6)*N, where * NB is the max of the blocksize for SSYTRD and SORMTR returned by ILAENV. * If lWork = -1, then a workspace query is assumed; the routine only * calculates the optimal sizes of the work and iWork arrays, * returns these values as the first entries of the work and iWork * arrays, and no error message related to lWork or LiWork is * issued by XERBLA. * |
[in,out] | iwork | array, dimension (MAX(1,LiWork)) * On exit, if info = 0, iWork(1) returns the optimal lWork. * |
[in] | liwork | The dimension of the array iWork. * LiWork >= max(1,10*N). If LiWork = -1, then a workspace query is * assumed; the routine only calculates the optimal sizes of the work and * iWork arrays, returns these values as the first entries of the work and * iWork arrays, and no error message related to lWork or LiWork is * issued by XERBLA. * |
* = 0: successful exit * < 0: if info = -i, the i-th argument had an illegal value * > 0: Internal error *
Definition at line 606 of file STK_lapack_Util.h.
Referenced by STK::lapack::SymEigen< SquareArray >::runImpl().
TContainer2D & STK::transpose | ( | ArrayBase< TContainer2D > & | A | ) |
The transpose method allow to transpose an array in place.
A | the container to transpose |
Definition at line 51 of file STK_transpose.h.
Referenced by STK::lapack::Svd::runImpl().