LAPACK  3.6.0 LAPACK: Linear Algebra PACKage
Collaboration diagram for real:


This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.

## Functions

subroutine sgemm (TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM More...

subroutine ssymm (SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SSYMM More...

subroutine ssyr2k (UPLO, TRANS, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SSYR2K More...

subroutine ssyrk (UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC)
SSYRK More...

subroutine strmm (SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
STRMM More...

subroutine strsm (SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
STRSM More...

## Detailed Description

This is the group of real LEVEL 3 BLAS routines.

## Function Documentation

 subroutine sgemm ( character TRANSA, character TRANSB, integer M, integer N, integer K, real ALPHA, real, dimension(lda,*) A, integer LDA, real, dimension(ldb,*) B, integer LDB, real BETA, real, dimension(ldc,*) C, integer LDC )

SGEMM

Purpose:
``` SGEMM  performs one of the matrix-matrix operations

C := alpha*op( A )*op( B ) + beta*C,

where  op( X ) is one of

op( X ) = X   or   op( X ) = X**T,

alpha and beta are scalars, and A, B and C are matrices, with op( A )
an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix.```
Parameters
 [in] TRANSA ``` TRANSA is CHARACTER*1 On entry, TRANSA specifies the form of op( A ) to be used in the matrix multiplication as follows: TRANSA = 'N' or 'n', op( A ) = A. TRANSA = 'T' or 't', op( A ) = A**T. TRANSA = 'C' or 'c', op( A ) = A**T.``` [in] TRANSB ``` TRANSB is CHARACTER*1 On entry, TRANSB specifies the form of op( B ) to be used in the matrix multiplication as follows: TRANSB = 'N' or 'n', op( B ) = B. TRANSB = 'T' or 't', op( B ) = B**T. TRANSB = 'C' or 'c', op( B ) = B**T.``` [in] M ``` M is INTEGER On entry, M specifies the number of rows of the matrix op( A ) and of the matrix C. M must be at least zero.``` [in] N ``` N is INTEGER On entry, N specifies the number of columns of the matrix op( B ) and the number of columns of the matrix C. N must be at least zero.``` [in] K ``` K is INTEGER On entry, K specifies the number of columns of the matrix op( A ) and the number of rows of the matrix op( B ). K must be at least zero.``` [in] ALPHA ``` ALPHA is REAL On entry, ALPHA specifies the scalar alpha.``` [in] A ``` A is REAL array of DIMENSION ( LDA, ka ), where ka is k when TRANSA = 'N' or 'n', and is m otherwise. Before entry with TRANSA = 'N' or 'n', the leading m by k part of the array A must contain the matrix A, otherwise the leading k by m part of the array A must contain the matrix A.``` [in] LDA ``` LDA is INTEGER On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANSA = 'N' or 'n' then LDA must be at least max( 1, m ), otherwise LDA must be at least max( 1, k ).``` [in] B ``` B is REAL array of DIMENSION ( LDB, kb ), where kb is n when TRANSB = 'N' or 'n', and is k otherwise. Before entry with TRANSB = 'N' or 'n', the leading k by n part of the array B must contain the matrix B, otherwise the leading n by k part of the array B must contain the matrix B.``` [in] LDB ``` LDB is INTEGER On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANSB = 'N' or 'n' then LDB must be at least max( 1, k ), otherwise LDB must be at least max( 1, n ).``` [in] BETA ``` BETA is REAL On entry, BETA specifies the scalar beta. When BETA is supplied as zero then C need not be set on input.``` [in,out] C ``` C is REAL array of DIMENSION ( LDC, n ). Before entry, the leading m by n part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the array C is overwritten by the m by n matrix ( alpha*op( A )*op( B ) + beta*C ).``` [in] LDC ``` LDC is INTEGER On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, m ).```
Date
November 2015
Further Details:
```  Level 3 Blas routine.

-- Written on 8-February-1989.
Jack Dongarra, Argonne National Laboratory.
Iain Duff, AERE Harwell.
Jeremy Du Croz, Numerical Algorithms Group Ltd.
Sven Hammarling, Numerical Algorithms Group Ltd.```

Definition at line 189 of file sgemm.f.

189 *
190 * -- Reference BLAS level3 routine (version 3.6.0) --
191 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
192 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
193 * November 2015
194 *
195 * .. Scalar Arguments ..
196  REAL alpha,beta
197  INTEGER k,lda,ldb,ldc,m,n
198  CHARACTER transa,transb
199 * ..
200 * .. Array Arguments ..
201  REAL a(lda,*),b(ldb,*),c(ldc,*)
202 * ..
203 *
204 * =====================================================================
205 *
206 * .. External Functions ..
207  LOGICAL lsame
208  EXTERNAL lsame
209 * ..
210 * .. External Subroutines ..
211  EXTERNAL xerbla
212 * ..
213 * .. Intrinsic Functions ..
214  INTRINSIC max
215 * ..
216 * .. Local Scalars ..
217  REAL temp
218  INTEGER i,info,j,l,ncola,nrowa,nrowb
219  LOGICAL nota,notb
220 * ..
221 * .. Parameters ..
222  REAL one,zero
223  parameter(one=1.0e+0,zero=0.0e+0)
224 * ..
225 *
226 * Set NOTA and NOTB as true if A and B respectively are not
227 * transposed and set NROWA, NCOLA and NROWB as the number of rows
228 * and columns of A and the number of rows of B respectively.
229 *
230  nota = lsame(transa,'N')
231  notb = lsame(transb,'N')
232  IF (nota) THEN
233  nrowa = m
234  ncola = k
235  ELSE
236  nrowa = k
237  ncola = m
238  END IF
239  IF (notb) THEN
240  nrowb = k
241  ELSE
242  nrowb = n
243  END IF
244 *
245 * Test the input parameters.
246 *
247  info = 0
248  IF ((.NOT.nota) .AND. (.NOT.lsame(transa,'C')) .AND.
249  + (.NOT.lsame(transa,'T'))) THEN
250  info = 1
251  ELSE IF ((.NOT.notb) .AND. (.NOT.lsame(transb,'C')) .AND.
252  + (.NOT.lsame(transb,'T'))) THEN
253  info = 2
254  ELSE IF (m.LT.0) THEN
255  info = 3
256  ELSE IF (n.LT.0) THEN
257  info = 4
258  ELSE IF (k.LT.0) THEN
259  info = 5
260  ELSE IF (lda.LT.max(1,nrowa)) THEN
261  info = 8
262  ELSE IF (ldb.LT.max(1,nrowb)) THEN
263  info = 10
264  ELSE IF (ldc.LT.max(1,m)) THEN
265  info = 13
266  END IF
267  IF (info.NE.0) THEN
268  CALL xerbla('SGEMM ',info)
269  RETURN
270  END IF
271 *
272 * Quick return if possible.
273 *
274  IF ((m.EQ.0) .OR. (n.EQ.0) .OR.
275  + (((alpha.EQ.zero).OR. (k.EQ.0)).AND. (beta.EQ.one))) RETURN
276 *
277 * And if alpha.eq.zero.
278 *
279  IF (alpha.EQ.zero) THEN
280  IF (beta.EQ.zero) THEN
281  DO 20 j = 1,n
282  DO 10 i = 1,m
283  c(i,j) = zero
284  10 CONTINUE
285  20 CONTINUE
286  ELSE
287  DO 40 j = 1,n
288  DO 30 i = 1,m
289  c(i,j) = beta*c(i,j)
290  30 CONTINUE
291  40 CONTINUE
292  END IF
293  RETURN
294  END IF
295 *
296 * Start the operations.
297 *
298  IF (notb) THEN
299  IF (nota) THEN
300 *
301 * Form C := alpha*A*B + beta*C.
302 *
303  DO 90 j = 1,n
304  IF (beta.EQ.zero) THEN
305  DO 50 i = 1,m
306  c(i,j) = zero
307  50 CONTINUE
308  ELSE IF (beta.NE.one) THEN
309  DO 60 i = 1,m
310  c(i,j) = beta*c(i,j)
311  60 CONTINUE
312  END IF
313  DO 80 l = 1,k
314  temp = alpha*b(l,j)
315  DO 70 i = 1,m
316  c(i,j) = c(i,j) + temp*a(i,l)
317  70 CONTINUE
318  80 CONTINUE
319  90 CONTINUE
320  ELSE
321 *
322 * Form C := alpha*A**T*B + beta*C
323 *
324  DO 120 j = 1,n
325  DO 110 i = 1,m
326  temp = zero
327  DO 100 l = 1,k
328  temp = temp + a(l,i)*b(l,j)
329  100 CONTINUE
330  IF (beta.EQ.zero) THEN
331  c(i,j) = alpha*temp
332  ELSE
333  c(i,j) = alpha*temp + beta*c(i,j)
334  END IF
335  110 CONTINUE
336  120 CONTINUE
337  END IF
338  ELSE
339  IF (nota) THEN
340 *
341 * Form C := alpha*A*B**T + beta*C
342 *
343  DO 170 j = 1,n
344  IF (beta.EQ.zero) THEN
345  DO 130 i = 1,m
346  c(i,j) = zero
347  130 CONTINUE
348  ELSE IF (beta.NE.one) THEN
349  DO 140 i = 1,m
350  c(i,j) = beta*c(i,j)
351  140 CONTINUE
352  END IF
353  DO 160 l = 1,k
354  temp = alpha*b(j,l)
355  DO 150 i = 1,m
356  c(i,j) = c(i,j) + temp*a(i,l)
357  150 CONTINUE
358  160 CONTINUE
359  170 CONTINUE
360  ELSE
361 *
362 * Form C := alpha*A**T*B**T + beta*C
363 *
364  DO 200 j = 1,n
365  DO 190 i = 1,m
366  temp = zero
367  DO 180 l = 1,k
368  temp = temp + a(l,i)*b(j,l)
369  180 CONTINUE
370  IF (beta.EQ.zero) THEN
371  c(i,j) = alpha*temp
372  ELSE
373  c(i,j) = alpha*temp + beta*c(i,j)
374  END IF
375  190 CONTINUE
376  200 CONTINUE
377  END IF
378  END IF
379 *
380  RETURN
381 *
382 * End of SGEMM .
383 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

 subroutine ssymm ( character SIDE, character UPLO, integer M, integer N, real ALPHA, real, dimension(lda,*) A, integer LDA, real, dimension(ldb,*) B, integer LDB, real BETA, real, dimension(ldc,*) C, integer LDC )

SSYMM

Purpose:
``` SSYMM  performs one of the matrix-matrix operations

C := alpha*A*B + beta*C,

or

C := alpha*B*A + beta*C,

where alpha and beta are scalars,  A is a symmetric matrix and  B and
C are  m by n matrices.```
Parameters
 [in] SIDE ``` SIDE is CHARACTER*1 On entry, SIDE specifies whether the symmetric matrix A appears on the left or right in the operation as follows: SIDE = 'L' or 'l' C := alpha*A*B + beta*C, SIDE = 'R' or 'r' C := alpha*B*A + beta*C,``` [in] UPLO ``` UPLO is CHARACTER*1 On entry, UPLO specifies whether the upper or lower triangular part of the symmetric matrix A is to be referenced as follows: UPLO = 'U' or 'u' Only the upper triangular part of the symmetric matrix is to be referenced. UPLO = 'L' or 'l' Only the lower triangular part of the symmetric matrix is to be referenced.``` [in] M ``` M is INTEGER On entry, M specifies the number of rows of the matrix C. M must be at least zero.``` [in] N ``` N is INTEGER On entry, N specifies the number of columns of the matrix C. N must be at least zero.``` [in] ALPHA ``` ALPHA is REAL On entry, ALPHA specifies the scalar alpha.``` [in] A ``` A is REAL array of DIMENSION ( LDA, ka ), where ka is m when SIDE = 'L' or 'l' and is n otherwise. Before entry with SIDE = 'L' or 'l', the m by m part of the array A must contain the symmetric matrix, such that when UPLO = 'U' or 'u', the leading m by m upper triangular part of the array A must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of A is not referenced, and when UPLO = 'L' or 'l', the leading m by m lower triangular part of the array A must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of A is not referenced. Before entry with SIDE = 'R' or 'r', the n by n part of the array A must contain the symmetric matrix, such that when UPLO = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of A is not referenced, and when UPLO = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of A is not referenced.``` [in] LDA ``` LDA is INTEGER On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When SIDE = 'L' or 'l' then LDA must be at least max( 1, m ), otherwise LDA must be at least max( 1, n ).``` [in] B ``` B is REAL array of DIMENSION ( LDB, n ). Before entry, the leading m by n part of the array B must contain the matrix B.``` [in] LDB ``` LDB is INTEGER On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. LDB must be at least max( 1, m ).``` [in] BETA ``` BETA is REAL On entry, BETA specifies the scalar beta. When BETA is supplied as zero then C need not be set on input.``` [in,out] C ``` C is REAL array of DIMENSION ( LDC, n ). Before entry, the leading m by n part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the array C is overwritten by the m by n updated matrix.``` [in] LDC ``` LDC is INTEGER On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, m ).```
Date
November 2011
Further Details:
```  Level 3 Blas routine.

-- Written on 8-February-1989.
Jack Dongarra, Argonne National Laboratory.
Iain Duff, AERE Harwell.
Jeremy Du Croz, Numerical Algorithms Group Ltd.
Sven Hammarling, Numerical Algorithms Group Ltd.```

Definition at line 191 of file ssymm.f.

191 *
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..--
195 * November 2011
196 *
197 * .. Scalar Arguments ..
198  REAL alpha,beta
199  INTEGER lda,ldb,ldc,m,n
200  CHARACTER side,uplo
201 * ..
202 * .. Array Arguments ..
203  REAL a(lda,*),b(ldb,*),c(ldc,*)
204 * ..
205 *
206 * =====================================================================
207 *
208 * .. External Functions ..
209  LOGICAL lsame
210  EXTERNAL lsame
211 * ..
212 * .. External Subroutines ..
213  EXTERNAL xerbla
214 * ..
215 * .. Intrinsic Functions ..
216  INTRINSIC max
217 * ..
218 * .. Local Scalars ..
219  REAL temp1,temp2
220  INTEGER i,info,j,k,nrowa
221  LOGICAL upper
222 * ..
223 * .. Parameters ..
224  REAL one,zero
225  parameter(one=1.0e+0,zero=0.0e+0)
226 * ..
227 *
228 * Set NROWA as the number of rows of A.
229 *
230  IF (lsame(side,'L')) THEN
231  nrowa = m
232  ELSE
233  nrowa = n
234  END IF
235  upper = lsame(uplo,'U')
236 *
237 * Test the input parameters.
238 *
239  info = 0
240  IF ((.NOT.lsame(side,'L')) .AND. (.NOT.lsame(side,'R'))) THEN
241  info = 1
242  ELSE IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,'L'))) THEN
243  info = 2
244  ELSE IF (m.LT.0) THEN
245  info = 3
246  ELSE IF (n.LT.0) THEN
247  info = 4
248  ELSE IF (lda.LT.max(1,nrowa)) THEN
249  info = 7
250  ELSE IF (ldb.LT.max(1,m)) THEN
251  info = 9
252  ELSE IF (ldc.LT.max(1,m)) THEN
253  info = 12
254  END IF
255  IF (info.NE.0) THEN
256  CALL xerbla('SSYMM ',info)
257  RETURN
258  END IF
259 *
260 * Quick return if possible.
261 *
262  IF ((m.EQ.0) .OR. (n.EQ.0) .OR.
263  + ((alpha.EQ.zero).AND. (beta.EQ.one))) RETURN
264 *
265 * And when alpha.eq.zero.
266 *
267  IF (alpha.EQ.zero) THEN
268  IF (beta.EQ.zero) THEN
269  DO 20 j = 1,n
270  DO 10 i = 1,m
271  c(i,j) = zero
272  10 CONTINUE
273  20 CONTINUE
274  ELSE
275  DO 40 j = 1,n
276  DO 30 i = 1,m
277  c(i,j) = beta*c(i,j)
278  30 CONTINUE
279  40 CONTINUE
280  END IF
281  RETURN
282  END IF
283 *
284 * Start the operations.
285 *
286  IF (lsame(side,'L')) THEN
287 *
288 * Form C := alpha*A*B + beta*C.
289 *
290  IF (upper) THEN
291  DO 70 j = 1,n
292  DO 60 i = 1,m
293  temp1 = alpha*b(i,j)
294  temp2 = zero
295  DO 50 k = 1,i - 1
296  c(k,j) = c(k,j) + temp1*a(k,i)
297  temp2 = temp2 + b(k,j)*a(k,i)
298  50 CONTINUE
299  IF (beta.EQ.zero) THEN
300  c(i,j) = temp1*a(i,i) + alpha*temp2
301  ELSE
302  c(i,j) = beta*c(i,j) + temp1*a(i,i) +
303  + alpha*temp2
304  END IF
305  60 CONTINUE
306  70 CONTINUE
307  ELSE
308  DO 100 j = 1,n
309  DO 90 i = m,1,-1
310  temp1 = alpha*b(i,j)
311  temp2 = zero
312  DO 80 k = i + 1,m
313  c(k,j) = c(k,j) + temp1*a(k,i)
314  temp2 = temp2 + b(k,j)*a(k,i)
315  80 CONTINUE
316  IF (beta.EQ.zero) THEN
317  c(i,j) = temp1*a(i,i) + alpha*temp2
318  ELSE
319  c(i,j) = beta*c(i,j) + temp1*a(i,i) +
320  + alpha*temp2
321  END IF
322  90 CONTINUE
323  100 CONTINUE
324  END IF
325  ELSE
326 *
327 * Form C := alpha*B*A + beta*C.
328 *
329  DO 170 j = 1,n
330  temp1 = alpha*a(j,j)
331  IF (beta.EQ.zero) THEN
332  DO 110 i = 1,m
333  c(i,j) = temp1*b(i,j)
334  110 CONTINUE
335  ELSE
336  DO 120 i = 1,m
337  c(i,j) = beta*c(i,j) + temp1*b(i,j)
338  120 CONTINUE
339  END IF
340  DO 140 k = 1,j - 1
341  IF (upper) THEN
342  temp1 = alpha*a(k,j)
343  ELSE
344  temp1 = alpha*a(j,k)
345  END IF
346  DO 130 i = 1,m
347  c(i,j) = c(i,j) + temp1*b(i,k)
348  130 CONTINUE
349  140 CONTINUE
350  DO 160 k = j + 1,n
351  IF (upper) THEN
352  temp1 = alpha*a(j,k)
353  ELSE
354  temp1 = alpha*a(k,j)
355  END IF
356  DO 150 i = 1,m
357  c(i,j) = c(i,j) + temp1*b(i,k)
358  150 CONTINUE
359  160 CONTINUE
360  170 CONTINUE
361  END IF
362 *
363  RETURN
364 *
365 * End of SSYMM .
366 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine ssyr2k ( character UPLO, character TRANS, integer N, integer K, real ALPHA, real, dimension(lda,*) A, integer LDA, real, dimension(ldb,*) B, integer LDB, real BETA, real, dimension(ldc,*) C, integer LDC )

SSYR2K

Purpose:
``` SSYR2K  performs one of the symmetric rank 2k operations

C := alpha*A*B**T + alpha*B*A**T + beta*C,

or

C := alpha*A**T*B + alpha*B**T*A + beta*C,

where  alpha and beta  are scalars, C is an  n by n  symmetric matrix
and  A and B  are  n by k  matrices  in the  first  case  and  k by n
matrices in the second case.```
Parameters
 [in] UPLO ``` UPLO is CHARACTER*1 On entry, UPLO specifies whether the upper or lower triangular part of the array C is to be referenced as follows: UPLO = 'U' or 'u' Only the upper triangular part of C is to be referenced. UPLO = 'L' or 'l' Only the lower triangular part of C is to be referenced.``` [in] TRANS ``` TRANS is CHARACTER*1 On entry, TRANS specifies the operation to be performed as follows: TRANS = 'N' or 'n' C := alpha*A*B**T + alpha*B*A**T + beta*C. TRANS = 'T' or 't' C := alpha*A**T*B + alpha*B**T*A + beta*C. TRANS = 'C' or 'c' C := alpha*A**T*B + alpha*B**T*A + beta*C.``` [in] N ``` N is INTEGER On entry, N specifies the order of the matrix C. N must be at least zero.``` [in] K ``` K is INTEGER On entry with TRANS = 'N' or 'n', K specifies the number of columns of the matrices A and B, and on entry with TRANS = 'T' or 't' or 'C' or 'c', K specifies the number of rows of the matrices A and B. K must be at least zero.``` [in] ALPHA ``` ALPHA is REAL On entry, ALPHA specifies the scalar alpha.``` [in] A ``` A is REAL array of DIMENSION ( LDA, ka ), where ka is k when TRANS = 'N' or 'n', and is n otherwise. Before entry with TRANS = 'N' or 'n', the leading n by k part of the array A must contain the matrix A, otherwise the leading k by n part of the array A must contain the matrix A.``` [in] LDA ``` LDA is INTEGER On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANS = 'N' or 'n' then LDA must be at least max( 1, n ), otherwise LDA must be at least max( 1, k ).``` [in] B ``` B is REAL array of DIMENSION ( LDB, kb ), where kb is k when TRANS = 'N' or 'n', and is n otherwise. Before entry with TRANS = 'N' or 'n', the leading n by k part of the array B must contain the matrix B, otherwise the leading k by n part of the array B must contain the matrix B.``` [in] LDB ``` LDB is INTEGER On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANS = 'N' or 'n' then LDB must be at least max( 1, n ), otherwise LDB must be at least max( 1, k ).``` [in] BETA ``` BETA is REAL On entry, BETA specifies the scalar beta.``` [in,out] C ``` C is REAL array of DIMENSION ( LDC, n ). Before entry with UPLO = 'U' or 'u', the leading n by n upper triangular part of the array C must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of C is not referenced. On exit, the upper triangular part of the array C is overwritten by the upper triangular part of the updated matrix. Before entry with UPLO = 'L' or 'l', the leading n by n lower triangular part of the array C must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of C is not referenced. On exit, the lower triangular part of the array C is overwritten by the lower triangular part of the updated matrix.``` [in] LDC ``` LDC is INTEGER On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, n ).```
Date
November 2011
Further Details:
```  Level 3 Blas routine.

-- Written on 8-February-1989.
Jack Dongarra, Argonne National Laboratory.
Iain Duff, AERE Harwell.
Jeremy Du Croz, Numerical Algorithms Group Ltd.
Sven Hammarling, Numerical Algorithms Group Ltd.```

Definition at line 194 of file ssyr2k.f.

194 *
195 * -- Reference BLAS level3 routine (version 3.4.0) --
196 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
197 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
198 * November 2011
199 *
200 * .. Scalar Arguments ..
201  REAL alpha,beta
202  INTEGER k,lda,ldb,ldc,n
203  CHARACTER trans,uplo
204 * ..
205 * .. Array Arguments ..
206  REAL a(lda,*),b(ldb,*),c(ldc,*)
207 * ..
208 *
209 * =====================================================================
210 *
211 * .. External Functions ..
212  LOGICAL lsame
213  EXTERNAL lsame
214 * ..
215 * .. External Subroutines ..
216  EXTERNAL xerbla
217 * ..
218 * .. Intrinsic Functions ..
219  INTRINSIC max
220 * ..
221 * .. Local Scalars ..
222  REAL temp1,temp2
223  INTEGER i,info,j,l,nrowa
224  LOGICAL upper
225 * ..
226 * .. Parameters ..
227  REAL one,zero
228  parameter(one=1.0e+0,zero=0.0e+0)
229 * ..
230 *
231 * Test the input parameters.
232 *
233  IF (lsame(trans,'N')) THEN
234  nrowa = n
235  ELSE
236  nrowa = k
237  END IF
238  upper = lsame(uplo,'U')
239 *
240  info = 0
241  IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,'L'))) THEN
242  info = 1
243  ELSE IF ((.NOT.lsame(trans,'N')) .AND.
244  + (.NOT.lsame(trans,'T')) .AND.
245  + (.NOT.lsame(trans,'C'))) THEN
246  info = 2
247  ELSE IF (n.LT.0) THEN
248  info = 3
249  ELSE IF (k.LT.0) THEN
250  info = 4
251  ELSE IF (lda.LT.max(1,nrowa)) THEN
252  info = 7
253  ELSE IF (ldb.LT.max(1,nrowa)) THEN
254  info = 9
255  ELSE IF (ldc.LT.max(1,n)) THEN
256  info = 12
257  END IF
258  IF (info.NE.0) THEN
259  CALL xerbla('SSYR2K',info)
260  RETURN
261  END IF
262 *
263 * Quick return if possible.
264 *
265  IF ((n.EQ.0) .OR. (((alpha.EQ.zero).OR.
266  + (k.EQ.0)).AND. (beta.EQ.one))) RETURN
267 *
268 * And when alpha.eq.zero.
269 *
270  IF (alpha.EQ.zero) THEN
271  IF (upper) THEN
272  IF (beta.EQ.zero) THEN
273  DO 20 j = 1,n
274  DO 10 i = 1,j
275  c(i,j) = zero
276  10 CONTINUE
277  20 CONTINUE
278  ELSE
279  DO 40 j = 1,n
280  DO 30 i = 1,j
281  c(i,j) = beta*c(i,j)
282  30 CONTINUE
283  40 CONTINUE
284  END IF
285  ELSE
286  IF (beta.EQ.zero) THEN
287  DO 60 j = 1,n
288  DO 50 i = j,n
289  c(i,j) = zero
290  50 CONTINUE
291  60 CONTINUE
292  ELSE
293  DO 80 j = 1,n
294  DO 70 i = j,n
295  c(i,j) = beta*c(i,j)
296  70 CONTINUE
297  80 CONTINUE
298  END IF
299  END IF
300  RETURN
301  END IF
302 *
303 * Start the operations.
304 *
305  IF (lsame(trans,'N')) THEN
306 *
307 * Form C := alpha*A*B**T + alpha*B*A**T + C.
308 *
309  IF (upper) THEN
310  DO 130 j = 1,n
311  IF (beta.EQ.zero) THEN
312  DO 90 i = 1,j
313  c(i,j) = zero
314  90 CONTINUE
315  ELSE IF (beta.NE.one) THEN
316  DO 100 i = 1,j
317  c(i,j) = beta*c(i,j)
318  100 CONTINUE
319  END IF
320  DO 120 l = 1,k
321  IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero)) THEN
322  temp1 = alpha*b(j,l)
323  temp2 = alpha*a(j,l)
324  DO 110 i = 1,j
325  c(i,j) = c(i,j) + a(i,l)*temp1 +
326  + b(i,l)*temp2
327  110 CONTINUE
328  END IF
329  120 CONTINUE
330  130 CONTINUE
331  ELSE
332  DO 180 j = 1,n
333  IF (beta.EQ.zero) THEN
334  DO 140 i = j,n
335  c(i,j) = zero
336  140 CONTINUE
337  ELSE IF (beta.NE.one) THEN
338  DO 150 i = j,n
339  c(i,j) = beta*c(i,j)
340  150 CONTINUE
341  END IF
342  DO 170 l = 1,k
343  IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero)) THEN
344  temp1 = alpha*b(j,l)
345  temp2 = alpha*a(j,l)
346  DO 160 i = j,n
347  c(i,j) = c(i,j) + a(i,l)*temp1 +
348  + b(i,l)*temp2
349  160 CONTINUE
350  END IF
351  170 CONTINUE
352  180 CONTINUE
353  END IF
354  ELSE
355 *
356 * Form C := alpha*A**T*B + alpha*B**T*A + C.
357 *
358  IF (upper) THEN
359  DO 210 j = 1,n
360  DO 200 i = 1,j
361  temp1 = zero
362  temp2 = zero
363  DO 190 l = 1,k
364  temp1 = temp1 + a(l,i)*b(l,j)
365  temp2 = temp2 + b(l,i)*a(l,j)
366  190 CONTINUE
367  IF (beta.EQ.zero) THEN
368  c(i,j) = alpha*temp1 + alpha*temp2
369  ELSE
370  c(i,j) = beta*c(i,j) + alpha*temp1 +
371  + alpha*temp2
372  END IF
373  200 CONTINUE
374  210 CONTINUE
375  ELSE
376  DO 240 j = 1,n
377  DO 230 i = j,n
378  temp1 = zero
379  temp2 = zero
380  DO 220 l = 1,k
381  temp1 = temp1 + a(l,i)*b(l,j)
382  temp2 = temp2 + b(l,i)*a(l,j)
383  220 CONTINUE
384  IF (beta.EQ.zero) THEN
385  c(i,j) = alpha*temp1 + alpha*temp2
386  ELSE
387  c(i,j) = beta*c(i,j) + alpha*temp1 +
388  + alpha*temp2
389  END IF
390  230 CONTINUE
391  240 CONTINUE
392  END IF
393  END IF
394 *
395  RETURN
396 *
397 * End of SSYR2K.
398 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine ssyrk ( character UPLO, character TRANS, integer N, integer K, real ALPHA, real, dimension(lda,*) A, integer LDA, real BETA, real, dimension(ldc,*) C, integer LDC )

SSYRK

Purpose:
``` SSYRK  performs one of the symmetric rank k operations

C := alpha*A*A**T + beta*C,

or

C := alpha*A**T*A + beta*C,

where  alpha and beta  are scalars, C is an  n by n  symmetric matrix
and  A  is an  n by k  matrix in the first case and a  k by n  matrix
in the second case.```
Parameters
 [in] UPLO ``` UPLO is CHARACTER*1 On entry, UPLO specifies whether the upper or lower triangular part of the array C is to be referenced as follows: UPLO = 'U' or 'u' Only the upper triangular part of C is to be referenced. UPLO = 'L' or 'l' Only the lower triangular part of C is to be referenced.``` [in] TRANS ``` TRANS is CHARACTER*1 On entry, TRANS specifies the operation to be performed as follows: TRANS = 'N' or 'n' C := alpha*A*A**T + beta*C. TRANS = 'T' or 't' C := alpha*A**T*A + beta*C. TRANS = 'C' or 'c' C := alpha*A**T*A + beta*C.``` [in] N ``` N is INTEGER On entry, N specifies the order of the matrix C. N must be at least zero.``` [in] K ``` K is INTEGER On entry with TRANS = 'N' or 'n', K specifies the number of columns of the matrix A, and on entry with TRANS = 'T' or 't' or 'C' or 'c', K specifies the number of rows of the matrix A. K must be at least zero.``` [in] ALPHA ``` ALPHA is REAL On entry, ALPHA specifies the scalar alpha.``` [in] A ``` A is REAL array of DIMENSION ( LDA, ka ), where ka is k when TRANS = 'N' or 'n', and is n otherwise. Before entry with TRANS = 'N' or 'n', the leading n by k part of the array A must contain the matrix A, otherwise the leading k by n part of the array A must contain the matrix A.``` [in] LDA ``` LDA is INTEGER On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANS = 'N' or 'n' then LDA must be at least max( 1, n ), otherwise LDA must be at least max( 1, k ).``` [in] BETA ``` BETA is REAL On entry, BETA specifies the scalar beta.``` [in,out] C ``` C is REAL array of DIMENSION ( LDC, n ). Before entry with UPLO = 'U' or 'u', the leading n by n upper triangular part of the array C must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of C is not referenced. On exit, the upper triangular part of the array C is overwritten by the upper triangular part of the updated matrix. Before entry with UPLO = 'L' or 'l', the leading n by n lower triangular part of the array C must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of C is not referenced. On exit, the lower triangular part of the array C is overwritten by the lower triangular part of the updated matrix.``` [in] LDC ``` LDC is INTEGER On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, n ).```
