Developer Reference for Intel® oneAPI Math Kernel Library for C
?unghr
Generates the complex unitary matrix Q determined by ?gehrd .
Syntax
lapack_intLAPACKE_cunghr ( intmatrix_layout , lapack_intn , lapack_intilo , lapack_intihi , lapack_complex_float*a , lapack_intlda , constlapack_complex_float*tau );
lapack_intLAPACKE_zunghr ( intmatrix_layout , lapack_intn , lapack_intilo , lapack_intihi , lapack_complex_double*a , lapack_intlda , constlapack_complex_double*tau );
Include Files
mkl.h
Description
cunghr zunghr unghr
The routine is intended to be used following a call to cgehrd / zgehrd , which reduces a complex matrix A to upper Hessenberg form H by a unitary similarity transformation: A = Q*H*Q^{H} . ?gehrd represents the matrix Q as a product of ihi - ilo elementary reflectors . Here ilo and ihi are values determined by cgebal / zgebal when balancing the matrix; if the matrix has not been balanced, ilo = 1 and ihi = n .
Use the routine unghr to generate Q explicitly as a square matrix. The matrix Q has the structure:
where Q22 occupies rows and columns ilo to ihi .
Input Parameters
- matrix_layout
-
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
n
The order of the matrix Q ( n≥ 0 ).
ilo , ihi
These must be the same parameters ilo and ihi , respectively, as supplied to ?gehrd . (If n > 0 , then 1 ≤ilo≤ihi≤n . If n = 0, then ilo = 1 and ihi = 0 .)
- a , tau , work
-
COMPLEX for cunghr DOUBLE COMPLEX for zunghr . Arrays:
a (size max(1, lda * n )) contains details of the vectors which define the elementary reflectors , as returned by ?gehrd .
The second dimension of a must be at least max(1, n ).
tau contains further details of the elementary reflectors , as returned by ?gehrd .
The dimension of tau must be at least max (1, n -1). work is a workspace array, its dimension max(1, lwork) .
lda
The leading dimension of a ; at least max(1, n ).
lwork
The size of the work array;
lwork ≥ max(1, ihi - ilo ). 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 . See Application Notes for the suggested value of lwork .
Output Parameters
- a
-
Overwritten by the n -by- n unitary matrix Q .
- work(1)
-
If info = 0 , on exit work(1) contains the minimum value of lwork required for optimum performance. Use this lwork for subsequent runs.
Return Values
This function returns a value info .
If info=0 , the execution is successful.
If info = -i , the i -th parameter had an illegal value.
LAPACK 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.
Application Notes
The computed matrix \(Q\) differs from the exact result by a matrix \(E\) such that \(||E||_{2} = O(\varepsilon)\) , where \(\varepsilon\) is the machine precision.
The approximate number of real floating-point operations is \((16/3)(ihi-ilo)^{3}\) .
The real counterpart of this routine is orghr .