# p?lahqr

Computes the Schur decomposition and/or eigenvalues of a matrix already in Hessenberg form.

## Syntax

call pslahqr(wantt, wantz, n, ilo, ihi, a, desca, wr, wi, iloz, ihiz, z, descz, work, lwork, iwork, ilwork, info)

call pdlahqr(wantt, wantz, n, ilo, ihi, a, desca, wr, wi, iloz, ihiz, z, descz, work, lwork, iwork, ilwork, info)

## Description

This is an auxiliary routine used to find the Schur decomposition and/or eigenvalues of a matrix already in Hessenberg form from columns ilo to ihi.

## Input Parameters

wantt

  (global) LOGICAL

  If `wantt = .TRUE.`, the full Schur form T is required;

  If `wantt = .FALSE.`, only eigenvalues are required.

wantz

  (global) LOGICAL.

  If `wantz = .TRUE.`, the matrix of Schur vectors z is required;

  If `wantz = .FALSE.`, Schur vectors are not required.

n

  (global) INTEGER. The order of the Hessenberg matrix A (and z if wantz). `(n≥0)`.

ilo, ihi

  (global) INTEGER.

  It is assumed that A is already upper quasi-triangular in rows and columns ihi+1:n, and that `A(ilo, ilo-1) = 0` (unless `ilo = 1`). p?lahqr works primarily with the Hessenberg submatrix in rows and columns ilo to ihi, but applies transformations to all of h if wantt is `.TRUE.. 1≤ilo≤max(1,ihi); ihi ≤ n`.

a

  (global)

  REAL for pslahqr

  DOUBLE PRECISION for pdlahqr

  Array, DIMENSION `(desca(lld_),*)`. On entry, the upper Hessenberg matrix A.

desca

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

iloz, ihiz

  (global) INTEGER. Specify the rows of z to which transformations must be applied if wantz is `.TRUE.. 1≤iloz≤ilo; ihi≤ihiz≤n`.

z

  (global ) REAL for pslahqr

  DOUBLE PRECISION for pdlahqr

  Array. If wantz is .TRUE., on entry z must contain the current matrix Z of transformations accumulated by pdhseqr. If wantz is .FALSE., z is not referenced.

descz

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

work

  (local)

  REAL for pslahqr

  DOUBLE PRECISION for pdlahqr

  Workspace array with dimension lwork.

lwork

  (local) INTEGER. The dimension of work. lwork is assumed big enough so that `lwork≥3*n + max(2*max(descz(lld_),desca(lld_)) + 2*LOCq(n), 7*ceil(n/hbl)/lcm(NPROW,NPCOL)))`.

  If `lwork = -1`, then `work(1)`gets set to the above number and the code returns immediately.

iwork

  (global and local) INTEGER array of size ilwork.

ilwork

  (local) INTEGER This holds some of the iblk integer arrays.

## Output Parameters

a

  On exit, if wantt is .TRUE., A is upper quasi-triangular in rows and columns ilo:ihi, with any 2-by-2 or larger diagonal blocks not yet in standard form. If wantt is .FALSE., the contents of A are unspecified on exit.

`work(1)`

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

wr, wi

  (global replicated output)

  REAL for pslahqr

  DOUBLE PRECISION for pdlahqr

  Arrays, DIMENSION(n) each. The real and imaginary parts, respectively, of the computed eigenvalues ilo to ihi are stored in the corresponding elements of wr and wi. If two eigenvalues are computed as a complex conjugate pair, they are stored in consecutive elements of wr and wi, say the i-th and (i+1)-th, with wi(i)> 0 and wi(i+1) < 0. If wantt is .TRUE. , the eigenvalues are stored in the same order as on the diagonal of the Schur form returned in A. A may be returned with larger diagonal blocks until the next release.

z

  On exit z has been updated; transformations are applied only to the submatrix `z(iloz:ihiz, ilo:ihi)`.

info

  (global) INTEGER.

  `= 0`: the execution is successful.

  `< 0`: parameter number -info incorrect or inconsistent

  `> 0`: p?lahqr failed to compute all the eigenvalues ilo to ihi in a total of `30*(ihi-ilo+1)` iterations; if `info = i`, elements `i+1:ihi` of wr and wi contain those eigenvalues which have been successfully computed.

Parent topic: Nonsymmetric Eigenvalue Problems