LAPACK 3.12.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches

## ◆ dlaqr1()

 subroutine dlaqr1 ( integer n, double precision, dimension( ldh, * ) h, integer ldh, double precision sr1, double precision si1, double precision sr2, double precision si2, double precision, dimension( * ) v )

DLAQR1 sets a scalar multiple of the first column of the product of 2-by-2 or 3-by-3 matrix H and specified shifts.

Purpose:
```      Given a 2-by-2 or 3-by-3 matrix H, DLAQR1 sets v to a
scalar multiple of the first column of the product

(*)  K = (H - (sr1 + i*si1)*I)*(H - (sr2 + i*si2)*I)

scaling to avoid overflows and most underflows. It
is assumed that either

1) sr1 = sr2 and si1 = -si2
or
2) si1 = si2 = 0.

This is useful for starting double implicit shift bulges
in the QR algorithm.```
Parameters
 [in] N ``` N is INTEGER Order of the matrix H. N must be either 2 or 3.``` [in] H ``` H is DOUBLE PRECISION array, dimension (LDH,N) The 2-by-2 or 3-by-3 matrix H in (*).``` [in] LDH ``` LDH is INTEGER The leading dimension of H as declared in the calling procedure. LDH >= N``` [in] SR1 ` SR1 is DOUBLE PRECISION` [in] SI1 ` SI1 is DOUBLE PRECISION` [in] SR2 ` SR2 is DOUBLE PRECISION` [in] SI2 ``` SI2 is DOUBLE PRECISION The shifts in (*).``` [out] V ``` V is DOUBLE PRECISION array, dimension (N) A scalar multiple of the first column of the matrix K in (*).```
Contributors:
Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA

Definition at line 120 of file dlaqr1.f.

121*
122* -- LAPACK auxiliary routine --
123* -- LAPACK is a software package provided by Univ. of Tennessee, --
124* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
125*
126* .. Scalar Arguments ..
127 DOUBLE PRECISION SI1, SI2, SR1, SR2
128 INTEGER LDH, N
129* ..
130* .. Array Arguments ..
131 DOUBLE PRECISION H( LDH, * ), V( * )
132* ..
133*
134* ================================================================
135*
136* .. Parameters ..
137 DOUBLE PRECISION ZERO
138 parameter( zero = 0.0d0 )
139* ..
140* .. Local Scalars ..
141 DOUBLE PRECISION H21S, H31S, S
142* ..
143* .. Intrinsic Functions ..
144 INTRINSIC abs
145* ..
146* .. Executable Statements ..
147*
148* Quick return if possible
149*
150 IF( n.NE.2 .AND. n.NE.3 ) THEN
151 RETURN
152 END IF
153*
154 IF( n.EQ.2 ) THEN
155 s = abs( h( 1, 1 )-sr2 ) + abs( si2 ) + abs( h( 2, 1 ) )
156 IF( s.EQ.zero ) THEN
157 v( 1 ) = zero
158 v( 2 ) = zero
159 ELSE
160 h21s = h( 2, 1 ) / s
161 v( 1 ) = h21s*h( 1, 2 ) + ( h( 1, 1 )-sr1 )*
162 \$ ( ( h( 1, 1 )-sr2 ) / s ) - si1*( si2 / s )
163 v( 2 ) = h21s*( h( 1, 1 )+h( 2, 2 )-sr1-sr2 )
164 END IF
165 ELSE
166 s = abs( h( 1, 1 )-sr2 ) + abs( si2 ) + abs( h( 2, 1 ) ) +
167 \$ abs( h( 3, 1 ) )
168 IF( s.EQ.zero ) THEN
169 v( 1 ) = zero
170 v( 2 ) = zero
171 v( 3 ) = zero
172 ELSE
173 h21s = h( 2, 1 ) / s
174 h31s = h( 3, 1 ) / s
175 v( 1 ) = ( h( 1, 1 )-sr1 )*( ( h( 1, 1 )-sr2 ) / s ) -
176 \$ si1*( si2 / s ) + h( 1, 2 )*h21s + h( 1, 3 )*h31s
177 v( 2 ) = h21s*( h( 1, 1 )+h( 2, 2 )-sr1-sr2 ) +
178 \$ h( 2, 3 )*h31s
179 v( 3 ) = h31s*( h( 1, 1 )+h( 3, 3 )-sr1-sr2 ) +
180 \$ h21s*h( 3, 2 )
181 END IF
182 END IF
Here is the caller graph for this function: