Rate This Document
Findability
Accuracy
Completeness
Readability

?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.

  • If Side = CblasLeft, .
  • If Side = CblasRight, .

Input

Uplo

Enumeration type CBLAS_UPLO

Indicates whether the upper triangle or the lower triangle of the matrix A is used.

  • If Uplo = CblasUpper, the upper triangular part of A is used.
  • If Uplo = CblasLower, the lower triangular part of A is used.

Input

M

Integer

Number of rows of matrix C.

  • A*B indicates the number of rows of matrix A.
  • B*A indicates the number of rows of matrix B.

Input

N

Integer

Number of columns of matrix C.

  • A*B indicates the number of columns of matrix B.
  • B*A indicates the number of columns of matrix A.

Input

alpha

  • For ssymm, alpha is of single-precision floating-point type.
  • For dsymm, alpha is of double-precision floating-point type.
  • For csymm, alpha is of single-precision complex number type.
  • For zsymm, alpha is of double-precision complex number type.

Multiplication coefficient

Input

A

  • For ssymm, A is of single-precision floating-point type.
  • For dsymm, A is of double-precision floating-point type.
  • For csymm, A is of single-precision complex number type.
  • For zsymm, A is of double-precision complex number type.

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

  • For ssymm, B is of single-precision floating-point type.
  • For dsymm, B is of double-precision floating-point type.
  • For csymm, B is of single-precision complex number type.
  • For zsymm, B is of double-precision complex number type.

Matrix B (ldb, n)

Input

ldb

Integer

  • If the matrix is column store, ldb must be at least max(1, m).
  • If the matrix is row store, ldb must be at least max(1, n).

Input

beta

  • For ssymm, beta is of single-precision floating-point type.
  • For dsymm, beta is of double-precision floating-point type.
  • For csymm, beta is of single-precision complex number type.
  • For zsymm, beta is of double-precision complex number type.

Multiplication coefficient

Input

C

  • For ssymm, C is of single-precision floating-point type.
  • For dsymm, C is of the double-precision floating-point type.
  • For csymm, C is of the single-precision complex number type.
  • For zsymm, C is of double-precision complex number type.

Matrix C

Input/Output

ldc

Integer

  • If the matrix is column store, ldc must be at least max(1, m).
  • If the matrix is row store, ldc must be at least max(1, n).

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| 
*                       |   .      .      .      .     .      .   | 
*                       |   .      .      .      .     .      .   |