LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ clauu2()

subroutine clauu2 ( character  UPLO,
integer  N,
complex, dimension( lda, * )  A,
integer  LDA,
integer  INFO 
)

CLAUU2 computes the product UUH or LHL, where U and L are upper or lower triangular matrices (unblocked algorithm).

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

Purpose:
 CLAUU2 computes the product U * U**H or L**H * L, where the triangular
 factor U or L is stored in the upper or lower triangular part of
 the array A.

 If UPLO = 'U' or 'u' then the upper triangle of the result is stored,
 overwriting the factor U in A.
 If UPLO = 'L' or 'l' then the lower triangle of the result is stored,
 overwriting the factor L in A.

 This is the unblocked form of the algorithm, calling Level 2 BLAS.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the triangular factor stored in the array A
          is upper or lower triangular:
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[in]N
          N is INTEGER
          The order of the triangular factor U or L.  N >= 0.
[in,out]A
          A is COMPLEX array, dimension (LDA,N)
          On entry, the triangular factor U or L.
          On exit, if UPLO = 'U', the upper triangle of A is
          overwritten with the upper triangle of the product U * U**H;
          if UPLO = 'L', the lower triangle of A is overwritten with
          the lower triangle of the product L**H * L.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[out]INFO
          INFO is INTEGER
          = 0: successful exit
          < 0: if INFO = -k, the k-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 104 of file clauu2.f.

104 *
105 * -- LAPACK auxiliary routine (version 3.7.0) --
106 * -- LAPACK is a software package provided by Univ. of Tennessee, --
107 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
108 * December 2016
109 *
110 * .. Scalar Arguments ..
111  CHARACTER UPLO
112  INTEGER INFO, LDA, N
113 * ..
114 * .. Array Arguments ..
115  COMPLEX A( LDA, * )
116 * ..
117 *
118 * =====================================================================
119 *
120 * .. Parameters ..
121  COMPLEX ONE
122  parameter( one = ( 1.0e+0, 0.0e+0 ) )
123 * ..
124 * .. Local Scalars ..
125  LOGICAL UPPER
126  INTEGER I
127  REAL AII
128 * ..
129 * .. External Functions ..
130  LOGICAL LSAME
131  COMPLEX CDOTC
132  EXTERNAL lsame, cdotc
133 * ..
134 * .. External Subroutines ..
135  EXTERNAL cgemv, clacgv, csscal, xerbla
136 * ..
137 * .. Intrinsic Functions ..
138  INTRINSIC cmplx, max, real
139 * ..
140 * .. Executable Statements ..
141 *
142 * Test the input parameters.
143 *
144  info = 0
145  upper = lsame( uplo, 'U' )
146  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
147  info = -1
148  ELSE IF( n.LT.0 ) THEN
149  info = -2
150  ELSE IF( lda.LT.max( 1, n ) ) THEN
151  info = -4
152  END IF
153  IF( info.NE.0 ) THEN
154  CALL xerbla( 'CLAUU2', -info )
155  RETURN
156  END IF
157 *
158 * Quick return if possible
159 *
160  IF( n.EQ.0 )
161  $ RETURN
162 *
163  IF( upper ) THEN
164 *
165 * Compute the product U * U**H.
166 *
167  DO 10 i = 1, n
168  aii = a( i, i )
169  IF( i.LT.n ) THEN
170  a( i, i ) = aii*aii + real( cdotc( n-i, a( i, i+1 ), lda,
171  $ a( i, i+1 ), lda ) )
172  CALL clacgv( n-i, a( i, i+1 ), lda )
173  CALL cgemv( 'No transpose', i-1, n-i, one, a( 1, i+1 ),
174  $ lda, a( i, i+1 ), lda, cmplx( aii ),
175  $ a( 1, i ), 1 )
176  CALL clacgv( n-i, a( i, i+1 ), lda )
177  ELSE
178  CALL csscal( i, aii, a( 1, i ), 1 )
179  END IF
180  10 CONTINUE
181 *
182  ELSE
183 *
184 * Compute the product L**H * L.
185 *
186  DO 20 i = 1, n
187  aii = a( i, i )
188  IF( i.LT.n ) THEN
189  a( i, i ) = aii*aii + real( cdotc( n-i, a( i+1, i ), 1,
190  $ a( i+1, i ), 1 ) )
191  CALL clacgv( i-1, a( i, 1 ), lda )
192  CALL cgemv( 'Conjugate transpose', n-i, i-1, one,
193  $ a( i+1, 1 ), lda, a( i+1, i ), 1,
194  $ cmplx( aii ), a( i, 1 ), lda )
195  CALL clacgv( i-1, a( i, 1 ), lda )
196  ELSE
197  CALL csscal( i, aii, a( i, 1 ), lda )
198  END IF
199  20 CONTINUE
200  END IF
201 *
202  RETURN
203 *
204 * End of CLAUU2
205 *
Here is the call graph for this function:
Here is the caller graph for this function:
csscal
subroutine csscal(N, SA, CX, INCX)
CSSCAL
Definition: csscal.f:80
cgemv
subroutine cgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
CGEMV
Definition: cgemv.f:160
clacgv
subroutine clacgv(N, X, INCX)
CLACGV conjugates a complex vector.
Definition: clacgv.f:76
cdotc
complex function cdotc(N, CX, INCX, CY, INCY)
CDOTC
Definition: cdotc.f:85
xerbla
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
lsame
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55