Date
November 2011
Further Details:
```  Level 3 Blas routine.

-- Written on 8-February-1989.
Jack Dongarra, Argonne National Laboratory.
Iain Duff, AERE Harwell.
Jeremy Du Croz, Numerical Algorithms Group Ltd.
Sven Hammarling, Numerical Algorithms Group Ltd.```

Definition at line 171 of file ssyrk.f.

171 *
172 * -- Reference BLAS level3 routine (version 3.4.0) --
173 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
174 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
175 * November 2011
176 *
177 * .. Scalar Arguments ..
178  REAL alpha,beta
179  INTEGER k,lda,ldc,n
180  CHARACTER trans,uplo
181 * ..
182 * .. Array Arguments ..
183  REAL a(lda,*),c(ldc,*)
184 * ..
185 *
186 * =====================================================================
187 *
188 * .. External Functions ..
189  LOGICAL lsame
190  EXTERNAL lsame
191 * ..
192 * .. External Subroutines ..
193  EXTERNAL xerbla
194 * ..
195 * .. Intrinsic Functions ..
196  INTRINSIC max
197 * ..
198 * .. Local Scalars ..
199  REAL temp
200  INTEGER i,info,j,l,nrowa
201  LOGICAL upper
202 * ..
203 * .. Parameters ..
204  REAL one,zero
205  parameter(one=1.0e+0,zero=0.0e+0)
206 * ..
207 *
208 * Test the input parameters.
209 *
210  IF (lsame(trans,'N')) THEN
211  nrowa = n
212  ELSE
213  nrowa = k
214  END IF
215  upper = lsame(uplo,'U')
216 *
217  info = 0
218  IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,'L'))) THEN
219  info = 1
220  ELSE IF ((.NOT.lsame(trans,'N')) .AND.
221  + (.NOT.lsame(trans,'T')) .AND.
222  + (.NOT.lsame(trans,'C'))) THEN
223  info = 2
224  ELSE IF (n.LT.0) THEN
225  info = 3
226  ELSE IF (k.LT.0) THEN
227  info = 4
228  ELSE IF (lda.LT.max(1,nrowa)) THEN
229  info = 7
230  ELSE IF (ldc.LT.max(1,n)) THEN
231  info = 10
232  END IF
233  IF (info.NE.0) THEN
234  CALL xerbla('SSYRK ',info)
235  RETURN
236  END IF
237 *
238 * Quick return if possible.
239 *
240  IF ((n.EQ.0) .OR. (((alpha.EQ.zero).OR.
241  + (k.EQ.0)).AND. (beta.EQ.one))) RETURN
242 *
243 * And when alpha.eq.zero.
244 *
245  IF (alpha.EQ.zero) THEN
246  IF (upper) THEN
247  IF (beta.EQ.zero) THEN
248  DO 20 j = 1,n
249  DO 10 i = 1,j
250  c(i,j) = zero
251  10 CONTINUE
252  20 CONTINUE
253  ELSE
254  DO 40 j = 1,n
255  DO 30 i = 1,j
256  c(i,j) = beta*c(i,j)
257  30 CONTINUE
258  40 CONTINUE
259  END IF
260  ELSE
261  IF (beta.EQ.zero) THEN
262  DO 60 j = 1,n
263  DO 50 i = j,n
264  c(i,j) = zero
265  50 CONTINUE
266  60 CONTINUE
267  ELSE
268  DO 80 j = 1,n
269  DO 70 i = j,n
270  c(i,j) = beta*c(i,j)
271  70 CONTINUE
272  80 CONTINUE
273  END IF
274  END IF
275  RETURN
276  END IF
277 *
278 * Start the operations.
279 *
280  IF (lsame(trans,'N')) THEN
281 *
282 * Form C := alpha*A*A**T + beta*C.
283 *
284  IF (upper) THEN
285  DO 130 j = 1,n
286  IF (beta.EQ.zero) THEN
287  DO 90 i = 1,j
288  c(i,j) = zero
289  90 CONTINUE
290  ELSE IF (beta.NE.one) THEN
291  DO 100 i = 1,j
292  c(i,j) = beta*c(i,j)
293  100 CONTINUE
294  END IF
295  DO 120 l = 1,k
296  IF (a(j,l).NE.zero) THEN
297  temp = alpha*a(j,l)
298  DO 110 i = 1,j
299  c(i,j) = c(i,j) + temp*a(i,l)
300  110 CONTINUE
301  END IF
302  120 CONTINUE
303  130 CONTINUE
304  ELSE
305  DO 180 j = 1,n
306  IF (beta.EQ.zero) THEN
307  DO 140 i = j,n
308  c(i,j) = zero
309  140 CONTINUE
310  ELSE IF (beta.NE.one) THEN
311  DO 150 i = j,n
312  c(i,j) = beta*c(i,j)
313  150 CONTINUE
314  END IF
315  DO 170 l = 1,k
316  IF (a(j,l).NE.zero) THEN
317  temp = alpha*a(j,l)
318  DO 160 i = j,n
319  c(i,j) = c(i,j) + temp*a(i,l)
320  160 CONTINUE
321  END IF
322  170 CONTINUE
323  180 CONTINUE
324  END IF
325  ELSE
326 *
327 * Form C := alpha*A**T*A + beta*C.
328 *
329  IF (upper) THEN
330  DO 210 j = 1,n
331  DO 200 i = 1,j
332  temp = zero
333  DO 190 l = 1,k
334  temp = temp + a(l,i)*a(l,j)
335  190 CONTINUE
336  IF (beta.EQ.zero) THEN
337  c(i,j) = alpha*temp
338  ELSE
339  c(i,j) = alpha*temp + beta*c(i,j)
340  END IF
341  200 CONTINUE
342  210 CONTINUE
343  ELSE
344  DO 240 j = 1,n
345  DO 230 i = j,n
346  temp = zero
347  DO 220 l = 1,k
348  temp = temp + a(l,i)*a(l,j)
349  220 CONTINUE
350  IF (beta.EQ.zero) THEN
351  c(i,j) = alpha*temp
352  ELSE
353  c(i,j) = alpha*temp + beta*c(i,j)
354  END IF
355  230 CONTINUE
356  240 CONTINUE
357  END IF
358  END IF
359 *
360  RETURN
361 *
362 * End of SSYRK .
363 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine strmm ( character SIDE, character UPLO, character TRANSA, character DIAG, integer M, integer N, real ALPHA, real, dimension(lda,*) A, integer LDA, real, dimension(ldb,*) B, integer LDB )

STRMM

Purpose:
``` STRMM  performs one of the matrix-matrix operations

B := alpha*op( A )*B,   or   B := alpha*B*op( A ),

where  alpha  is a scalar,  B  is an m by n matrix,  A  is a unit, or
non-unit,  upper or lower triangular matrix  and  op( A )  is one  of

op( A ) = A   or   op( A ) = A**T.```
Parameters
 [in] SIDE ``` SIDE is CHARACTER*1 On entry, SIDE specifies whether op( A ) multiplies B from the left or right as follows: SIDE = 'L' or 'l' B := alpha*op( A )*B. SIDE = 'R' or 'r' B := alpha*B*op( A ).``` [in] UPLO ``` UPLO is CHARACTER*1 On entry, UPLO specifies whether the matrix A is an upper or lower triangular matrix as follows: UPLO = 'U' or 'u' A is an upper triangular matrix. UPLO = 'L' or 'l' A is a lower triangular matrix.``` [in] TRANSA ``` TRANSA is CHARACTER*1 On entry, TRANSA specifies the form of op( A ) to be used in the matrix multiplication as follows: TRANSA = 'N' or 'n' op( A ) = A. TRANSA = 'T' or 't' op( A ) = A**T. TRANSA = 'C' or 'c' op( A ) = A**T.``` [in] DIAG ``` DIAG is CHARACTER*1 On entry, DIAG specifies whether or not A is unit triangular as follows: DIAG = 'U' or 'u' A is assumed to be unit triangular. DIAG = 'N' or 'n' A is not assumed to be unit triangular.``` [in] M ``` M is INTEGER On entry, M specifies the number of rows of B. M must be at least zero.``` [in] N ``` N is INTEGER On entry, N specifies the number of columns of B. N must be at least zero.``` [in] ALPHA ``` ALPHA is REAL On entry, ALPHA specifies the scalar alpha. When alpha is zero then A is not referenced and B need not be set before entry.``` [in] A ``` A is REAL array of DIMENSION ( LDA, k ), where k is m when SIDE = 'L' or 'l' and is n when SIDE = 'R' or 'r'. Before entry with UPLO = 'U' or 'u', the leading k by k upper triangular part of the array A must contain the upper triangular matrix and the strictly lower triangular part of A is not referenced. Before entry with UPLO = 'L' or 'l', the leading k by k lower triangular part of the array A must contain the lower triangular matrix and the strictly upper triangular part of A is not referenced. Note that when DIAG = 'U' or 'u', the diagonal elements of A are not referenced either, but are assumed to be unity.``` [in] LDA ``` LDA is INTEGER On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When SIDE = 'L' or 'l' then LDA must be at least max( 1, m ), when SIDE = 'R' or 'r' then LDA must be at least max( 1, n ).``` [in,out] B ``` B is REAL array of DIMENSION ( LDB, n ). Before entry, the leading m by n part of the array B must contain the matrix B, and on exit is overwritten by the transformed matrix.``` [in] LDB ``` LDB is INTEGER On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. LDB must be at least max( 1, m ).```
