Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 3/31/2023
Public

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

Document Table of Contents

p?gehrd

Reduces a general matrix to upper Hessenberg form.

Syntax

call psgehrd(n, ilo, ihi, a, ia, ja, desca, tau, work, lwork, info)

call pdgehrd(n, ilo, ihi, a, ia, ja, desca, tau, work, lwork, info)

call pcgehrd(n, ilo, ihi, a, ia, ja, desca, tau, work, lwork, info)

call pzgehrd(n, ilo, ihi, a, ia, ja, desca, tau, work, lwork, info)

Include Files

Description

The p?gehrd routine reduces a real/complex general distributed matrix sub(A) to upper Hessenberg form H by an orthogonal or unitary similarity transformation

Q'*sub(A)*Q = H,

where sub(A) = A(ia:ia+n-1, ja:ja+n-1).

Input Parameters
n

(global)INTEGER. The order of the distributed matrix sub(A) (n0).

ilo, ihi

(global)INTEGER.

It is assumed that sub(A) is already upper triangular in rows ia:ia+ilo-2 and ia+ihi:ia+n-1 and columns ja:ja+ilo-2 and ja+ihi:ja+n-1. (See Application Notes below).

If n > 0, 1≤iloihin; otherwise set ilo = 1, ihi = n.

a

(local) REAL for psgehrd

DOUBLE PRECISION for pdgehrd

COMPLEX for pcgehrd

DOUBLE COMPLEX for pzgehrd.

Pointer into the local memory to an array of size (lld_a,LOCc(ja+n-1)). On entry, this array contains the local pieces of the n-by-n general distributed matrix sub(A) to be reduced.

ia, ja

(global) INTEGER. The row and column indices in the global matrix A indicating the first row and the first column of the submatrix A, respectively.

desca

(global and local) INTEGER array of size dlen_. The array descriptor for the distributed matrix A.

work

(local)

REAL for psgehrd

DOUBLE PRECISION for pdgehrd

COMPLEX for pcgehrd

DOUBLE COMPLEX for pzgehrd.

Workspace array of size lwork.

lwork

(local or global) INTEGER, size of the array work. lwork is local input and must be at least

lworkNB*NB + NB*max(ihip+1, ihlp+inlq)

where NB = mb_a = nb_a,

iroffa = mod(ia-1, NB),

icoffa = mod(ja-1, NB),

ioff = mod(ia+ilo-2, NB), iarow = indxg2p(ia, NB, MYROW, rsrc_a, NPROW), ihip = numroc(ihi+iroffa, NB, MYROW, iarow, NPROW),

ilrow = indxg2p(ia+ilo-1, NB, MYROW, rsrc_a, NPROW),

ihlp = numroc(ihi-ilo+ioff+1, NB, MYROW, ilrow, NPROW),

ilcol = indxg2p(ja+ilo-1, NB, MYCOL, csrc_a, NPCOL),

inlq = numroc(n-ilo+ioff+1, NB, MYCOL, ilcol, NPCOL),

NOTE:

mod(x,y) is the integer remainder of x/y.

indxg2p and numroc are ScaLAPACK tool functions; MYROW, MYCOL, NPROW and NPCOL can be determined by calling the subroutine blacs_gridinfo.

If lwork = -1, then lwork is global input and a workspace query is assumed; the routine only calculates the minimum and optimal size for all work arrays. Each of these values is returned in the first entry of the corresponding work array, and no error message is issued by pxerbla.

Output Parameters
a

On exit, the upper triangle and the first subdiagonal of sub(A) are overwritten with the upper Hessenberg matrix H, and the elements below the first subdiagonal, with the array tau, represent the orthogonal/unitary matrix Q as a product of elementary reflectors (see Application Notes below).

tau

(local). REAL for psgehrd

DOUBLE PRECISION for pdgehrd

COMPLEX for pcgehrd

DOUBLE COMPLEX for pzgehrd.

Array of size at least max(ja+n-2).

The scalar factors of the elementary reflectors (see Application Notes below). Elements ja:ja+ilo-2 and ja+ihi:ja+n-2 of the global vector tau are set to zero. tau is tied to the distributed matrix A.

work(1)

On exit work(1) contains the minimum value of lwork required for optimum performance.

info

(global) INTEGER.

= 0: the execution is successful.

< 0: if the i-th argument is an array and the j-th entry had an illegal value, then info = -(i*100+j); if the i-th argument is a scalar and had an illegal value, then info = -i.

Application Notes

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'

where tau is a real/complex scalar, and v is a real/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(ia+ilo+i:ia+ihi-1,ja+ilo+i-2), and tau in tau(ja+ilo+i-2). The contents of

a(ia:ia+n-1,ja:ja+n-1) are illustrated by the following example, with n = 7, ilo = 2 and ihi = 6:

on entry


Equation

on exit


Equation

where a denotes an element of the original matrix sub(A), H denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(ja+ilo+i-2).

See Also