Developer Reference for Intel® oneAPI Math Kernel Library for C
?gehrd
Reduces a general matrix to upper Hessenberg form.
Syntax
lapack_intLAPACKE_sgehrd ( intmatrix_layout , lapack_intn , lapack_intilo , lapack_intihi , float*a , lapack_intlda , float*tau );
lapack_intLAPACKE_dgehrd ( intmatrix_layout , lapack_intn , lapack_intilo , lapack_intihi , double*a , lapack_intlda , double*tau );
lapack_intLAPACKE_cgehrd ( intmatrix_layout , lapack_intn , lapack_intilo , lapack_intihi , lapack_complex_float*a , lapack_intlda , lapack_complex_float*tau );
lapack_intLAPACKE_zgehrd ( intmatrix_layout , lapack_intn , lapack_intilo , lapack_intihi , lapack_complex_double*a , lapack_intlda , lapack_complex_double*tau );
Include Files
mkl.h
Description
sgehrd dgehrd cgehrd zgehrd gehrd
The routine reduces a general matrix A to upper Hessenberg form H by an orthogonal or unitary similarity transformation A = Q*H*Q^{H} . Here H has real subdiagonal elements.
The routine does not form the matrix Q explicitly. Instead, Q is represented as a product of elementary reflectors . Routines are provided to work with Q in this representation.
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 A ( n≥ 0 ).
ilo , ihi
If A is an output by ?gebal , then ilo and ihi must contain the values returned by that routine. Otherwise ilo = 1 and ihi = n . (If n > 0 , then 1 ≤ilo≤ihi≤n ; if n = 0 , ilo = 1 and ihi = 0 .)
- a , work
-
REAL for sgehrd DOUBLE PRECISION for dgehrd COMPLEX for cgehrd DOUBLE COMPLEX for zgehrd . Arrays:
a (size max(1, lda * n )) contains the matrix A .
The second dimension of a must be at least max(1, n ). work ( lwork ) is a workspace array.
lda
The leading dimension of a ; at least max(1, n ).
lwork
The size of the work array; at least max(1, n ).
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
-
The elements on and above the subdiagonal contain the upper Hessenberg matrix H . The subdiagonal elements of H are real. The elements below the subdiagonal, with the array tau , represent the orthogonal matrix Q as a product of n elementary reflectors.
- tau
-
REAL for sgehrd DOUBLE PRECISION for dgehrd COMPLEX for cgehrd DOUBLE COMPLEX for zgehrd . Array, size at least max (1, n -1). Contains scalars that define elementary reflectors for the 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 Hessenberg matrix \(H\) is exactly similar to a nearby matrix \(A + E\) , where \(||E||_{2} < c(n)\varepsilon||A||_{2}, c(n)\) is a modestly increasing function of n , and \(\varepsilon\) is the machine precision.
The approximate number of floating-point operations for real flavors is \((2/3) (ihi - ilo)^{2}(2ihi + 2ilo + 3n)\) ; for complex flavors it is 4 times greater.