# ?lahrd

Reduces the first nb columns of a general rectangular matrix A so that elements below the k-th subdiagonal are zero, and returns auxiliary matrices which are needed to apply the transformation to the unreduced part of A.

## Syntax

call slahrd( n, k, nb, a, lda, tau, t, ldt, y, ldy )

call dlahrd( n, k, nb, a, lda, tau, t, ldt, y, ldy )

call clahrd( n, k, nb, a, lda, tau, t, ldt, y, ldy )

call zlahrd( n, k, nb, a, lda, tau, t, ldt, y, ldy )

## Description

The routine reduces the first nb columns of a real/complex general n-by-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero. The reduction is performed by an orthogonal/unitary similarity transformation Q'*A*Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A*V*T.

The matrix Q is represented as products of nb elementary reflectors:

`Q = H(1)*H(2)*... *H(nb)`

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.

This is an obsolete auxiliary routine. Please use the new routine ?lahr2 instead.

## Input Parameters

n

  INTEGER. The order of the matrix A (`n ≥ 0`).

k

  INTEGER. The offset for the reduction. Elements below the k-th subdiagonal in the first nb columns are reduced to zero.

nb

  INTEGER. The number of columns to be reduced.

a

  REAL for slahrd

  DOUBLE PRECISION for dlahrd

  COMPLEX for clahrd

  COMPLEX*16 for zlahrd.

  Array a(lda, n-k+1) contains the n-by-(n-k+1) general matrix A to be reduced.

lda

  INTEGER. The first dimension of a; at least `max(1, n)`.

ldt

  INTEGER. The first dimension of the output array t; must be at least `max(1, nb)`.

ldy

  INTEGER. The first dimension of the output array y; must be at least `max(1, n)`.

## Output Parameters

a

  On exit, the elements on and above the k-th subdiagonal in the first nb columns are overwritten with the corresponding elements of the reduced matrix; the elements below the k-th subdiagonal, with the array tau, represent the matrix Q as a product of elementary reflectors. The other columns of a are unchanged. See Application Notes below.

tau

  REAL for slahrd

  DOUBLE PRECISION for dlahrd

  COMPLEX for clahrd

  COMPLEX*16 for zlahrd.

  Array, DIMENSION (nb).

  Contains scalar factors of the elementary reflectors.

t, y

  REAL for slahrd

  DOUBLE PRECISION for dlahrd

  COMPLEX for clahrd

  COMPLEX*16 for zlahrd.

  Arrays, dimension t(ldt, nb), y(ldy, nb).

  The array t contains upper triangular matrix T.

  The array y contains the n-by-nb matrix Y .

## Application Notes

For the elementary reflector H(i),

`v(1:i+k-1) = 0`, `v(i+k) = 1`; `v(i+k+1:n)` is stored on exit in a(i+k+1:n, i) and tau is stored in tau(i).

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form:

`A := (I - V*T*V') * (A - Y*V')`.

The contents of A on exit are illustrated by the following example with `n = 7`, `k = 3` and `nb = 2`:

where a denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

## See Also

?lahr2 Reduces the specified number of first columns of a general rectangular matrix A so that elements below the specified subdiagonal are zero, and returns auxiliary matrices which are needed to apply the transformation to the unreduced part of A.
Parent topic: Auxiliary Routines