# p?larfg

Generates an elementary reflector (Householder matrix).

## Syntax

call pslarfg(n, alpha, iax, jax, x, ix, jx, descx, incx, tau)

call pdlarfg(n, alpha, iax, jax, x, ix, jx, descx, incx, tau)

call pclarfg(n, alpha, iax, jax, x, ix, jx, descx, incx, tau)

call pzlarfg(n, alpha, iax, jax, x, ix, jx, descx, incx, tau)

## Description

This routine generates a real/complex elementary reflector H of order n, such that

`H*sub(X) = H*(x(iax, jax)) = (alpha), H'*H = i,`

`( x ) ( 0 )`

where alpha is a scalar (a real scalar - for complex flavors), and `sub(X)` is an (n-1)-element real/complex distributed vector `X(ix:ix+n-2, jx)` if `incx = 1` and `X(ix, jx:jx+n-2)` if `incx = descx(m_)`. H is represented in the form

`H = I-tau*(1)*(1 v')` ,

`( v )`

where tau is a real/complex scalar and v is a real/complex (n-1)-element vector. Note that H is not Hermitian.

If the elements of sub(X) are all zero (and `X(iax, jax)` is real for complex flavors), then `tau = 0` and H is taken to be the unit matrix.

Otherwise `1 ≤ real(tau) ≤ 2` and `abs(tau-1) ≤ 1`.

## Input Parameters

n

  (global) INTEGER.

  The global order of the elementary reflector. `n ≥ 0`.

iax, jax

  (global) INTEGER.

  The global row and column indices in x of `X(iax, jax)`.

x

  (local).

  Real for pslarfg

  DOUBLE PRECISION for pdlarfg

  COMPLEX for pclarfg

  COMPLEX*16 for pzlarfg.

  Pointer into the local memory to an array of DIMENSION (lld_x, *). This array contains the local pieces of the distributed vector sub(X). Before entry, the incremented array sub(X) must contain vector x.

ix, jx

  (global) INTEGER.

  The row and column indices in the global array X indicating the first row and the first column of sub(X), respectively.

descx

  (global and local) INTEGER.

  Array of DIMENSION (dlen_). The array descriptor for the distributed matrix X.

incx

  (global) INTEGER.

  The global increment for the elements of x. Only two values of incx are supported in this version, namely 1 and m_x. incx must not be zero.

## Output Parameters

alpha

  (local)

  REAL for pslafg

  DOUBLE PRECISION for pdlafg

  COMPLEX for pclafg

  COMPLEX*16 for pzlafg.

  On exit, alpha is computed in the process scope having the vector sub(X).

x

  (local).

  On exit, it is overwritten with the vector v.

tau

  (local).

  Real for pslarfg

  DOUBLE PRECISION for pdlarfg

  COMPLEX for pclarfg

  COMPLEX*16 for pzlarfg.

  Array, DIMENSION LOCc(jx) if `incx = 1`, and `LOCr(ix)` otherwise. This array contains the Householder scalars related to the Householder vectors.

  tau is tied to the distributed matrix X.

Parent topic: Auxiliary Routines