LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ clauum()

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

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

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

Purpose:
 CLAUUM 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 blocked form of the algorithm, calling Level 3 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.

Definition at line 101 of file clauum.f.

102 *
103 * -- LAPACK auxiliary routine --
104 * -- LAPACK is a software package provided by Univ. of Tennessee, --
105 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
106 *
107 * .. Scalar Arguments ..
108  CHARACTER UPLO
109  INTEGER INFO, LDA, N
110 * ..
111 * .. Array Arguments ..
112  COMPLEX A( LDA, * )
113 * ..
114 *
115 * =====================================================================
116 *
117 * .. Parameters ..
118  REAL ONE
119  parameter( one = 1.0e+0 )
120  COMPLEX CONE
121  parameter( cone = ( 1.0e+0, 0.0e+0 ) )
122 * ..
123 * .. Local Scalars ..
124  LOGICAL UPPER
125  INTEGER I, IB, NB
126 * ..
127 * .. External Functions ..
128  LOGICAL LSAME
129  INTEGER ILAENV
130  EXTERNAL lsame, ilaenv
131 * ..
132 * .. External Subroutines ..
133  EXTERNAL cgemm, cherk, clauu2, ctrmm, xerbla
134 * ..
135 * .. Intrinsic Functions ..
136  INTRINSIC max, min
137 * ..
138 * .. Executable Statements ..
139 *
140 * Test the input parameters.
141 *
142  info = 0
143  upper = lsame( uplo, 'U' )
144  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
145  info = -1
146  ELSE IF( n.LT.0 ) THEN
147  info = -2
148  ELSE IF( lda.LT.max( 1, n ) ) THEN
149  info = -4
150  END IF
151  IF( info.NE.0 ) THEN
152  CALL xerbla( 'CLAUUM', -info )
153  RETURN
154  END IF
155 *
156 * Quick return if possible
157 *
158  IF( n.EQ.0 )
159  $ RETURN
160 *
161 * Determine the block size for this environment.
162 *
163  nb = ilaenv( 1, 'CLAUUM', uplo, n, -1, -1, -1 )
164 *
165  IF( nb.LE.1 .OR. nb.GE.n ) THEN
166 *
167 * Use unblocked code
168 *
169  CALL clauu2( uplo, n, a, lda, info )
170  ELSE
171 *
172 * Use blocked code
173 *
174  IF( upper ) THEN
175 *
176 * Compute the product U * U**H.
177 *
178  DO 10 i = 1, n, nb
179  ib = min( nb, n-i+1 )
180  CALL ctrmm( 'Right', 'Upper', 'Conjugate transpose',
181  $ 'Non-unit', i-1, ib, cone, a( i, i ), lda,
182  $ a( 1, i ), lda )
183  CALL clauu2( 'Upper', ib, a( i, i ), lda, info )
184  IF( i+ib.LE.n ) THEN
185  CALL cgemm( 'No transpose', 'Conjugate transpose',
186  $ i-1, ib, n-i-ib+1, cone, a( 1, i+ib ),
187  $ lda, a( i, i+ib ), lda, cone, a( 1, i ),
188  $ lda )
189  CALL cherk( 'Upper', 'No transpose', ib, n-i-ib+1,
190  $ one, a( i, i+ib ), lda, one, a( i, i ),
191  $ lda )
192  END IF
193  10 CONTINUE
194  ELSE
195 *
196 * Compute the product L**H * L.
197 *
198  DO 20 i = 1, n, nb
199  ib = min( nb, n-i+1 )
200  CALL ctrmm( 'Left', 'Lower', 'Conjugate transpose',
201  $ 'Non-unit', ib, i-1, cone, a( i, i ), lda,
202  $ a( i, 1 ), lda )
203  CALL clauu2( 'Lower', ib, a( i, i ), lda, info )
204  IF( i+ib.LE.n ) THEN
205  CALL cgemm( 'Conjugate transpose', 'No transpose', ib,
206  $ i-1, n-i-ib+1, cone, a( i+ib, i ), lda,
207  $ a( i+ib, 1 ), lda, cone, a( i, 1 ), lda )
208  CALL cherk( 'Lower', 'Conjugate transpose', ib,
209  $ n-i-ib+1, one, a( i+ib, i ), lda, one,
210  $ a( i, i ), lda )
211  END IF
212  20 CONTINUE
213  END IF
214  END IF
215 *
216  RETURN
217 *
218 * End of CLAUUM
219 *
integer function ilaenv(ISPEC, NAME, OPTS, N1, N2, N3, N4)
ILAENV
Definition: ilaenv.f:162
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine cgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CGEMM
Definition: cgemm.f:187
subroutine ctrmm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
CTRMM
Definition: ctrmm.f:177
subroutine cherk(UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC)
CHERK
Definition: cherk.f:173
subroutine clauu2(UPLO, N, A, LDA, INFO)
CLAUU2 computes the product UUH or LHL, where U and L are upper or lower triangular matrices (unblock...
Definition: clauu2.f:102
Here is the call graph for this function:
Here is the caller graph for this function: