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

◆ zgehrd()

void zgehrd ( int  n,
int  ilo,
int  ihi,
int  lda,
doublecomplex  a[],
doublecomplex  tau[],
doublecomplex  work[],
int  lwork,
int *  info 
)

Reduces a complex general matrix to upper Hessenberg form

Purpose
This routine reduces a complex general matrix A to upper Hessenberg form H by an unitary similarity transformation: Q^H * A * Q = H.
Parameters
[in]nOrder of the matrix A. (n >= 0) (If n = 0, returns without computation)
[in]ilo
[in]ihiIt is assumed that A is already upper triangular in rows and columns 1〜ilo-1 and ihi+1〜n. ilo and ihi are normally set by a previous call to zgebal. Otherwise they should be set to 1 and n respectively. See Further Details. (1 <= ilo <= ihi <= n, if n > 0. ilo = 1 and ihi = 0, if n = 0)
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, n))
[in,out]a[][]Array a[la][lda] (la >= n)
[in] n x n general matrix to be reduced.
[out] The upper triangle and the first subdiagonal of a[][] are overwritten with the upper Hessenberg matrix H, 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]tau[]Array tau[ltau] (ltau >= n - 1) The scalar factors of the elementary reflectors (see Further Details). Elements 1〜ilo-1 and ihi〜n-1 of tau are set to zero.
[out]work[]Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe dimension of the array work[]. (lwork >= max(1, n))
For good performance, lwork must generally be larger.
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 n had an illegal value (n < 0)
= -2: The argument ilo had an illegal value (ilo < 1 or ilo > n)
= -3: The argument ihi had an illegal value (ihi < min(ilo, n) or ihi > n)
= -4: The argument lda had an illegal value (lda < max(1, n))
= -8: The argument lwork had an illegal value (lwork too small)
Further Details
The matrix Q is represented as a product of (ihi-ilo) elementary reflectors
Q = H(ilo) H(ilo+1) . . . H(ihi-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, v(i+1) = 1 and v(ihi+1〜n) = 0, v(i+2〜ihi) is stored on exit in A(i+2〜ihi, i), and tau in tau[i - 1].

The contents of A are illustrated by the following example, with n = 7, ilo = 2 and ihi = 6:
on entry, on exit,
( a a a a a a a ) ( a a h h h h a )
( a a a a a a ) ( a h h h h a )
( a a a a a a ) ( h h h h h h )
( a a a a a a ) ( v2 h h h h h )
( a a a a a a ) ( v2 v3 h h h h )
( a a a a a a ) ( v2 v3 v4 h h h )
( a ) ( a )
where a denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This routine is a slight modification of LAPACK-3.0's ZGEHRD subroutine incorporating improvements proposed by Quintana-Orti and Van de Geijn (2006). (See ZLAHR2.)
Reference
LAPACK