Date
November 2011
Further Details:
```  Level 3 Blas routine.

-- Written on 8-February-1989.
Jack Dongarra, Argonne National Laboratory.
Iain Duff, AERE Harwell.
Jeremy Du Croz, Numerical Algorithms Group Ltd.
Sven Hammarling, Numerical Algorithms Group Ltd.```

Definition at line 179 of file strmm.f.

179 *
180 * -- Reference BLAS level3 routine (version 3.4.0) --
181 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
182 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
183 * November 2011
184 *
185 * .. Scalar Arguments ..
186  REAL alpha
187  INTEGER lda,ldb,m,n
188  CHARACTER diag,side,transa,uplo
189 * ..
190 * .. Array Arguments ..
191  REAL a(lda,*),b(ldb,*)
192 * ..
193 *
194 * =====================================================================
195 *
196 * .. External Functions ..
197  LOGICAL lsame
198  EXTERNAL lsame
199 * ..
200 * .. External Subroutines ..
201  EXTERNAL xerbla
202 * ..
203 * .. Intrinsic Functions ..
204  INTRINSIC max
205 * ..
206 * .. Local Scalars ..
207  REAL temp
208  INTEGER i,info,j,k,nrowa
209  LOGICAL lside,nounit,upper
210 * ..
211 * .. Parameters ..
212  REAL one,zero
213  parameter(one=1.0e+0,zero=0.0e+0)
214 * ..
215 *
216 * Test the input parameters.
217 *
218  lside = lsame(side,'L')
219  IF (lside) THEN
220  nrowa = m
221  ELSE
222  nrowa = n
223  END IF
224  nounit = lsame(diag,'N')
225  upper = lsame(uplo,'U')
226 *
227  info = 0
228  IF ((.NOT.lside) .AND. (.NOT.lsame(side,'R'))) THEN
229  info = 1
230  ELSE IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,'L'))) THEN
231  info = 2
232  ELSE IF ((.NOT.lsame(transa,'N')) .AND.
233  + (.NOT.lsame(transa,'T')) .AND.
234  + (.NOT.lsame(transa,'C'))) THEN
235  info = 3
236  ELSE IF ((.NOT.lsame(diag,'U')) .AND. (.NOT.lsame(diag,'N'))) THEN
237  info = 4
238  ELSE IF (m.LT.0) THEN
239  info = 5
240  ELSE IF (n.LT.0) THEN
241  info = 6
242  ELSE IF (lda.LT.max(1,nrowa)) THEN
243  info = 9
244  ELSE IF (ldb.LT.max(1,m)) THEN
245  info = 11
246  END IF
247  IF (info.NE.0) THEN
248  CALL xerbla('STRMM ',info)
249  RETURN
250  END IF
251 *
252 * Quick return if possible.
253 *
254  IF (m.EQ.0 .OR. n.EQ.0) RETURN
255 *
256 * And when alpha.eq.zero.
257 *
258  IF (alpha.EQ.zero) THEN
259  DO 20 j = 1,n
260  DO 10 i = 1,m
261  b(i,j) = zero
262  10 CONTINUE
263  20 CONTINUE
264  RETURN
265  END IF
266 *
267 * Start the operations.
268 *
269  IF (lside) THEN
270  IF (lsame(transa,'N')) THEN
271 *
272 * Form B := alpha*A*B.
273 *
274  IF (upper) THEN
275  DO 50 j = 1,n
276  DO 40 k = 1,m
277  IF (b(k,j).NE.zero) THEN
278  temp = alpha*b(k,j)
279  DO 30 i = 1,k - 1
280  b(i,j) = b(i,j) + temp*a(i,k)
281  30 CONTINUE
282  IF (nounit) temp = temp*a(k,k)
283  b(k,j) = temp
284  END IF
285  40 CONTINUE
286  50 CONTINUE
287  ELSE
288  DO 80 j = 1,n
289  DO 70 k = m,1,-1
290  IF (b(k,j).NE.zero) THEN
291  temp = alpha*b(k,j)
292  b(k,j) = temp
293  IF (nounit) b(k,j) = b(k,j)*a(k,k)
294  DO 60 i = k + 1,m
295  b(i,j) = b(i,j) + temp*a(i,k)
296  60 CONTINUE
297  END IF
298  70 CONTINUE
299  80 CONTINUE
300  END IF
301  ELSE
302 *
303 * Form B := alpha*A**T*B.
304 *
305  IF (upper) THEN
306  DO 110 j = 1,n
307  DO 100 i = m,1,-1
308  temp = b(i,j)
309  IF (nounit) temp = temp*a(i,i)
310  DO 90 k = 1,i - 1
311  temp = temp + a(k,i)*b(k,j)
312  90 CONTINUE
313  b(i,j) = alpha*temp
314  100 CONTINUE
315  110 CONTINUE
316  ELSE
317  DO 140 j = 1,n
318  DO 130 i = 1,m
319  temp = b(i,j)
320  IF (nounit) temp = temp*a(i,i)
321  DO 120 k = i + 1,m
322  temp = temp + a(k,i)*b(k,j)
323  120 CONTINUE
324  b(i,j) = alpha*temp
325  130 CONTINUE
326  140 CONTINUE
327  END IF
328  END IF
329  ELSE
330  IF (lsame(transa,'N')) THEN
331 *
332 * Form B := alpha*B*A.
333 *
334  IF (upper) THEN
335  DO 180 j = n,1,-1
336  temp = alpha
337  IF (nounit) temp = temp*a(j,j)
338  DO 150 i = 1,m
339  b(i,j) = temp*b(i,j)
340  150 CONTINUE
341  DO 170 k = 1,j - 1
342  IF (a(k,j).NE.zero) THEN
343  temp = alpha*a(k,j)
344  DO 160 i = 1,m
345  b(i,j) = b(i,j) + temp*b(i,k)
346  160 CONTINUE
347  END IF
348  170 CONTINUE
349  180 CONTINUE
350  ELSE
351  DO 220 j = 1,n
352  temp = alpha
353  IF (nounit) temp = temp*a(j,j)
354  DO 190 i = 1,m
355  b(i,j) = temp*b(i,j)
356  190 CONTINUE
357  DO 210 k = j + 1,n
358  IF (a(k,j).NE.zero) THEN
359  temp = alpha*a(k,j)
360  DO 200 i = 1,m
361  b(i,j) = b(i,j) + temp*b(i,k)
362  200 CONTINUE
363  END IF
364  210 CONTINUE
365  220 CONTINUE
366  END IF
367  ELSE
368 *
369 * Form B := alpha*B*A**T.
370 *
371  IF (upper) THEN
372  DO 260 k = 1,n
373  DO 240 j = 1,k - 1
374  IF (a(j,k).NE.zero) THEN
375  temp = alpha*a(j,k)
376  DO 230 i = 1,m
377  b(i,j) = b(i,j) + temp*b(i,k)
378  230 CONTINUE
379  END IF
380  240 CONTINUE
381  temp = alpha
382  IF (nounit) temp = temp*a(k,k)
383  IF (temp.NE.one) THEN
384  DO 250 i = 1,m
385  b(i,k) = temp*b(i,k)
386  250 CONTINUE
387  END IF
388  260 CONTINUE
389  ELSE
390  DO 300 k = n,1,-1
391  DO 280 j = k + 1,n
392  IF (a(j,k).NE.zero) THEN
393  temp = alpha*a(j,k)
394  DO 270 i = 1,m
395  b(i,j) = b(i,j) + temp*b(i,k)
396  270 CONTINUE
397  END IF
398  280 CONTINUE
399  temp = alpha
400  IF (nounit) temp = temp*a(k,k)
401  IF (temp.NE.one) THEN
402  DO 290 i = 1,m
403  b(i,k) = temp*b(i,k)
404  290 CONTINUE
405  END IF
406  300 CONTINUE
407  END IF
408  END IF
409  END IF
410 *
411  RETURN
412 *
413 * End of STRMM .
414 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function:

 subroutine strsm ( character SIDE, character UPLO, character TRANSA, character DIAG, integer M, integer N, real ALPHA, real, dimension(lda,*) A, integer LDA, real, dimension(ldb,*) B, integer LDB )

