Note: before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.
F06QRF transforms an n by n real upper Hessenberg matrix H to upper triangular form R by applying an orthogonal matrix P from the left or the right. H is assumed to have nonzero subdiagonal elements hk+1,k, for k=k1,…,k2-1, only. P is formed as a sequence of plane rotations in planes k1 to k2.
If SIDE='L', the rotations are applied from the left:
PH=R,
where P=Pk2-1⋯Pk1+1Pk1.
If SIDE='R', the rotations are applied from the right:
HPT=R,
where P=Pk1Pk1+1⋯Pk2-1.
In either case, Pk is a rotation in the k,k+1 plane, chosen to annihilate hk+1,k.
The 2 by 2 plane rotation part of Pk has the form
cksk-skck.
4 References
None.
5 Parameters
1: SIDE – CHARACTER(1)Input
On entry: specifies whether H is operated on from the left or the right.
SIDE='L'
H is pre-multiplied from the left.
SIDE='R'
H is post-multiplied from the right.
Constraint:
SIDE='L' or 'R'.
2: N – INTEGERInput
On entry: n, the order of the matrix H.
Constraint:
N≥0.
3: K1 – INTEGERInput
4: K2 – INTEGERInput
On entry: the values k1 and k2.
If K1<1 or K2≤K1 or K2>N, an immediate return is effected.
5: C(K2-1) – REAL (KIND=nag_wp) arrayOutput
On exit: Ck holds ck, the cosine of the rotation Pk, for k=k1,…,k2-1.
6: S(K2-1) – REAL (KIND=nag_wp) arrayInput/Output
On entry: the nonzero subdiagonal elements of H:
Sk must hold hk+1,k, for k=k1,…,k2-1.
On exit: Sk holds sk, the sine of the rotation Pk, for k=k1,…,k2-1.
7: A(LDA,*) – REAL (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array A
must be at least
N.
On entry: the upper triangular part of the n by n upper Hessenberg matrix H.
On exit: the upper triangular matrix R.
8: LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F06QRF is called.