These subroutines compute one of the following rank-k updates, where matrix C is stored in either upper or lower storage mode. SSYRK, DSYRK, CSYRK, and ZSYRK use the scalars alpha and beta, real or complex matrix A or its transpose, and real or complex symmetric matrix C to compute:
CHERK and ZHERK use the scalars alpha and beta, complex matrix A or its complex conjugate transpose, and complex Hermitian matrix C to compute:
A, C | alpha, beta | Subprogram |
Short-precision real | Short-precision real | SSYRK |
Long-precision real | Long-precision real | DSYRK |
Short-precision complex | Short-precision complex | CSYRK |
Long-precision complex | Long-precision complex | ZSYRK |
Short-precision complex | Short-precision real | CHERK |
Long-precision complex | Long-precision real | ZHERK |
Fortran | CALL SSYRK | DSYRK | CSYRK | ZSYRK | CHERK | ZHERK (uplo, trans, n, k, alpha, a, lda, beta, c, ldc) |
C and C++ | ssyrk | dsyrk | csyrk | zsyrk | cherk | zherk (uplo, trans, n, k, alpha, a, lda, beta, c, ldc); |
PL/I | CALL SSYRK | DSYRK | CSYRK | ZSYRK | CHERK | ZHERK (uplo, trans, n, k, alpha, a, lda, beta, c, ldc); |
If uplo = 'U', C is stored in upper storage mode.
If uplo = 'L', C is stored in lower storage mode.
Specified as: a single character. It must be 'U' or 'L'.
If trans = 'N', A is used, resulting in equation 1 or 3.
If trans = 'T', AT is used, resulting in equation 2.
If trans = 'C', AH is used, resulting in equation 4.
Specified as: a single character, where:
For SSYRK and DSYRK, it must be 'N', 'T', or 'C'.
For CSYRK and ZSYRK, it must be 'N' or 'T'.
For CHERK and ZHERK, it must be 'N' or 'C'.
If trans = 'N', then n <= lda.
If trans = 'N', it is the number of columns in matrix A.
If trans = 'T' or 'C', it is the number of rows in matrix A.
Specified as: a fullword integer; k >= 0 and:
If trans = 'T' or 'C', then k <= lda.
If trans = 'N', A is n by k.
If trans = 'T' or 'C', A is k by n.
Specified as: a two-dimensional array, containing numbers of the data type indicated in Table 79, where:
If trans = 'N', its size must be lda by (at least) k.
If trans = 'T' or 'C', its size must be lda by (at least) n.
If trans = 'N', lda >= n.
If trans = 'T' or 'C', lda >= k.
If uplo = 'U', C is stored in upper storage mode.
If uplo = 'L', C is stored in lower storage mode.
Specified as: an ldc by (at least) n array, containing numbers of the data type indicated in Table 79.
If uplo = 'U', C is stored in upper storage mode.
If uplo = 'L', C is stored in lower storage mode.
Returned as: an ldc by (at least) n array, containing numbers of the data type indicated in Table 79.
These subroutines can perform the following rank-k updates. For SSYRK and DSYRK, matrix C is real symmetric. For CSYRK and ZSYRK, matrix C is complex symmetric. They perform:
For CHERK and ZHERK, matrix C is complex Hermitian. They perform:
where:
See references [32] and [38]. In the following two cases, no computation is performed:
Assuming the above conditions do not exist, if beta is not one, and alpha is zero or k is zero, then betaC is returned.
Unable to allocate internal work area.
None
This example shows the computation C<--alphaAAT+betaC, where A is an 8 by 2 real rectangular matrix, and C is a real symmetric matrix of order 8, stored in upper storage mode.
UPLO TRANS N K ALPHA A LDA BETA C LDC | | | | | | | | | | CALL SSYRK( 'U' , 'N' , 8 , 2 , 1.0 , A , 9 , 1.0 , C , 10 )
* * | 0.0 8.0 | | 1.0 9.0 | | 2.0 10.0 | | 3.0 11.0 | A = | 4.0 12.0 | | 5.0 13.0 | | 6.0 14.0 | | 7.0 15.0 | | . . | * *
* * | 0.0 1.0 3.0 6.0 10.0 15.0 21.0 28.0 | | . 2.0 4.0 7.0 11.0 16.0 22.0 29.0 | | . . 5.0 8.0 12.0 17.0 23.0 30.0 | | . . . 9.0 13.0 18.0 24.0 31.0 | C = | . . . . 14.0 19.0 25.0 32.0 | | . . . . . 20.0 26.0 33.0 | | . . . . . . 27.0 34.0 | | . . . . . . . 35.0 | | . . . . . . . . | | . . . . . . . . | * *
* * | 64.0 73.0 83.0 94.0 106.0 119.0 133.0 148.0 | | . 84.0 96.0 109.0 123.0 138.0 154.0 171.0 | | . . 109.0 124.0 140.0 157.0 175.0 194.0 | | . . . 139.0 157.0 176.0 196.0 217.0 | C = | . . . . 174.0 195.0 217.0 240.0 | | . . . . . 214.0 238.0 263.0 | | . . . . . . 259.0 286.0 | | . . . . . . . 309.0 | | . . . . . . . . | | . . . . . . . . | * *
This example shows the computation C<--alphaATA+betaC, where A is a 3 by 8 real rectangular matrix, and C is a real symmetric matrix of order 8, stored in lower storage mode.
UPLO TRANS N K ALPHA A LDA BETA C LDC | | | | | | | | | | CALL SSYRK( 'L' , 'T' , 8 , 3 , 1.0 , A , 4 , 1.0 , C , 8 )
* * | 0.0 3.0 6.0 9.0 12.0 15.0 18.0 21.0 | A = | 1.0 4.0 7.0 10.0 13.0 16.0 19.0 22.0 | | 2.0 5.0 8.0 11.0 14.0 17.0 20.0 23.0 | | . . . . . . . . | * *
* * | 0.0 . . . . . . . | | 1.0 8.0 . . . . . . | | 2.0 9.0 15.0 . . . . . | C = | 3.0 10.0 16.0 21.0 . . . . | | 4.0 11.0 17.0 22.0 26.0 . . . | | 5.0 12.0 18.0 23.0 27.0 30.0 . . | | 6.0 13.0 19.0 24.0 28.0 31.0 33.0 . | | 7.0 14.0 20.0 25.0 29.0 32.0 34.0 35.0 | * *
* * | 5.0 . . . . . . . | | 15.0 58.0 . . . . . . | | 25.0 95.0 164.0 . . . . . | C = | 35.0 132.0 228.0 323.0 . . . . | | 45.0 169.0 292.0 414.0 535.0 . . . | | 55.0 206.0 356.0 505.0 653.0 800.0 . . | | 65.0 243.0 420.0 596.0 771.0 945.0 1118.0 . | | 75.0 280.0 484.0 687.0 889.0 1090.0 1290.0 1489.0 | * *
This example shows the computation C<--alphaAAT+betaC, where A is a 3 by 5 complex rectangular matrix, and C is a complex symmetric matrix of order 3, stored in upper storage mode.
UPLO TRANS N K ALPHA A LDA BETA C LDC | | | | | | | | | | CALL CSYRK( 'U' , 'N' , 3 , 5 , ALPHA , A , 3 , BETA , C , 4 )
ALPHA = (1.0, 1.0) BETA = (1.0, 1.0)
* * | (2.0, 0.0) (3.0, 2.0) (4.0, 1.0) (1.0, 7.0) (0.0, 0.0) | A = | (3.0, 3.0) (8.0, 0.0) (2.0, 5.0) (2.0, 4.0) (1.0, 2.0) | | (1.0, 3.0) (2.0, 1.0) (6.0, 0.0) (3.0, 2.0) (2.0, 2.0) | * *
* * | (2.0, 1.0) (1.0, 9.0) (4.0, 5.0) | C = | . (3.0, 1.0) (6.0, 7.0) | | . . (8.0, 1.0) | | . . . | * *
* * | (-57.0, 13.0) (-63.0, 79.0) (-24.0, 70.0) | C = | . (-28.0, 90.0) (-55.0, 103.0) | | . . (13.0, 75.0) | | . . . | * *
This example shows the computation C<--alphaAHA+betaC, where A is a 5 by 3 complex rectangular matrix, and C is a complex Hermitian matrix of order 3, stored in lower storage mode.
UPLO TRANS N K ALPHA A LDA BETA C LDC | | | | | | | | | | CALL CHERK( 'L' , 'C' , 3 , 5 , 1.0 , A , 5 , 1.0 , C , 4 )
* * | (2.0, 0.0) (3.0, 2.0) (4.0, 1.0) | | (3.0, 3.0) (8.0, 0.0) (2.0, 5.0) | A = | (1.0, 3.0) (2.0, 1.0) (6.0, 0.0) | | (3.0, 3.0) (8.0, 0.0) (2.0, 5.0) | | (1.0, 9.0) (3.0, 0.0) (6.0, 7.0) | * *
* * | (6.0, . ) . . | C = | (3.0, 4.0) (10.0, . ) . | | (9.0, 1.0) (12.0, 2.0) (3.0, . ) | | . . . | * *
* * | (138.0, 0.0) . . | C = | (65.0, 80.0) (165.0, 0.0) . | | (134.0, 46.0) (88.0, -88.0) (199.0, 0.0) | | . . . | * *