Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
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

?ormhr

Multiplies an arbitrary real matrix C by the real orthogonal matrix Q determined by ?gehrd.

Syntax

lapack_int LAPACKE_sormhr (int matrix_layout, char side, char trans, lapack_int m, lapack_int n, lapack_int ilo, lapack_int ihi, const float* a, lapack_int lda, const float* tau, float* c, lapack_int ldc);

lapack_int LAPACKE_dormhr (int matrix_layout, char side, char trans, lapack_int m, lapack_int n, lapack_int ilo, lapack_int ihi, const double* a, lapack_int lda, const double* tau, double* c, lapack_int ldc);

Include Files

  • mkl.h

Description

The routine multiplies a matrix C by the orthogonal matrix Q that has been determined by a preceding call to sgehrd/dgehrd. (The routine ?gehrd reduces a real general matrix A to upper Hessenberg form H by an orthogonal similarity transformation, A = Q*H*QT, and represents the matrix Q as a product of ihi-iloelementary reflectors. Here ilo and ihi are values determined by sgebal/dgebal when balancing the matrix;if the matrix has not been balanced, ilo = 1 and ihi = n.)

With ?ormhr, you can form one of the matrix products Q*C, QT*C, C*Q, or C*QT, overwriting the result on C (which may be any real rectangular matrix).

A common application of ?ormhr is to transform a matrix V of eigenvectors of H to the matrix QV of eigenvectors of A.

Input Parameters

matrix_layout

Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).

side

Must be 'L' or 'R'.

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

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

trans

Must be 'N' or 'T'.

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

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

m

The number of rows in C (m 0).

n

The number of columns in C (n 0).

ilo, ihi

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

Arrays:

a(size max(1,lda*n) for side='R' and size max(1,lda*m) for side='L') contains details of the vectors which define the elementary reflectors, as returned by ?gehrd.

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(size max(1, ldc*n) for column major layout and max(1, ldc*m for row major layout) contains the m by n matrix C.

lda

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

ldc

The leading dimension of c; at least max(1, m) for column major layout and at least max(1, n) for row major layout .

Output Parameters

c

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

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.

Application Notes

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

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

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

The complex counterpart of this routine is unmhr.