STRSM

Purpose:
``` STRSM  solves one of the matrix equations

op( A )*X = alpha*B,   or   X*op( A ) = alpha*B,

where alpha is a scalar, X and B are m by n matrices, A is a unit, or
non-unit,  upper or lower triangular matrix  and  op( A )  is one  of

op( A ) = A   or   op( A ) = A**T.

The matrix X is overwritten on B.```
Parameters
 [in] SIDE ``` SIDE is CHARACTER*1 On entry, SIDE specifies whether op( A ) appears on the left or right of X as follows: SIDE = 'L' or 'l' op( A )*X = alpha*B. SIDE = 'R' or 'r' X*op( A ) = alpha*B.``` [in] UPLO ``` UPLO is CHARACTER*1 On entry, UPLO specifies whether the matrix A is an upper or lower triangular matrix as follows: UPLO = 'U' or 'u' A is an upper triangular matrix. UPLO = 'L' or 'l' A is a lower triangular matrix.``` [in] TRANSA ``` TRANSA is CHARACTER*1 On entry, TRANSA specifies the form of op( A ) to be used in the matrix multiplication as follows: TRANSA = 'N' or 'n' op( A ) = A. TRANSA = 'T' or 't' op( A ) = A**T. TRANSA = 'C' or 'c' op( A ) = A**T.``` [in] DIAG ``` DIAG is CHARACTER*1 On entry, DIAG specifies whether or not A is unit triangular as follows: DIAG = 'U' or 'u' A is assumed to be unit triangular. DIAG = 'N' or 'n' A is not assumed to be unit triangular.``` [in] M ``` M is INTEGER On entry, M specifies the number of rows of B. M must be at least zero.``` [in] N ``` N is INTEGER On entry, N specifies the number of columns of B. N must be at least zero.``` [in] ALPHA ``` ALPHA is REAL On entry, ALPHA specifies the scalar alpha. When alpha is zero then A is not referenced and B need not be set before entry.``` [in] A ``` A is REAL array of DIMENSION ( LDA, k ), where k is m when SIDE = 'L' or 'l' and k is n when SIDE = 'R' or 'r'. Before entry with UPLO = 'U' or 'u', the leading k by k upper triangular part of the array A must contain the upper triangular matrix and the strictly lower triangular part of A is not referenced. Before entry with UPLO = 'L' or 'l', the leading k by k lower triangular part of the array A must contain the lower triangular matrix and the strictly upper triangular part of A is not referenced. Note that when DIAG = 'U' or 'u', the diagonal elements of A are not referenced either, but are assumed to be unity.``` [in] LDA ``` LDA is INTEGER On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When SIDE = 'L' or 'l' then LDA must be at least max( 1, m ), when SIDE = 'R' or 'r' then LDA must be at least max( 1, n ).``` [in,out] B ``` B is REAL array of DIMENSION ( LDB, n ). Before entry, the leading m by n part of the array B must contain the right-hand side matrix B, and on exit is overwritten by the solution matrix X.``` [in] LDB ``` LDB is INTEGER On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. LDB must be at least max( 1, m ).```
Date
November 2011
Further Details:
```  Level 3 Blas routine.

-- Written on 8-February-1989.
Jack Dongarra, Argonne National Laboratory.
Iain Duff, AERE Harwell.
Jeremy Du Croz, Numerical Algorithms Group Ltd.
Sven Hammarling, Numerical Algorithms Group Ltd.```

Definition at line 183 of file strsm.f.

183 *
184 * -- Reference BLAS level3 routine (version 3.4.0) --
185 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
186 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
187 * November 2011
188 *
189 * .. Scalar Arguments ..
190  REAL alpha
191  INTEGER lda,ldb,m,n
192  CHARACTER diag,side,transa,uplo
193 * ..
194 * .. Array Arguments ..
195  REAL a(lda,*),b(ldb,*)
196 * ..
197 *
198 * =====================================================================
199 *
200 * .. External Functions ..
201  LOGICAL lsame
202  EXTERNAL lsame
203 * ..
204 * .. External Subroutines ..
205  EXTERNAL xerbla
206 * ..
207 * .. Intrinsic Functions ..
208  INTRINSIC max
209 * ..
210 * .. Local Scalars ..
211  REAL temp
212  INTEGER i,info,j,k,nrowa
213  LOGICAL lside,nounit,upper
214 * ..
215 * .. Parameters ..
216  REAL one,zero
217  parameter(one=1.0e+0,zero=0.0e+0)
218 * ..
219 *
220 * Test the input parameters.
221 *
222  lside = lsame(side,'L')
223  IF (lside) THEN
224  nrowa = m
225  ELSE
226  nrowa = n
227  END IF
228  nounit = lsame(diag,'N')
229  upper = lsame(uplo,'U')
230 *
231  info = 0
232  IF ((.NOT.lside) .AND. (.NOT.lsame(side,'R'))) THEN
233  info = 1
234  ELSE IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,'L'))) THEN
235  info = 2
236  ELSE IF ((.NOT.lsame(transa,'N')) .AND.
237  + (.NOT.lsame(transa,'T')) .AND.
238  + (.NOT.lsame(transa,'C'))) THEN
239  info = 3
240  ELSE IF ((.NOT.lsame(diag,'U')) .AND. (.NOT.lsame(diag,'N'))) THEN
241  info = 4
242  ELSE IF (m.LT.0) THEN
243  info = 5
244  ELSE IF (n.LT.0) THEN
245  info = 6
246  ELSE IF (lda.LT.max(1,nrowa)) THEN
247  info = 9
248  ELSE IF (ldb.LT.max(1,m)) THEN
249  info = 11
250  END IF
251  IF (info.NE.0) THEN
252  CALL xerbla('STRSM ',info)
253  RETURN
254  END IF
255 *
256 * Quick return if possible.
257 *
258  IF (m.EQ.0 .OR. n.EQ.0) RETURN
259 *
260 * And when alpha.eq.zero.
261 *
262  IF (alpha.EQ.zero) THEN
263  DO 20 j = 1,n
264  DO 10 i = 1,m
265  b(i,j) = zero
266  10 CONTINUE
267  20 CONTINUE
268  RETURN
269  END IF
270 *
271 * Start the operations.
272 *
273  IF (lside) THEN
274  IF (lsame(transa,'N')) THEN
275 *
276 * Form B := alpha*inv( A )*B.
277 *
278  IF (upper) THEN
279  DO 60 j = 1,n
280  IF (alpha.NE.one) THEN
281  DO 30 i = 1,m
282  b(i,j) = alpha*b(i,j)
283  30 CONTINUE
284  END IF
285  DO 50 k = m,1,-1
286  IF (b(k,j).NE.zero) THEN
287  IF (nounit) b(k,j) = b(k,j)/a(k,k)
288  DO 40 i = 1,k - 1
289  b(i,j) = b(i,j) - b(k,j)*a(i,k)
290  40 CONTINUE
291  END IF
292  50 CONTINUE
293  60 CONTINUE
294  ELSE
295  DO 100 j = 1,n
296  IF (alpha.NE.one) THEN
297  DO 70 i = 1,m
298  b(i,j) = alpha*b(i,j)
299  70 CONTINUE
300  END IF
301  DO 90 k = 1,m
302  IF (b(k,j).NE.zero) THEN
303  IF (nounit) b(k,j) = b(k,j)/a(k,k)
304  DO 80 i = k + 1,m
305  b(i,j) = b(i,j) - b(k,j)*a(i,k)
306  80 CONTINUE
307  END IF
308  90 CONTINUE
309  100 CONTINUE
310  END IF
311  ELSE
312 *
313 * Form B := alpha*inv( A**T )*B.
314 *
315  IF (upper) THEN
316  DO 130 j = 1,n
317  DO 120 i = 1,m
318  temp = alpha*b(i,j)
319  DO 110 k = 1,i - 1
320  temp = temp - a(k,i)*b(k,j)
321  110 CONTINUE
322  IF (nounit) temp = temp/a(i,i)
323  b(i,j) = temp
324  120 CONTINUE
325  130 CONTINUE
326  ELSE
327  DO 160 j = 1,n
328  DO 150 i = m,1,-1
329  temp = alpha*b(i,j)
330  DO 140 k = i + 1,m
331  temp = temp - a(k,i)*b(k,j)
332  140 CONTINUE
333  IF (nounit) temp = temp/a(i,i)
334  b(i,j) = temp
335  150 CONTINUE
336  160 CONTINUE
337  END IF
338  END IF
339  ELSE
340  IF (lsame(transa,'N')) THEN
341 *
342 * Form B := alpha*B*inv( A ).
343 *
344  IF (upper) THEN
345  DO 210 j = 1,n
346  IF (alpha.NE.one) THEN
347  DO 170 i = 1,m
348  b(i,j) = alpha*b(i,j)
349  170 CONTINUE
350  END IF
351  DO 190 k = 1,j - 1
352  IF (a(k,j).NE.zero) THEN
353  DO 180 i = 1,m
354  b(i,j) = b(i,j) - a(k,j)*b(i,k)
355  180 CONTINUE
356  END IF
357  190 CONTINUE
358  IF (nounit) THEN
359  temp = one/a(j,j)
360  DO 200 i = 1,m
361  b(i,j) = temp*b(i,j)
362  200 CONTINUE
363  END IF
364  210 CONTINUE
365  ELSE
366  DO 260 j = n,1,-1
367  IF (alpha.NE.one) THEN
368  DO 220 i = 1,m
369  b(i,j) = alpha*b(i,j)
370  220 CONTINUE
371  END IF
372  DO 240 k = j + 1,n
373  IF (a(k,j).NE.zero) THEN
374  DO 230 i = 1,m
375  b(i,j) = b(i,j) - a(k,j)*b(i,k)
376  230 CONTINUE
377  END IF
378  240 CONTINUE
379  IF (nounit) THEN
380  temp = one/a(j,j)
381  DO 250 i = 1,m
382  b(i,j) = temp*b(i,j)
383  250 CONTINUE
384  END IF
385  260 CONTINUE
386  END IF
387  ELSE
388 *
389 * Form B := alpha*B*inv( A**T ).
390 *
391  IF (upper) THEN
392  DO 310 k = n,1,-1
393  IF (nounit) THEN
394  temp = one/a(k,k)
395  DO 270 i = 1,m
396  b(i,k) = temp*b(i,k)
397  270 CONTINUE
398  END IF
399  DO 290 j = 1,k - 1
400  IF (a(j,k).NE.zero) THEN
401  temp = a(j,k)
402  DO 280 i = 1,m
403  b(i,j) = b(i,j) - temp*b(i,k)
404  280 CONTINUE
405  END IF
406  290 CONTINUE
407  IF (alpha.NE.one) THEN
408  DO 300 i = 1,m
409  b(i,k) = alpha*b(i,k)
410  300 CONTINUE
411  END IF
412  310 CONTINUE
413  ELSE
414  DO 360 k = 1,n
415  IF (nounit) THEN
416  temp = one/a(k,k)
417  DO 320 i = 1,m
418  b(i,k) = temp*b(i,k)
419  320 CONTINUE
420  END IF
421  DO 340 j = k + 1,n
422  IF (a(j,k).NE.zero) THEN
423  temp = a(j,k)
424  DO 330 i = 1,m
425  b(i,j) = b(i,j) - temp*b(i,k)
426  330 CONTINUE
427  END IF
428  340 CONTINUE
429  IF (alpha.NE.one) THEN
430  DO 350 i = 1,m
431  b(i,k) = alpha*b(i,k)
432  350 CONTINUE
433  END IF
434  360 CONTINUE
435  END IF
436  END IF
437  END IF
438 *
439  RETURN
440 *
441 * End of STRSM .
442 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: