Rank-k update

SSYRK/DSYRK/CHERK/CSYRK/ZHERK/ZSYRK

Example 1 Apply a REAL*4 rank-6 update AAT to an 8-by-8 real symmetric matrix C whose upper triangle is stored in the upper triangle of an array C of dimension 10-by-10, where A is an 8-by-6 real matrix stored in an array A, also of dimension 10-by-10.

CHARACTER*1 UPLO,TRANS

INTEGER*4 N,K,LDA,LDC

REAL*4 ALPHA,BETA,A(10,10),C(10,10)

UPLO = ’U’

TRANS = ’N’

N = 8

K = 6

ALPHA = 1.0

BETA = 1.0

LDA = 10

LDC = 10

CALL SSYRK (UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC)

Example 2 Apply a COMPLEX*8 Hermitian rank-2 update −2AA* to a 9-by-9 complex Hermitian matrix C whose lower triangle is stored in the lower triangle of an array C of dimension 10-by-10, where A is a 9-by-2 complex matrix stored in an array A of dimension 10-by-10.

INTEGER*4 N,K,LDA,LDC

COMPLEX*8 A(10,10),C(10,10)

N = 9

K = 2

LDA = 10

LDC = 10

CALL CHERK (’LOWER’,’NONTRANS’,N,K,-2.0,A,LDA,1.0,C,LDC)

Chapter 3 Basic Matrix Operations 293