?symm
Compute the product of matrices in which matrix A is symmetric.
or
.
alpha and beta are multiplication coefficients, A is a symmetric matrix, and B and C are m*n general matrices.
Interface Definition
C interface:
void cblas_ssymm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, const enum CBLAS_UPLO Uplo,
const BLASINT M, const BLASINT N, const float alpha, const float *A, const BLASINT lda, const float *B,
const BLASINT ldb, const float beta, float *C, const BLASINT ldc);
void cblas_dsymm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, const enum CBLAS_UPLO Uplo,
const BLASINT M, const BLASINT N, const double alpha, const double *A, const BLASINT lda, const double *B,
const BLASINT ldb, const double beta, double *C, const BLASINT ldc);
void cblas_csymm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, const enum CBLAS_UPLO Uplo,
const BLASINT M, const BLASINT N, const void *alpha, const void *A, const BLASINT lda, const void *B,
const BLASINT ldb, const void *beta, void *C, const BLASINT ldc);
void cblas_zsymm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, const enum CBLAS_UPLO Uplo,
const BLASINT M, const BLASINT N, const void *alpha, const void *A, const BLASINT lda, const void *B,
const BLASINT ldb, const void *beta, void *C, const BLASINT ldc);
Fortran interface:
CALL SSYMM(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CALL DSYMM(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CALL CSYMM(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CALL ZSYMM(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
order |
Enumeration type CBLAS_ORDER |
Indicates whether the matrix is in row- or column-major order. |
Input |
Side |
Enumeration type CBLAS_SIDE |
Indicates whether symmetric matrix A is on the left or right of matrix B.
|
Input |
Uplo |
Enumeration type CBLAS_UPLO |
Indicates whether the upper triangle or the lower triangle of the matrix A is used.
|
Input |
M |
Integer |
Number of rows of matrix C.
|
Input |
N |
Integer |
Number of columns of matrix C.
|
Input |
alpha |
|
Multiplication coefficient |
Input |
A |
|
Matrix A (lda, ka). If Side = CblasLeft, ka = m; otherwise, ka = n. |
Input |
lda |
Integer |
If Side = CblasLeft, lda is at least max(1, m); otherwise, lda is at least max(1, n). |
Input |
B |
|
Matrix B (ldb, n) |
Input |
ldb |
Integer |
|
Input |
beta |
|
Multiplication coefficient |
Input |
C |
|
Matrix C |
Input/Output |
ldc |
Integer |
|
Input |
Dependencies
#include "kblas.h"
C interface:
int m = 3, n = 6, lda = 4, ldb =3, ldc = 5;
float alpha = 2.0, beta = 2.0;
/**
* | 4.0 . . |
* A(4 * 3) = | 3.0 4.0 . |
* | 6.0 -7.0 -1.0 |
* | . . . |
*
* | -1.0 -3.0 2.0 2.0 -1.0 8.0 |
* B(3 * 6) = | 2.0 3.0 0.0 4.0 2.0 -2.0 |
* | 11.0 -2.0 -21.0 -1.0 -1.0 5.0 |
*
* | 3.0 2.0 -1.0 3.0 -1.0 -11.0|
* | 9.0 13.0 5.0 5.0 3.0 -5.0 |
* C(5 * 6) = | -1.0 -6.0 -3.0 3.0 -1.0 32.0|
* | . . . . . . |
* | . . . . . . |
*/
float a[12] = {4.0, 3.0, 6.0, 0,
3.0, 4.0, -7.0, 0,
6.0, -7.0, -1.0, 0};
float b[18] = {-1.0, 2.0, 11.0,
-3.0, 3.0, -2.0,
2.0, 0, -21.0,
2.0, 4.0, -1.0,
-1.0, 2.0, -1.0,
8.0, -2.0, 5.0};
float c[30] = {6.0, 9.0, -1.0, 0, 0,
2.0, 13.0, -6.0, 0, 0,
-1.0, 5.0, -3.0, 0, 0,
3.0, 5.0, 3.0, 0, 0,
-1.0, 3.0, -1.0, 0, 0,
-11.0, -5.0, 32.0, 0, 0};
cblas_ssymm(CblasColMajor,CblasLeft,CblasLower, m, n, alpha, a, lda, b, ldb, beta, c, ldc);
/**
* Output C
* | 148.0 -26.0 -238.0 34.0 -10.0 90.0 |
* | -126.0 60.0 316.0 68.0 30.0 -48.0 |
* C(5 * 6) = | -64.0 -86.0 60.0 -24.0 -40.0 178.0|
* | . . . . . . |
* | . . . . . . |
*
*/
Fortran interface:
INTEGER :: M=3, N=6
INTEGER :: LDA=4, LDB=3, LDC=5
REAL(4) :: ALPHA=2.0, BETA=2.0
REAL(4) :: A(4, 3), B(3,6), C(5, 6)
DATA A/4.0, 3.0, 6.0, 0,
$ 3.0, 4.0, -7.0, 0,
$ 6.0, -7.0, -1.0, 0/
DATA B/-1.0, 2.0, 11.0,
$ -3.0, 3.0, -2.0,
$ 2.0, 0, -21.0,
$ 2.0, 4.0, -1.0,
$ -1.0, 2.0, -1.0,
$ 8.0, -2.0, 5.0/
DATA C/6.0, 9.0, -1.0, 0, 0,
$ 2.0, 13.0, -6.0, 0, 0,
$ -1.0, 5.0, -3.0, 0, 0,
$ 3.0, 5.0, 3.0, 0, 0,
$ -1.0, 3.0, -1.0, 0, 0,
$ -11.0, -5.0, 32.0, 0, 0/
EXTERNAL SSYMM
CALL SSYMM('L', 'L', M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
* Output C
* | 148.0 -26.0 -238.0 34.0 -10.0 90.0 |
* | -126.0 60.0 316.0 68.0 30.0 -48.0 |
* C(5 * 6) = | -64.0 -86.0 60.0 -24.0 -40.0 178.0|
* | . . . . . . |
* | . . . . . . |

