LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 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 of 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.GE.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 of dimension N A scalar multiple of the first column of the matrix K in (*).```
Date
September 2012
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.4.2) --
111 * -- LAPACK is a software package provided by Univ. of Tennessee, --
112 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
113 * September 2012
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  IF( n.EQ.2 ) THEN
146  s = cabs1( h( 1, 1 )-s2 ) + cabs1( h( 2, 1 ) )
147  IF( s.EQ.rzero ) THEN
148  v( 1 ) = zero
149  v( 2 ) = zero
150  ELSE
151  h21s = h( 2, 1 ) / s
152  v( 1 ) = h21s*h( 1, 2 ) + ( h( 1, 1 )-s1 )*
153  \$ ( ( h( 1, 1 )-s2 ) / s )
154  v( 2 ) = h21s*( h( 1, 1 )+h( 2, 2 )-s1-s2 )
155  END IF
156  ELSE
157  s = cabs1( h( 1, 1 )-s2 ) + cabs1( h( 2, 1 ) ) +
158  \$ cabs1( h( 3, 1 ) )
159  IF( s.EQ.zero ) THEN
160  v( 1 ) = zero
161  v( 2 ) = zero
162  v( 3 ) = zero
163  ELSE
164  h21s = h( 2, 1 ) / s
165  h31s = h( 3, 1 ) / s
166  v( 1 ) = ( h( 1, 1 )-s1 )*( ( h( 1, 1 )-s2 ) / s ) +
167  \$ h( 1, 2 )*h21s + h( 1, 3 )*h31s
168  v( 2 ) = h21s*( h( 1, 1 )+h( 2, 2 )-s1-s2 ) + h( 2, 3 )*h31s
169  v( 3 ) = h31s*( h( 1, 1 )+h( 3, 3 )-s1-s2 ) + h21s*h( 3, 2 )
170  END IF
171  END IF

Here is the caller graph for this function: