Rate This Document
Findability
Accuracy
Completeness
Readability

?omatsub

That is, .

Interface Definition

C interface:

void cblas_somatsub(const enum CBLAS_ORDER ordering, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, const BLASINT m, const BLASINT n, const float alpha, float *A, const BLASINT lda, const float beta, float *B, const BLASINT ldb, float *C, const BLASINT ldc);

void cblas_domatsub(const enum CBLAS_ORDER ordering, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, const BLASINT m, const BLASINT n, const double alpha, double *A, const BLASINT lda, const double beta, double *B, const BLASINT ldb, double *C, const BLASINT ldc);

void cblas_comatsub(const enum CBLAS_ORDER ordering, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, const BLASINT m, const BLASINT n, const float *alpha, float *A, const BLASINT lda, const float *beta, float *B, const BLASINT ldb, float *C, const BLASINT ldc);

void cblas_zomatsub(const enum CBLAS_ORDER ordering, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, const BLASINT m, const BLASINT n, const double *alpha, double *A, const BLASINT lda, const double *beta, double *B, const BLASINT ldb, double *C, const BLASINT ldc);

Fortran interface:

CALL SOMATSUB(ORDER, TRANSA, TRANSB, M, N, ALPHA, A, LDA, BETA, B, LDB, C, LDC)

CALL DOMATSUB(ORDER, TRANSA, TRANSB, M, N, ALPHA, A, LDA, BETA, B, LDB, C, LDC)

CALL COMATSUB(ORDER, TRANSA, TRANSB, M, N, ALPHA, A, LDA, BETA, B, LDB, C, LDC)

CALL ZOMATSUB(ORDER, TRANSA, TRANSB, M, N, ALPHA, A, LDA, BETA, B, LDB, 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

TransA

Enumeration type CBLAS_TRANSPOSE

Indicates whether matrix A is a conventional matrix, a transpose matrix, a conjugate matrix, or a conjugate transpose matrix.

  • If TransA = CblasNoTrans, op(A) = A.
  • If TransA = CblasTrans, op(A) = A'.
  • If TransA = CblasConjNoTrans, op(A) = conj(A).
  • If TransA = CblasConjTrans, op(A) = conj(A').

Input

TransB

Enumeration type CBLAS_TRANSPOSE

Indicates whether matrix B is a conventional matrix, a transpose matrix, a conjugate matrix, or a conjugate transpose matrix.

  • If TransB = CblasNoTrans, op(B) = B.
  • If TransB = CblasTrans, op(B) = B'.
  • If TransB = CblasConjNoTrans, op(B) = conj(B).
  • If TransB = CblasConjTrans, op(B) = conj(B').

Input

M

Integer

Number of rows of matrices op (A), op (B), and C.

Input

N

Integer

Number of columns of matrices op (A), op (B), and C.

Input

alpha

  • Single-precision floating-point type for somatsub
  • Double-precision floating-point type for domatsub
  • Single-precision complex type for comatsub
  • Double-precision complex type for zomatsub

Multiplication coefficient.

Input

A

  • Single-precision floating-point type for somatsub
  • Double-precision floating-point type for domatsub
  • Single-precision complex type for comatsub
  • Double-precision complex type for zomatsub

Matrix A.

Input

lda

Integer

  • If matrix A is column store and TransA = CblasNoTrans, lda is at least max(1, m); otherwise, lda is at least max(1, n).
  • If matrix A is row store and TransA = CblasNoTrans, lda is at least max(1, n); otherwise, lda is at least max(1, m).

Input

beta

  • Single-precision floating-point type for somatsub
  • Double-precision floating-point type for domatsub
  • Single-precision complex type for comatsub
  • Double-precision complex type for zomatsub

Multiplication coefficient.

Input

B

  • Single-precision floating-point type for somatsub
  • Double-precision floating-point type for domatsub
  • Single-precision complex type for comatsub
  • Double-precision complex type for zomatsub

Matrix B.

Input

ldb

Integer

  • If the matrix is column store and TransB = CblasNoTrans, ldb is at least max(1, m); otherwise, ldb is at least max(1, n).
  • If the matrix is row store and TransB = CblasNoTrans, ldb is at least max(1, n); otherwise, ldb is at least max(1, m).

Input

C

  • Single-precision floating-point type for somatsub
  • Double-precision floating-point type for domatsub
  • Single-precision complex type for comatsub
  • Double-precision complex type for zomatsub

Matrix C.

Output

ldc

Integer

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

Input

Dependency

#include "kblas.h"

Examples

C interface:

    int m = 4;
    int n = 3;
    int lda = 4;
    int ldb = 4;
    int ldc = 4;
    float alpha = 2.0;
    float beta = 1.0;

    /** 
     *    A: 
     *         0.878666, 0.587949, 0.911689,   
     *         0.537057, 0.738171, 0.775693,
     *         0.933167, 0.700325, 0.563810,
     *         0.712020, 0.606780, 0.538903  
     *    B: 
     *         0.780532, 0.649196, 0.703486,         
     *         0.854725, 0.511782, 0.570734,
     *         0.550857, 0.832913, 0.937889,
     *         0.838400, 0.885429, 0.970482
     *    C: 
     *         0, 0, 0,
     *         0, 0, 0,
     *         0, 0, 0,
     *         0, 0, 0
     */

    float a[12] = {0.878666, 0.587949, 0.911689,
                   0.537057, 0.738171, 0.775693,
                   0.933167, 0.700325, 0.563810,
                   0.712020, 0.606780, 0.538903
    };

    float b[12] = {0.780532, 0.649196, 0.703486,
                   0.854725, 0.511782, 0.570734,
                   0.550857, 0.832913, 0.937889,
                   0.838400, 0.885429, 0.970482
    };

    float c[12] = {0};

    cblas_somatsub(CblasColMajor, CblasNoTrans, CblasNoTrans, m, n, alpha, a, lda, beta, b, ldb, c, ldc);

    /** 
     * Output C: 
     *        0.976800, 0.526701, 1.119892,      
     *        0.219388, 0.964561, 0.980653,
     *        1.315476, 0.567737, 0.189731, 
     *        0.585641, 0.328131, 0.107325
     */

Fortran interface:

      PROGRAM OMATSUB
      INTEGER :: M=4, N=3
      INTEGER :: LDA=4, LDB=4, LDC=4
      REAL(4) :: ALPHA=2.0
      REAL(4) :: BETA=1.0
      REAL(4) :: A(4, 3), B(4, 3), C(4, 3)
      DATA A/0.878666, 0.587949, 0.911689,
             0.537057, 0.738171, 0.775693,
             0.933167, 0.700325, 0.563810,
             0.712020, 0.606780, 0.538903/
      DATA B/0.780532, 0.649196, 0.703486,
             0.854725, 0.511782, 0.570734,
             0.550857, 0.832913, 0.937889,
             0.838400, 0.885429, 0.970482/
      DATA C/0.0, 0.0, 0.0,
             0.0, 0.0, 0.0,
             0.0, 0.0, 0.0/
      EXTERNAL SOMATSUB
      CALL SOMATSUB('C', 'N', 'N', M, N, ALPHA, A, LDA, BETA, B, LDB, C, LDC)
      END

     * Output BC: 
     *        0.976800, 0.526701, 1.119892,
     *        0.219388, 0.964561, 0.980653,
     *        1.315476, 0.567737, 0.189731,
     *        0.585641, 0.328131, 0.107325