Reduces a real symmetric matrix to tridiagonal form using packed storage.
FORTRAN 77:
call ssptrd(uplo, n, ap, d, e, tau, info)
call dsptrd(uplo, n, ap, d, e, tau, info)
FORTRAN 95:
call sptrd(ap, tau [,uplo] [,info])
C:
lapack_int LAPACKE_<?>sptrd( int matrix_order, char uplo, lapack_int n, <datatype>* ap, <datatype>* d, <datatype>* e, <datatype>* tau );
The routine reduces a packed real symmetric matrix A to symmetric tridiagonal form T by an orthogonal similarity transformation: A = Q*T*QT. The orthogonal matrix Q is not formed explicitly but is represented as a product of n-1 elementary reflectors. Routines are provided for working with Q in this representation. See Application Notes below for details.
The data types are given for the Fortran interface. A <datatype> placeholder, if present, is used for the C interface data types in the C interface section above. See C Interface Conventions for the C interface principal conventions and type definitions.
CHARACTER*1. Must be 'U' or 'L'.
If uplo = 'U', ap stores the packed upper triangle of A.
If uplo = 'L', ap stores the packed lower triangle of A.
INTEGER. The order of the matrix A (n ≥ 0).
REAL for ssptrd
DOUBLE PRECISION for dsptrd.
Array, DIMENSION at least max(1, n(n+1)/2). Contains either upper or lower triangle of A (as specified by uplo) in the packed form described in "Matrix Arguments" in Appendix "Routine and Function Arguments".
Overwritten by the tridiagonal matrix T and details of the orthogonal matrix Q, as specified by uplo.
REAL for ssptrd
DOUBLE PRECISION for dsptrd.
Arrays:
d(*) contains the diagonal elements of the matrix T.
The dimension of d must be at least max(1, n).
e(*) contains the off-diagonal elements of T.
The dimension of e must be at least max(1, n-1).
tau(*) stores further details of the matrix Q.
The dimension of tau must be at least max(1, n-1).
INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95 Interface Conventions.
Specific details for the routine sptrd interface are the following:
Holds the array A of size (n*(n+1)/2).
Holds the vector with the number of elements n-1.
Must be 'U' or 'L'. The default value is 'U'.
Note that diagonal (d) and off-diagonal (e) elements of the matrix T are omitted because they are kept in the matrix A on exit.
The matrix Q is represented as a product of n-1 elementary reflectors, as follows :
If uplo = 'U', Q = H(n-1) ... H(2)H(1)
Each H(i) has the form
H(i) = I - tau*v*vT for real flavors, or
H(i) = I - tau*v*vH for complex flavors,
where tau is a real/complex scalar, and v is a real/complex vector with v(i+1:n) = 0 and v(i) = 1.
On exit, tau is stored in tau(i), and v(1:i-1) is stored in AP, overwriting A(1:i-1, i+1).
If uplo = 'L', Q = H(1)H(2) ... H(n-1)
Each H(i) has the form
H(i) = I - tau*v*vT for real flavors, or
H(i) = I - tau*v*vH for complex flavors,
where tau is a real/complex scalar, and v is a real/complex vector with v(1:i) = 0 and v(i+1) = 1.
On exit, tau is stored in tau(i), and v(i+2:n) is stored in AP, overwriting A(i+2:n, i).
The computed matrix T is exactly similar to a matrix A+E, where ||E||2 = c(n)*ε*||A||2, c(n) is a modestly increasing function of n, and ε is the machine precision. The approximate number of floating-point operations is (4/3)n3.
After calling this routine, you can call the following:
The complex counterpart of this routine is hptrd.