SSYR2K, DSYR2K, CSYR2K, or ZSYR2K Subroutine

Purpose

Performs symmetric rank 2k operations.

Library

BLAS Library (libblas.a)

FORTRAN Syntax

SUBROUTINE SSYR2K(UPLO, TRANS, N, K, ALPHA,
A, LDA, B, LDB, BETA, C, LDC)
CHARACTER*1  UPLO, TRANS
INTEGER  N, K, LDA, LDB, LDC
REAL  ALPHA, BETA
REAL  A(LDA,*),  B(LDB,*),  C(LDC,*)

SUBROUTINE DSYR2K(UPLO, TRANS, N, K, ALPHA,
A, LDA, B, LDB, BETA, C, LDC)
CHARACTER*1 UPLO,TRANS
INTEGER N,K,LDA,LDB,LDC
DOUBLE PRECISION ALPHA,BETA
DOUBLE PRECISION A(LDA,*), B(LDB,*), C(LDC,*)
SUBROUTINE CSYR2K(UPLO, TRANS, N, K, ALPHA,
A, LDA, B, LDB, BETA, C, LDC)
CHARACTER*1 UPLO,TRANS
INTEGER N,K,LDA,LDB,LDC
COMPLEX ALPHA,BETA
COMPLEX A(LDA,*), B(LDB,*), C(LDC,*)
SUBROUTINE ZSYR2K(UPLO, TRANS, N, K, ALPHA,
A, LDA, B, LDB, BETA, C, LDC)
CHARACTER*1 UPLO,TRANS
INTEGER N,K,LDA,LDB,LDC
COMPLEX*16 ALPHA,BETA
COMPLEX*16 A(LDA,*), B(LDB,*), C(LDC,*)

Description

The SSYR2K, DSYR2K, CSYR2K, or ZSYR2K subroutine performs one of the symmetric rank 2k operations:

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

OR

C := alpha * A' * B + alpha * B' * 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

Item Description
UPLO 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.

Unchanged on exit.

TRANS On entry, TRANS specifies the operation to be performed as follows:
TRANS = 'N' or 'n'
C := alpha * A * B' + alpha * B * A' + beta * C
TRANS = 'T' or 't'
C := alpha * A' * B + alpha * B' * A + beta * C

Unchanged on exit.

N On entry, N specifies the order of the matrix C; N must be at least 0; unchanged on exit.
K 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', K specifies the number of rows of the matrices A and B; K must be at least 0; unchanged on exit.
ALPHA On entry, ALPHA specifies the scalar alpha; unchanged on exit.
A An array of dimension ( LDA, KA ), where KA is K when TRANS = 'N' or 'n', and is N otherwise; on 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; unchanged on exit.
LDA On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANS = 'N' or 'n', LDA must be at least max( 1, N ); otherwise LDA must be at least max( 1, K ); unchanged on exit.
B An array of dimension ( LDB, KB ), where KB is K when TRANS = 'N' or 'n', and is N otherwise; on 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; unchanged on exit.
LDB On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANS = 'N' or 'n', LDB must be at least max( 1, N ); otherwise LDB must be at least max( 1, K ); unchanged on exit.
BETA On entry, BETA specifies the scalar beta; unchanged on exit.
C An array of dimension ( LDC, N ); on 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. On 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.
LDC On entry, LDC specifies the first dimension of C as declared in the calling (sub) program; LDC must be at least max( 1, N ); unchanged on exit.