LAPACK  3.9.0 LAPACK: Linear Algebra PACKage

## ◆ claqr1()

 subroutine claqr1 ( integer N, complex, dimension( ldh, * ) H, integer LDH, complex S1, complex S2, complex, dimension( * ) V )

CLAQR1 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, CLAQR1 sets v to a
scalar multiple of the first column of the product

(*)  K = (H - s1*I)*(H - s2*I)

scaling to avoid overflows and most underflows.

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 COMPLEX 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] S1 ` S1 is COMPLEX` [in] S2 ``` S2 is COMPLEX S1 and S2 are the shifts defining K in (*) above.``` [out] V ``` V is COMPLEX array, dimension (N) A scalar multiple of the first column of the matrix K in (*).```
Date
June 2017
Contributors:
Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA

Definition at line 109 of file claqr1.f.

109 *
110 * -- LAPACK auxiliary routine (version 3.7.1) --
111 * -- LAPACK is a software package provided by Univ. of Tennessee, --
112 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
113 * June 2017
114 *
115 * .. Scalar Arguments ..
116  COMPLEX S1, S2
117  INTEGER LDH, N
118 * ..
119 * .. Array Arguments ..
120  COMPLEX H( LDH, * ), V( * )
121 * ..
122 *
123 * ================================================================
124 *
125 * .. Parameters ..
126  COMPLEX ZERO
127  parameter( zero = ( 0.0e0, 0.0e0 ) )
128  REAL RZERO
129  parameter( rzero = 0.0e0 )
130 * ..
131 * .. Local Scalars ..
132  COMPLEX CDUM, H21S, H31S
133  REAL S
134 * ..
135 * .. Intrinsic Functions ..
136  INTRINSIC abs, aimag, real
137 * ..
138 * .. Statement Functions ..
139  REAL CABS1
140 * ..
141 * .. Statement Function definitions ..
142  cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
143 * ..
144 * .. Executable Statements ..
145 *
146 * Quick return if possible
147 *
148  IF( n.NE.2 .AND. n.NE.3 ) THEN
149  RETURN
150  END IF
151 *
152  IF( n.EQ.2 ) THEN
153  s = cabs1( h( 1, 1 )-s2 ) + cabs1( h( 2, 1 ) )
154  IF( s.EQ.rzero ) THEN
155  v( 1 ) = zero
156  v( 2 ) = zero
157  ELSE
158  h21s = h( 2, 1 ) / s
159  v( 1 ) = h21s*h( 1, 2 ) + ( h( 1, 1 )-s1 )*
160  \$ ( ( h( 1, 1 )-s2 ) / s )
161  v( 2 ) = h21s*( h( 1, 1 )+h( 2, 2 )-s1-s2 )
162  END IF
163  ELSE
164  s = cabs1( h( 1, 1 )-s2 ) + cabs1( h( 2, 1 ) ) +
165  \$ cabs1( h( 3, 1 ) )
166  IF( s.EQ.zero ) THEN
167  v( 1 ) = zero
168  v( 2 ) = zero
169  v( 3 ) = zero
170  ELSE
171  h21s = h( 2, 1 ) / s
172  h31s = h( 3, 1 ) / s
173  v( 1 ) = ( h( 1, 1 )-s1 )*( ( h( 1, 1 )-s2 ) / s ) +
174  \$ h( 1, 2 )*h21s + h( 1, 3 )*h31s
175  v( 2 ) = h21s*( h( 1, 1 )+h( 2, 2 )-s1-s2 ) + h( 2, 3 )*h31s
176  v( 3 ) = h31s*( h( 1, 1 )+h( 3, 3 )-s1-s2 ) + h21s*h( 3, 2 )
177  END IF
178  END IF
Here is the caller graph for this function: