XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ zhetrd()

void zhetrd ( char  uplo,
int  n,
int  lda,
doublecomplex  a[],
double  d[],
double  e[],
doublecomplex  tau[],
doublecomplex  work[],
int  lwork,
int *  info 
)

Reduces a complex Hermitian matrix to tridiagonal form

Purpose
This routine reduces a complex Hermitian matrix A to real symmetric tridiagonal form T by a unitary similarity transformation: Q^H * A * Q = T.
Parameters
[in]uplo= 'U': Upper triangle of A is stored.
= 'L': Lower triangle of A is stored.
[in]nOrder of the matrix A. (n >= 0) (If n = 0, returns without computation)
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, n))
[in,out]a[][]Array a[la][lda] (la >= n)
[in] The Hermitian matrix A. If uplo = 'U', the leading n x 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 x 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.
[out] 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 unitary matrix Q as a product of elementary reflectors; If uplo = 'L', the diagonal and first subdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array tau, represent the unitary matrix Q as a product of elementary reflectors. See Further Details.
[out]d[]Array d[ld] (ld >= n)
The diagonal elements of the tridiagonal matrix T: d[i] = a[i][i].
[out]e[]Array e[le] (le >= n - 1)
The off-diagonal elements of the tridiagonal matrix T: e[i] = a[i+1][i] if uplo = 'U', e[i] = a[i][i+1] if uplo = 'L'.
[out]tau[]Array tau[ltau] (ltau >= n - 1)
The scalar factors of the elementary reflectors (see Further Details).
[out]work[]Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe size of 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, and returns the value in work[0].
[out]info= 0: Successful exit.
= -1: The argument uplo had an illegal value. (uplo != 'U' nor 'L')
= -2: The argument n had an illegal value. (n < 0)
= -3: The argument lda had an illegal value. (lda < max(1, n))
= -9: The argument lwork had an illegal value. (lwork too small)
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^H
where tau is a complex scalar, and v is a complex vector with v(i+1〜n) = 0 and v(i) = 1. v(1〜i-1) is stored on exit in a[i][0〜i-2], and tau in tau[i-1].

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^H
where tau is a complex scalar, and v is a complex vector with v(1〜i) = 0 and v(i+1) = 1; v(i+2〜n) is stored on exit in a[i-1][i+1〜n-1], and tau in tau[i-1].

The contents of a[][] on exit are illustrated by the following examples with n = 5:
if uplo = 'L': if uplo = 'U':
( d e v3 v4 v5 ) ( d )
( d e v4 v5 ) ( e d )
( d e v5 ) ( 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 v defining H(i).
Reference
LAPACK