Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?unmhr

Multiplies an arbitrary complex matrix C by the complex unitary matrix Q determined by ?gehrd.

Syntax

call cunmhr(side, trans, m, n, ilo, ihi, a, lda, tau, c, ldc, work, lwork, info)

call zunmhr(side, trans, m, n, ilo, ihi, a, lda, tau, c, ldc, work, lwork, info)

call unmhr(a, tau, c [,ilo] [,ihi] [,side] [,trans] [,info])

Include Files

  • mkl.fi, lapack.f90

Description

The routine multiplies a matrix C by the unitary matrix Q that has been determined by a preceding call to cgehrd/zgehrd. (The routine ?gehrd reduces a real general matrix A to upper Hessenberg form H by an orthogonal similarity transformation, A = Q*H*QH, and 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.)

With ?unmhr, you can form one of the matrix products Q*C, QH*C, C*Q, or C*QH, overwriting the result on C (which may be any complex rectangular matrix). A common application of this routine is to transform a matrix V of eigenvectors of H to the matrix QV of eigenvectors of A.

Input Parameters

side

CHARACTER*1. Must be 'L' or 'R'.

If side = 'L', then the routine forms Q*C or QH*C.

If side = 'R', then the routine forms C*Q or C*QH.

trans

CHARACTER*1. Must be 'N' or 'C'.

If trans = 'N', then Q is applied to C.

If trans = 'T', then QH is applied to C.

m

INTEGER. The number of rows in C (m 0).

n

INTEGER. The number of columns in C (n 0).

ilo, ihi

INTEGER. These must be the same parameters ilo and ihi, respectively, as supplied to ?gehrd .

If m > 0 and side = 'L', then 1 iloihim.

If m = 0 and side = 'L', then ilo = 1 and ihi = 0.

If n > 0 and side = 'R', then 1 iloihin.

If n = 0 and side = 'R', then ilo =1 and ihi = 0.

a, tau, c, work

COMPLEX for cunmhr

DOUBLE COMPLEX for zunmhr.

Arrays:

a(lda,*) 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, m) if side = 'L' and at least max(1, n) if side = 'R'.

tau(*) contains further details of the elementary reflectors, as returned by ?gehrd.

The dimension of tau must be at least max (1, m-1)

if side = 'L' and at least max (1, n-1) if side = 'R'.

c(ldc,*) contains the m-by-n matrix C.

The second dimension of c must be at least max(1, n).

work is a workspace array, its dimension max(1, lwork).

lda

INTEGER. The leading dimension of a; at least max(1, m) if side = 'L' and at least max (1, n) if side = 'R'.

ldc

INTEGER. The leading dimension of c; at least max(1, m).

lwork

INTEGER. The size of the work array.

If side = 'L', lwork max(1,n).

If side = 'R', lwork max(1,m).

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

c

C is overwritten by Q*C, or QH*C, or C*QH, or C*Q as specified by side and trans.

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.

info

INTEGER.

If info = 0, the execution is successful.

If info = -i, the i-th parameter had an illegal value.

LAPACK 95 Interface Notes

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 LAPACK 95 Interface Conventions.

Specific details for the routine unmhr interface are the following:

a

Holds the matrix A of size (r,r).

r = m if side = 'L'.

r = n if side = 'R'.

tau

Holds the vector of length (r-1).

c

Holds the matrix C of size (m,n).

ilo

Default value for this argument is ilo = 1.

ihi

Default value for this argument is ihi = n.

side

Must be 'L' or 'R'. The default value is 'L'.

trans

Must be 'N' or 'C'. The default value is 'N'.

Application Notes

For better performance, lwork should be at least n*blocksize if side = 'L' and at least m*blocksize if side = 'R', where blocksize is a machine-dependent value (typically, 16 to 64) required for optimum performance of the blocked algorithm.

If it is not clear how much workspace to supply, use a generous value of lwork for the first run, or set lwork = -1.

In first case the routine completes the task, though probably not so fast as with a recommended workspace, and provides the recommended workspace in the first element of the corresponding array work on exit. Use this value (work(1)) for subsequent runs.

If lwork = -1, then the routine returns immediately and provides the recommended workspace in the first element of the corresponding array (work). This operation is called a workspace query.

Note that if lwork is less than the minimal required value and is not equal to -1, then the routine returns immediately with an error exit and does not provide any information on the recommended workspace.

The computed matrix Q differs from the exact result by a matrix E such that ||E||2 = O(ε)*||C||2, where ε is the machine precision.

The approximate number of floating-point operations is

8n(ihi-ilo)2 if side = 'L';

8m(ihi-ilo)2 if side = 'R'.

The real counterpart of this routine is ormhr.