-
template<typename T>
void sytrd(char *uplo, integer *n, T *a, integer *lda, T *d, T *e, T *tau, T *work, integer *lwork, integer *info)# Reduction of a real symmetric matrix a to real symmetric tridiagonal form.
Purpose:
Reduction of a real symmetric matrix a to real symmetric tridiagonal form T by an orthogonal similarity transformation: Q**T * A * Q = T.
Further Details
If uplo = 'U', the matrix Q is represented as a product of elementary reflectors Q = H(n-1) . . . H(2) H(1). Each H(i) has the form H(i) = I - tau * V * V**T where tau is a real scalar, and V is a real vector with V(i+1:n) = 0 and V(i) = 1; V(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in tau(i). If uplo = 'L', the matrix Q is represented as a product of elementary reflectors Q = H(1) H(2) . . . H(n-1). Each H(i) has the form H(i) = I - tau * V * V**T where tau is a real scalar, and V is a real vector with V(1:i) = 0 and V(i+1) = 1; V(i+2:n) is stored on exit in A(i+2:n,i), and tau in tau(i). The contents of A on exit are illustrated by the following examples with n = 5: if uplo = 'U': if uplo = 'L': ( d e v2 v3 v4) ( d ) ( d e v3 v4) ( e d ) ( d e v4) ( v1 e d) ( d e ) ( v1 v2 e d ) ( d ) ( v1 v2 v3 e d ) where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i).
- Parameters:
uplo – [in]
uplo is char*
= ‘U’: Upper triangle of a is stored;
= ‘L’: Lower triangle of a is stored.n – [in]
n is integer*
The order of the matrix a. n >= 0.
a – [inout]
a is float/double 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, and the strictly lower triangular part of a is not referenced.
If uplo = ‘L’, the leading n-by-n lower triangular part of a contains the lower triangular part of the matrix a, and the strictly upper triangular part of a is not referenced.
On exit, if uplo = ‘U’, the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the array tau, represent the orthogonal matrix Q as a product of elementary reflectors;
if uplo = ‘L’, the diagonal and first subdiagonal of A are over- written by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array tau, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details.
lda – [in]
lda is integer*
The leading dimension of the array a. lda >= fla_max(1,n).
d – [out]
d is float/double array, dimension (n)
The diagonal elements of the tridiagonal matrix T: D(i) = A(i,i).
e – [out]
e is float/double array, dimension (n-1)
The off-diagonal elements of the tridiagonal matrix T:
E(i) = A(i,i+1) if uplo = ‘U’, E(i) = A(i+1,i) if uplo = ‘L’.tau – [out]
tau is float/double array, dimension (n-1)
The scalar factors of the elementary reflectors (see Further Details).
WORK – [out]
WORK is REAL array, dimension (MAX(1,LWORK))
On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK. LWORK >= 1.
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.
INFO – [out]
INFO is INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value