LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ zlaqr1()

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

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

Download ZLAQR1 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
      Given a 2-by-2 or 3-by-3 matrix H, ZLAQR1 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*16 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*16
[in]S2
          S2 is COMPLEX*16

          S1 and S2 are the shifts defining K in (*) above.
[out]V
          V is COMPLEX*16 array, dimension (N)
              A scalar multiple of the first column of the
              matrix K in (*).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
June 2017
Contributors:
Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA

Definition at line 109 of file zlaqr1.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*16 S1, S2
117  INTEGER LDH, N
118 * ..
119 * .. Array Arguments ..
120  COMPLEX*16 H( LDH, * ), V( * )
121 * ..
122 *
123 * ================================================================
124 *
125 * .. Parameters ..
126  COMPLEX*16 ZERO
127  parameter( zero = ( 0.0d0, 0.0d0 ) )
128  DOUBLE PRECISION RZERO
129  parameter( rzero = 0.0d0 )
130 * ..
131 * .. Local Scalars ..
132  COMPLEX*16 CDUM, H21S, H31S
133  DOUBLE PRECISION S
134 * ..
135 * .. Intrinsic Functions ..
136  INTRINSIC abs, dble, dimag
137 * ..
138 * .. Statement Functions ..
139  DOUBLE PRECISION CABS1
140 * ..
141 * .. Statement Function definitions ..
142  cabs1( cdum ) = abs( dble( cdum ) ) + abs( dimag( 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: