p?unmtr

Multiplies a general matrix by the unitary transformation matrix from a reduction to tridiagonal form determined by p?hetrd.

Syntax

Fortran:

call pcunmtr(side, uplo, trans, m, n, a, ia, ja, desca, tau, c, ic, jc, descc, work, lwork, info)

call pzunmtr(side, uplo, trans, m, n, a, ia, ja, desca, tau, c, ic, jc, descc, work, lwork, info)

C:

void pcunmtr (char *side , char *uplo , char *trans , MKL_INT *m , MKL_INT *n , MKL_Complex8 *a , MKL_INT *ia , MKL_INT *ja , MKL_INT *desca , MKL_Complex8 *tau , MKL_Complex8 *c , MKL_INT *ic , MKL_INT *jc , MKL_INT *descc , MKL_Complex8 *work , MKL_INT *lwork , MKL_INT *info );

void pzunmtr (char *side , char *uplo , char *trans , MKL_INT *m , MKL_INT *n , MKL_Complex16 *a , MKL_INT *ia , MKL_INT *ja , MKL_INT *desca , MKL_Complex16 *tau , MKL_Complex16 *c , MKL_INT *ic , MKL_INT *jc , MKL_INT *descc , MKL_Complex16 *work , MKL_INT *lwork , MKL_INT *info );

Include Files

  • C: mkl_scalapack.h

Description

This routine overwrites the general complex distributed m-by-n matrix sub(C) = C(ic:ic+m-1,jc:jc+n-1) with

  side ='L' side ='R'
trans = 'N': Q*sub(C) sub(C)*Q
trans = 'C': QH*sub(C) sub(C)*QH

where Q is a complex unitary distributed matrix of order nq, with nq = m if side = 'L' and nq = n if side = 'R'.

Q is defined as the product of nq-1 elementary reflectors, as returned by p?hetrd.

If uplo = 'U', Q = H(nq-1)... H(2) H(1);

If uplo = 'L', Q = H(1) H(2)... H(nq-1).

Input Parameters

side

(global) CHARACTER

='L': Q or QH is applied from the left.

='R': Q or QH is applied from the right.

trans

(global) CHARACTER

='N', no transpose, Q is applied.

='C', conjugate transpose, QH is applied.

uplo

(global) CHARACTER.

= 'U': Upper triangle of A(ia:*, ja:*) contains elementary reflectors from p?hetrd;

= 'L': Lower triangle of A(ia:*,ja:*) contains elementary reflectors from p?hetrd

m

(global) INTEGER. The number of rows in the distributed matrix sub(C) (m0).

n

(global) INTEGER. The number of columns in the distributed matrix sub(C) (n0).

a

(local)

REAL for pcunmtr

DOUBLE PRECISION for pzunmtr.

Pointer into the local memory to an array of dimension (lld_a, LOCc(ja+m-1)) if side='L', or (lld_a, LOCc(ja+n-1)) if side = 'R'.

Contains the vectors which define the elementary reflectors, as returned by p?hetrd.

If side='L', lld_amax(1,LOCr(ia+m-1));

If side ='R', lld_amax(1, LOCr(ia+n-1)).

ia, ja

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

desca

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

tau

(local)

COMPLEX for pcunmtr

DOUBLE COMPLEX for pzunmtr.

Array, size of ltau where

If side = 'L' and uplo = 'U', ltau = LOCc(m_a),

if side = 'L' and uplo = 'L', ltau = LOCc(ja+m-2),

if side = 'R' and uplo = 'U', ltau = LOCc(n_a),

if side = 'R' and uplo = 'L', ltau = LOCc(ja+n-2).

tau(i) must contain the scalar factor of the elementary reflector H(i), as returned by p?hetrd. tau is tied to the distributed matrix A.

c

(local) COMPLEX for pcunmtr

DOUBLE COMPLEX for pzunmtr.

Pointer into the local memory to an array of dimension (lld_a, LOCc (ja+n-1)). Contains the local pieces of the distributed matrix sub (C).

ic, jc

(global) INTEGER. The row and column indices in the global array c indicating the first row and the first column of the submatrix C, respectively.

descc

(global and local) INTEGER array, dimension (dlen_). The array descriptor for the distributed matrix C.

work

(local)

COMPLEX for pcunmtr

DOUBLE COMPLEX for pzunmtr.

Workspace array of dimension lwork.

lwork

(local or global) INTEGER, dimension of work, must be at least:

If uplo = 'U',

iaa= ia; jaa= ja+1, icc= ic; jcc= jc;

else uplo = 'L',

iaa= ia+1, jaa= ja;

If side = 'L',

icc= ic+1; jcc= jc;

else icc= ic; jcc= jc+1;

end if

end if

If side = 'L',

mi= m-1; ni= n

lworkmax((nb_a*(nb_a-1))/2, (nqc0 + mpc0)*nb_a) + nb_a*nb_a

else

If side = 'R',

mi= m; mi = n-1;

lworkmax((nb_a*(nb_a-1))/2, (nqc0 + max(npa0+numroc(numroc(ni+icoffc, nb_a, 0, 0, NPCOL), nb_a, 0, 0, lcmq), mpc0))*nb_a) + nb_a*nb_a

end if

where lcmq = lcm/NPCOL with lcm = ilcm(NPROW, NPCOL),

iroffa = mod(iaa-1, mb_a),

icoffa = mod(jaa-1, nb_a),

iarow = indxg2p(iaa, mb_a, MYROW, rsrc_a, NPROW),

npa0 = numroc(ni+iroffa, mb_a, MYROW, iarow, NPROW),

iroffc = mod(icc-1, mb_c),

icoffc = mod(jcc-1, nb_c),

icrow = indxg2p(icc, mb_c, MYROW, rsrc_c, NPROW),

iccol = indxg2p(jcc, nb_c, MYCOL, csrc_c, NPCOL),

mpc0 = numroc(mi+iroffc, mb_c, MYROW, icrow, NPROW),

nqc0 = numroc(ni+icoffc, nb_c, MYCOL, iccol, NPCOL),

ilcm, 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

c

Overwritten by the product Q*sub(C), or Q'*sub(C), or sub(C)*Q', or sub(C)*Q.

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-entry had an illegal value, then info = - i

For more complete information about compiler optimizations, see our Optimization Notice.