Previous: sggglm Up: ../lapack-s.html Next: sgglse

# sgghrd

```
NAME
SGGHRD - reduce a pair of real matrices (A,B) to generalized
upper Hessenberg form using orthogonal similarity transfor-
mations, where A is a (generally non-symmetric) square
matrix and B is upper triangular

SYNOPSIS
SUBROUTINE SGGHRD( COMPQ, COMPZ, N, ILO, IHI, A, LDA, B,
LDB, Q, LDQ, Z, LDZ, INFO )

CHARACTER      COMPQ, COMPZ

INTEGER        IHI, ILO, INFO, LDA, LDB, LDQ, LDZ, N

REAL           A( LDA, * ), B( LDB, * ), Q( LDQ, * ), Z(
LDZ, * )

PURPOSE
SGGHRD reduces a pair of real matrices (A,B) to generalized
upper Hessenberg form using orthogonal similarity transfor-
mations, where A is a (generally non-symmetric) square
matrix and B is upper triangular.  More precisely, SGGHRD
simultaneously decomposes  A into  Q H Z' and  B  into  Q T
Z' , where H is upper Hessenberg, T is upper triangular, Q
and Z are orthogonal, and ' means transpose.

If COMPQ and COMPZ are 'V' or 'I', then the orthogonal
transformations used to reduce (A,B) are accumulated into
the arrays Q and Z s.t.:

Q(in) A(in) Z(in)' = Q(out) A(out) Z(out)'
Q(in) B(in) Z(in)' = Q(out) B(out) Z(out)'

SGGHRD implements an unblocked form of the method, there
being no blocked form known at this time.

ARGUMENTS
COMPQ   (input) CHARACTER*1
= 'N': do not compute Q;
= 'V': accumulate the row transformations into Q;
= 'I': overwrite the array Q with the row transfor-
mations.

COMPZ   (input) CHARACTER*1
= 'N': do not compute Z;
= 'V': accumulate the column transformations into Z;
= 'I': overwrite the array Z with the column
transformations.

N       (input) INTEGER
The number of rows and columns in the matrices A, B,

Q, and Z.  N >= 0.

ILO     (input) INTEGER
IHI     (input) INTEGER It is assumed that A is
already upper triangular in rows and columns 1:ILO-1
and IHI+1:N.  ILO >= 1 and IHI <= N.

A       (input/output) REAL array, dimension (LDA, N)
On entry, the N-by-N general matrix to be reduced.
On exit, the upper triangle and the first subdiago-
nal of A are overwritten with the Hessenberg matrix
H, and the rest is set to zero.

LDA     (input) INTEGER
The leading dimension of the array A.  LDA >= max(
1, N ).

B       (input/output) REAL array, dimension (LDB, N)
On entry, the N-by-N upper triangular matrix B.  On
exit, the transformed matrix T = Q' B Z, which is
upper triangular.

LDB     (input) INTEGER
The leading dimension of the array B.  LDB >= max(
1, N ).

Q       (input/output) REAL array, dimension (LDQ, N)
If COMPQ='N', then Q will not be referenced.  If
COMPQ='V', then the Givens transformations which are
applied to A and B on the left will be applied to
the array Q on the right.  If COMPQ='I', then Q will
first be overwritten with an identity matrix, and
then the Givens transformations will be applied to Q
as in the case COMPQ='V'.

LDQ     (input) INTEGER
The leading dimension of the array Q.  LDQ >= 1.  If
COMPQ='V' or 'I', then LDQ >= N.

Z       (input/output) REAL array, dimension (LDZ, N)
If COMPZ='N', then Z will not be referenced.  If
COMPZ='V', then the Givens transformations which are
applied to A and B on the right will be applied to
the array Z on the right.  If COMPZ='I', then Z will
first be overwritten with an identity matrix, and
then the Givens transformations will be applied to Z
as in the case COMPZ='V'.

LDZ     (input) INTEGER
The leading dimension of the array Z.  LDZ >= 1.  If
COMPZ='V' or 'I', then LDZ >= N.

INFO    (output) INTEGER
= 0:  successful exit.
< 0:  if INFO = -i, the i-th argument had an illegal
value.

FURTHER DETAILS
This routine reduces A to Hessenberg and B to triangular
form by an unblocked reduction, as described in
_Matrix_Computations_, by Golub and Van Loan (Johns Hopkins
Press.)
```