LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ slauum()

subroutine slauum ( character uplo,
integer n,
real, dimension( lda, * ) a,
integer lda,
integer info )

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

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

Purpose:
!>
!> SLAUUM computes the product U * U**T or L**T * 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 REAL 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**T;
!>          if UPLO = 'L', the lower triangle of A is overwritten with
!>          the lower triangle of the product L**T * 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 99 of file slauum.f.

100*
101* -- LAPACK auxiliary routine --
102* -- LAPACK is a software package provided by Univ. of Tennessee, --
103* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
104*
105* .. Scalar Arguments ..
106 CHARACTER UPLO
107 INTEGER INFO, LDA, N
108* ..
109* .. Array Arguments ..
110 REAL A( LDA, * )
111* ..
112*
113* =====================================================================
114*
115* .. Parameters ..
116 REAL ONE
117 parameter( one = 1.0e+0 )
118* ..
119* .. Local Scalars ..
120 LOGICAL UPPER
121 INTEGER I, IB, NB
122* ..
123* .. External Functions ..
124 LOGICAL LSAME
125 INTEGER ILAENV
126 EXTERNAL lsame, ilaenv
127* ..
128* .. External Subroutines ..
129 EXTERNAL sgemm, slauu2, ssyrk, strmm, xerbla
130* ..
131* .. Intrinsic Functions ..
132 INTRINSIC max, min
133* ..
134* .. Executable Statements ..
135*
136* Test the input parameters.
137*
138 info = 0
139 upper = lsame( uplo, 'U' )
140 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
141 info = -1
142 ELSE IF( n.LT.0 ) THEN
143 info = -2
144 ELSE IF( lda.LT.max( 1, n ) ) THEN
145 info = -4
146 END IF
147 IF( info.NE.0 ) THEN
148 CALL xerbla( 'SLAUUM', -info )
149 RETURN
150 END IF
151*
152* Quick return if possible
153*
154 IF( n.EQ.0 )
155 $ RETURN
156*
157* Determine the block size for this environment.
158*
159 nb = ilaenv( 1, 'SLAUUM', uplo, n, -1, -1, -1 )
160*
161 IF( nb.LE.1 .OR. nb.GE.n ) THEN
162*
163* Use unblocked code
164*
165 CALL slauu2( uplo, n, a, lda, info )
166 ELSE
167*
168* Use blocked code
169*
170 IF( upper ) THEN
171*
172* Compute the product U * U**T.
173*
174 DO 10 i = 1, n, nb
175 ib = min( nb, n-i+1 )
176 CALL strmm( 'Right', 'Upper', 'Transpose', 'Non-unit',
177 $ i-1, ib, one, a( i, i ), lda, a( 1, i ),
178 $ lda )
179 CALL slauu2( 'Upper', ib, a( i, i ), lda, info )
180 IF( i+ib.LE.n ) THEN
181 CALL sgemm( 'No transpose', 'Transpose', i-1, ib,
182 $ n-i-ib+1, one, a( 1, i+ib ), lda,
183 $ a( i, i+ib ), lda, one, a( 1, i ), lda )
184 CALL ssyrk( 'Upper', 'No transpose', ib, n-i-ib+1,
185 $ one, a( i, i+ib ), lda, one, a( i, i ),
186 $ lda )
187 END IF
188 10 CONTINUE
189 ELSE
190*
191* Compute the product L**T * L.
192*
193 DO 20 i = 1, n, nb
194 ib = min( nb, n-i+1 )
195 CALL strmm( 'Left', 'Lower', 'Transpose', 'Non-unit',
196 $ ib,
197 $ i-1, one, a( i, i ), lda, a( i, 1 ), lda )
198 CALL slauu2( 'Lower', ib, a( i, i ), lda, info )
199 IF( i+ib.LE.n ) THEN
200 CALL sgemm( 'Transpose', 'No transpose', ib, i-1,
201 $ n-i-ib+1, one, a( i+ib, i ), lda,
202 $ a( i+ib, 1 ), lda, one, a( i, 1 ), lda )
203 CALL ssyrk( 'Lower', 'Transpose', ib, n-i-ib+1,
204 $ one,
205 $ a( i+ib, i ), lda, one, a( i, i ), lda )
206 END IF
207 20 CONTINUE
208 END IF
209 END IF
210*
211 RETURN
212*
213* End of SLAUUM
214*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
Definition sgemm.f:188
subroutine ssyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
SSYRK
Definition ssyrk.f:169
integer function ilaenv(ispec, name, opts, n1, n2, n3, n4)
ILAENV
Definition ilaenv.f:160
subroutine slauu2(uplo, n, a, lda, info)
SLAUU2 computes the product UUH or LHL, where U and L are upper or lower triangular matrices (unblock...
Definition slauu2.f:100
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine strmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
STRMM
Definition strmm.f:177
Here is the call graph for this function:
Here is the caller graph for this function: