Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 10/31/2024
Public
Document Table of Contents

p?gehrd

Reduces a general matrix to upper Hessenberg form.

Syntax

void psgehrd (MKL_INT *n , MKL_INT *ilo , MKL_INT *ihi , float *a , MKL_INT *ia , MKL_INT *ja , MKL_INT *desca , float *tau , float *work , MKL_INT *lwork , MKL_INT *info );

void pdgehrd (MKL_INT *n , MKL_INT *ilo , MKL_INT *ihi , double *a , MKL_INT *ia , MKL_INT *ja , MKL_INT *desca , double *tau , double *work , MKL_INT *lwork , MKL_INT *info );

void pcgehrd (MKL_INT *n , MKL_INT *ilo , MKL_INT *ihi , MKL_Complex8 *a , MKL_INT *ia , MKL_INT *ja , MKL_INT *desca , MKL_Complex8 *tau , MKL_Complex8 *work , MKL_INT *lwork , MKL_INT *info );

void pzgehrd (MKL_INT *n , MKL_INT *ilo , MKL_INT *ihi , MKL_Complex16 *a , MKL_INT *ia , MKL_INT *ja , MKL_INT *desca , MKL_Complex16 *tau , MKL_Complex16 *work , MKL_INT *lwork , MKL_INT *info );

Include Files

  • mkl_scalapack.h

Description

The p?gehrd function 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). The order of the distributed matrix sub(A) (n0).

ilo, ihi

(global).

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)

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) 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) array of size dlen_. The array descriptor for the distributed matrix A.

work

(local)

Workspace array of size lwork.

lwork

(local or global) 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 function blacs_gridinfo.

If lwork = -1, then lwork is global input and a workspace query is assumed; the function 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).

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[0]

On exit work[0] contains the minimum value of lwork required for optimum performance.

info

(global)

= 0: the execution is successful.

< 0: if the i-th argument is an array and the j-th entry, indexed j - 1, 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-3]. 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