3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE CSYMM(SIDE,UPLO,M,N,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
13 * .. Scalar Arguments ..
15 * INTEGER LDA,LDB,LDC,M,N
18 * .. Array Arguments ..
19 * COMPLEX A(LDA,*),B(LDB,*),C(LDC,*)
28 *> CSYMM performs one of the matrix-matrix operations
30 *> C := alpha*A*B + beta*C,
34 *> C := alpha*B*A + beta*C,
36 *> where alpha and beta are scalars, A is a symmetric matrix and B and
37 *> C are m by n matrices.
45 *> SIDE is CHARACTER*1
46 *> On entry, SIDE specifies whether the symmetric matrix A
47 *> appears on the left or right in the operation as follows:
49 *> SIDE = 'L' or 'l' C := alpha*A*B + beta*C,
51 *> SIDE = 'R' or 'r' C := alpha*B*A + beta*C,
56 *> UPLO is CHARACTER*1
57 *> On entry, UPLO specifies whether the upper or lower
58 *> triangular part of the symmetric matrix A is to be
59 *> referenced as follows:
61 *> UPLO = 'U' or 'u' Only the upper triangular part of the
62 *> symmetric matrix is to be referenced.
64 *> UPLO = 'L' or 'l' Only the lower triangular part of the
65 *> symmetric matrix is to be referenced.
71 *> On entry, M specifies the number of rows of the matrix C.
72 *> M must be at least zero.
78 *> On entry, N specifies the number of columns of the matrix C.
79 *> N must be at least zero.
85 *> On entry, ALPHA specifies the scalar alpha.
90 *> A is COMPLEX array of DIMENSION ( LDA, ka ), where ka is
91 *> m when SIDE = 'L' or 'l' and is n otherwise.
92 *> Before entry with SIDE = 'L' or 'l', the m by m part of
93 *> the array A must contain the symmetric matrix, such that
94 *> when UPLO = 'U' or 'u', the leading m by m upper triangular
95 *> part of the array A must contain the upper triangular part
96 *> of the symmetric matrix and the strictly lower triangular
97 *> part of A is not referenced, and when UPLO = 'L' or 'l',
98 *> the leading m by m lower triangular part of the array A
99 *> must contain the lower triangular part of the symmetric
100 *> matrix and the strictly upper triangular part of A is not
102 *> Before entry with SIDE = 'R' or 'r', the n by n part of
103 *> the array A must contain the symmetric matrix, such that
104 *> when UPLO = 'U' or 'u', the leading n by n upper triangular
105 *> part of the array A must contain the upper triangular part
106 *> of the symmetric matrix and the strictly lower triangular
107 *> part of A is not referenced, and when UPLO = 'L' or 'l',
108 *> the leading n by n lower triangular part of the array A
109 *> must contain the lower triangular part of the symmetric
110 *> matrix and the strictly upper triangular part of A is not
117 *> On entry, LDA specifies the first dimension of A as declared
118 *> in the calling (sub) program. When SIDE = 'L' or 'l' then
119 *> LDA must be at least max( 1, m ), otherwise LDA must be at
120 *> least max( 1, n ).
125 *> B is COMPLEX array of DIMENSION ( LDB, n ).
126 *> Before entry, the leading m by n part of the array B must
127 *> contain the matrix B.
133 *> On entry, LDB specifies the first dimension of B as declared
134 *> in the calling (sub) program. LDB must be at least
141 *> On entry, BETA specifies the scalar beta. When BETA is
142 *> supplied as zero then C need not be set on input.
147 *> C is COMPLEX array of DIMENSION ( LDC, n ).
148 *> Before entry, the leading m by n part of the array C must
149 *> contain the matrix C, except when beta is zero, in which
150 *> case C need not be set on entry.
151 *> On exit, the array C is overwritten by the m by n updated
158 *> On entry, LDC specifies the first dimension of C as declared
159 *> in the calling (sub) program. LDC must be at least
166 *> \author Univ. of Tennessee
167 *> \author Univ. of California Berkeley
168 *> \author Univ. of Colorado Denver
171 *> \date November 2011
173 *> \ingroup complex_blas_level3
175 *> \par Further Details:
176 * =====================
180 *> Level 3 Blas routine.
182 *> -- Written on 8-February-1989.
183 *> Jack Dongarra, Argonne National Laboratory.
184 *> Iain Duff, AERE Harwell.
185 *> Jeremy Du Croz, Numerical Algorithms Group Ltd.
186 *> Sven Hammarling, Numerical Algorithms Group Ltd.
189 * =====================================================================
190 SUBROUTINE CSYMM(SIDE,UPLO,M,N,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
192 * -- Reference BLAS level3 routine (version 3.4.0) --
193 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
194 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
197 * .. Scalar Arguments ..
199 INTEGER LDA,LDB,LDC,M,N
202 * .. Array Arguments ..
203 COMPLEX A(LDA,*),B(LDB,*),C(LDC,*)
206 * =====================================================================
208 * .. External Functions ..
212 * .. External Subroutines ..
215 * .. Intrinsic Functions ..
218 * .. Local Scalars ..
220 INTEGER I,INFO,J,K,NROWA
225 PARAMETER (ONE= (1.0E+0,0.0E+0))
227 PARAMETER (ZERO= (0.0E+0,0.0E+0))
230 * Set NROWA as the number of rows of A.
232 IF (LSAME(SIDE,'L')) THEN
237 UPPER = LSAME(UPLO,'U')
239 * Test the input parameters.
242 IF ((.NOT.LSAME(SIDE,'L')) .AND. (.NOT.LSAME(SIDE,'R'))) THEN
244 ELSE IF ((.NOT.UPPER) .AND. (.NOT.LSAME(UPLO,'L'))) THEN
246 ELSE IF (M.LT.0) THEN
248 ELSE IF (N.LT.0) THEN
250 ELSE IF (LDA.LT.MAX(1,NROWA)) THEN
252 ELSE IF (LDB.LT.MAX(1,M)) THEN
254 ELSE IF (LDC.LT.MAX(1,M)) THEN
258 CALL XERBLA('CSYMM ',INFO)
262 * Quick return if possible.
264 IF ((M.EQ.0) .OR. (N.EQ.0) .OR.
265 + ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE))) RETURN
267 * And when alpha.eq.zero.
269 IF (ALPHA.EQ.ZERO) THEN
270 IF (BETA.EQ.ZERO) THEN
286 * Start the operations.
288 IF (LSAME(SIDE,'L')) THEN
290 * Form C := alpha*A*B + beta*C.
298 C(K,J) = C(K,J) + TEMP1*A(K,I)
299 TEMP2 = TEMP2 + B(K,J)*A(K,I)
301 IF (BETA.EQ.ZERO) THEN
302 C(I,J) = TEMP1*A(I,I) + ALPHA*TEMP2
304 C(I,J) = BETA*C(I,J) + TEMP1*A(I,I) +
315 C(K,J) = C(K,J) + TEMP1*A(K,I)
316 TEMP2 = TEMP2 + B(K,J)*A(K,I)
318 IF (BETA.EQ.ZERO) THEN
319 C(I,J) = TEMP1*A(I,I) + ALPHA*TEMP2
321 C(I,J) = BETA*C(I,J) + TEMP1*A(I,I) +
329 * Form C := alpha*B*A + beta*C.
333 IF (BETA.EQ.ZERO) THEN
335 C(I,J) = TEMP1*B(I,J)
339 C(I,J) = BETA*C(I,J) + TEMP1*B(I,J)
349 C(I,J) = C(I,J) + TEMP1*B(I,K)
359 C(I,J) = C(I,J) + TEMP1*B(I,K)