LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
slauum.f
Go to the documentation of this file.
1 *> \brief \b SLAUUM computes the product UUH or LHL, where U and L are upper or lower triangular matrices (blocked algorithm).
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 *> \htmlonly
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slauum.f">
11 *> [TGZ]</a>
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slauum.f">
13 *> [ZIP]</a>
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slauum.f">
15 *> [TXT]</a>
16 *> \endhtmlonly
17 *
18 * Definition:
19 * ===========
20 *
21 * SUBROUTINE SLAUUM( UPLO, N, A, LDA, INFO )
22 *
23 * .. Scalar Arguments ..
24 * CHARACTER UPLO
25 * INTEGER INFO, LDA, N
26 * ..
27 * .. Array Arguments ..
28 * REAL A( LDA, * )
29 * ..
30 *
31 *
32 *> \par Purpose:
33 * =============
34 *>
35 *> \verbatim
36 *>
37 *> SLAUUM computes the product U * U**T or L**T * L, where the triangular
38 *> factor U or L is stored in the upper or lower triangular part of
39 *> the array A.
40 *>
41 *> If UPLO = 'U' or 'u' then the upper triangle of the result is stored,
42 *> overwriting the factor U in A.
43 *> If UPLO = 'L' or 'l' then the lower triangle of the result is stored,
44 *> overwriting the factor L in A.
45 *>
46 *> This is the blocked form of the algorithm, calling Level 3 BLAS.
47 *> \endverbatim
48 *
49 * Arguments:
50 * ==========
51 *
52 *> \param[in] UPLO
53 *> \verbatim
54 *> UPLO is CHARACTER*1
55 *> Specifies whether the triangular factor stored in the array A
56 *> is upper or lower triangular:
57 *> = 'U': Upper triangular
58 *> = 'L': Lower triangular
59 *> \endverbatim
60 *>
61 *> \param[in] N
62 *> \verbatim
63 *> N is INTEGER
64 *> The order of the triangular factor U or L. N >= 0.
65 *> \endverbatim
66 *>
67 *> \param[in,out] A
68 *> \verbatim
69 *> A is REAL array, dimension (LDA,N)
70 *> On entry, the triangular factor U or L.
71 *> On exit, if UPLO = 'U', the upper triangle of A is
72 *> overwritten with the upper triangle of the product U * U**T;
73 *> if UPLO = 'L', the lower triangle of A is overwritten with
74 *> the lower triangle of the product L**T * L.
75 *> \endverbatim
76 *>
77 *> \param[in] LDA
78 *> \verbatim
79 *> LDA is INTEGER
80 *> The leading dimension of the array A. LDA >= max(1,N).
81 *> \endverbatim
82 *>
83 *> \param[out] INFO
84 *> \verbatim
85 *> INFO is INTEGER
86 *> = 0: successful exit
87 *> < 0: if INFO = -k, the k-th argument had an illegal value
88 *> \endverbatim
89 *
90 * Authors:
91 * ========
92 *
93 *> \author Univ. of Tennessee
94 *> \author Univ. of California Berkeley
95 *> \author Univ. of Colorado Denver
96 *> \author NAG Ltd.
97 *
98 *> \date September 2012
99 *
100 *> \ingroup realOTHERauxiliary
101 *
102 * =====================================================================
103  SUBROUTINE slauum( UPLO, N, A, LDA, INFO )
104 *
105 * -- LAPACK auxiliary routine (version 3.4.2) --
106 * -- LAPACK is a software package provided by Univ. of Tennessee, --
107 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
108 * September 2012
109 *
110 * .. Scalar Arguments ..
111  CHARACTER UPLO
112  INTEGER INFO, LDA, N
113 * ..
114 * .. Array Arguments ..
115  REAL A( lda, * )
116 * ..
117 *
118 * =====================================================================
119 *
120 * .. Parameters ..
121  REAL ONE
122  parameter ( one = 1.0e+0 )
123 * ..
124 * .. Local Scalars ..
125  LOGICAL UPPER
126  INTEGER I, IB, NB
127 * ..
128 * .. External Functions ..
129  LOGICAL LSAME
130  INTEGER ILAENV
131  EXTERNAL lsame, ilaenv
132 * ..
133 * .. External Subroutines ..
134  EXTERNAL sgemm, slauu2, ssyrk, strmm, xerbla
135 * ..
136 * .. Intrinsic Functions ..
137  INTRINSIC max, min
138 * ..
139 * .. Executable Statements ..
140 *
141 * Test the input parameters.
142 *
143  info = 0
144  upper = lsame( uplo, 'U' )
145  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
146  info = -1
147  ELSE IF( n.LT.0 ) THEN
148  info = -2
149  ELSE IF( lda.LT.max( 1, n ) ) THEN
150  info = -4
151  END IF
152  IF( info.NE.0 ) THEN
153  CALL xerbla( 'SLAUUM', -info )
154  RETURN
155  END IF
156 *
157 * Quick return if possible
158 *
159  IF( n.EQ.0 )
160  \$ RETURN
161 *
162 * Determine the block size for this environment.
163 *
164  nb = ilaenv( 1, 'SLAUUM', uplo, n, -1, -1, -1 )
165 *
166  IF( nb.LE.1 .OR. nb.GE.n ) THEN
167 *
168 * Use unblocked code
169 *
170  CALL slauu2( uplo, n, a, lda, info )
171  ELSE
172 *
173 * Use blocked code
174 *
175  IF( upper ) THEN
176 *
177 * Compute the product U * U**T.
178 *
179  DO 10 i = 1, n, nb
180  ib = min( nb, n-i+1 )
181  CALL strmm( 'Right', 'Upper', 'Transpose', 'Non-unit',
182  \$ i-1, ib, one, a( i, i ), lda, a( 1, i ),
183  \$ lda )
184  CALL slauu2( 'Upper', ib, a( i, i ), lda, info )
185  IF( i+ib.LE.n ) THEN
186  CALL sgemm( 'No transpose', 'Transpose', i-1, ib,
187  \$ n-i-ib+1, one, a( 1, i+ib ), lda,
188  \$ a( i, i+ib ), lda, one, a( 1, i ), lda )
189  CALL ssyrk( '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**T * L.
197 *
198  DO 20 i = 1, n, nb
199  ib = min( nb, n-i+1 )
200  CALL strmm( 'Left', 'Lower', 'Transpose', 'Non-unit', ib,
201  \$ i-1, one, a( i, i ), lda, a( i, 1 ), lda )
202  CALL slauu2( 'Lower', ib, a( i, i ), lda, info )
203  IF( i+ib.LE.n ) THEN
204  CALL sgemm( 'Transpose', 'No transpose', ib, i-1,
205  \$ n-i-ib+1, one, a( i+ib, i ), lda,
206  \$ a( i+ib, 1 ), lda, one, a( i, 1 ), lda )
207  CALL ssyrk( 'Lower', 'Transpose', ib, n-i-ib+1, one,
208  \$ a( i+ib, i ), lda, one, a( i, i ), lda )
209  END IF
210  20 CONTINUE
211  END IF
212  END IF
213 *
214  RETURN
215 *
216 * End of SLAUUM
217 *
218  END
subroutine ssyrk(UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC)
SSYRK
Definition: ssyrk.f:171
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM
Definition: sgemm.f:189
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
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:104
subroutine strmm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
STRMM
Definition: strmm.f:179
subroutine slauum(UPLO, N, A, LDA, INFO)
SLAUUM computes the product UUH or LHL, where U and L are upper or lower triangular matrices (blocked...
Definition: slauum.f:104