我要评分
获取效率
正确性
完整性
易理解

?imatdiv

That is, .

Interface Definition

C interface:

void cblas_simatdiv(const enum CBLAS_ORDER ordering, const enum CBLAS_TRANSPOSE TransA, const BLASINT m, const BLASINT n, const float alpha, float *A, const BLASINT lda, float *BC, const BLASINT ldb);

void cblas_dimatdiv(const enum CBLAS_ORDER ordering, const enum CBLAS_TRANSPOSE TransA, const BLASINT m, const BLASINT n, const double alpha, double *A, const BLASINT lda, double *BC, const BLASINT ldb);

void cblas_cimatdiv(const enum CBLAS_ORDER ordering, const enum CBLAS_TRANSPOSE TransA, const BLASINT m, const BLASINT n, const float *alpha, float *A, const BLASINT lda, float *BC, const BLASINT ldb);

void cblas_zimatdiv(const enum CBLAS_ORDER ordering, const enum CBLAS_TRANSPOSE TransA, const BLASINT m, const BLASINT n, const double *alpha, double *A, const BLASINT lda, double *BC, const BLASINT ldb);

Fortran interface:

CALL SIMATDIV(ORDER, TRANSA, M, N, ALPHA, A, LDA, BC, LDB)

CALL DIMATDIV(ORDER, TRANSA, M, N, ALPHA, A, LDA, BC, LDB)

CALL CIMATDIV(ORDER, TRANSA, M, N, ALPHA, A, LDA, BC, LDB)

CALL ZIMATDIV(ORDER, TRANSA, M, N, ALPHA, A, LDA, BC, LDB)

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, or a conjugate 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

M

Integer

Number of rows of matrices op(A) and BC.

Input

N

Integer

Number of columns of matrices op(A) and BC.

Input

alpha

  • Single-precision floating-point type for simatdiv
  • Double-precision floating-point type for dimatdiv
  • Single-precision complex type for cimatdiv
  • Double-precision complex type for zimatdiv

Multiplication coefficient.

Input

A

  • Single-precision floating-point type for simatdiv
  • Double-precision floating-point type for dimatdiv
  • Single-precision complex type for cimatdiv
  • Double-precision complex type for zimatdiv

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

BC

  • Single-precision floating-point type for simatdiv
  • Double-precision floating-point type for dimatdiv
  • Single-precision complex type for cimatdiv
  • Double-precision complex type for zimatdiv

Matrix BC.

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

Dependency

#include "kblas.h"

Examples

C interface:

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

    /** 
     *    A: 
     *         0.235257, 0.268674, 0.151790,     
     *         -0.204541, 0.142802, 0.036246,
     *         -0.238498, 0.423810, 0.181002,
     *         -0.002402, -0.240821, -0.309177  
     *    BC: 
     *         -0.284033, -0.407091, 0.487585,            
     *         -0.126079, 0.380664, -0.407300,
     *         0.243892, -0.259406, -0.257296,
     *         0.018376, 0.148356, 0.379532,
     */

    float a[12] = {0.645728, 0.664078, 0.775762,
                   0.806953, 0.601041, 0.714864,
                   0.915711, 0.803360, 0.562129,
                   0.522928, 0.647835, 0.824213
    };

    float bc[12] = {-2.414662, -3.030372, 6.424446,   
                   1.232803, 5.331337, -22.474379,
                   -2.045228, -1.224161, -2.843022,
                   -15.298911, -1.232085, -2.455110
    };

    cblas_simatdiv(CblasColMajor, CblasNoTrans, m, n, alpha, a, lda, bc, ldb);

    /** 
     * Output BC: 
     *        -2.414662, -3.030372, 6.424446,      
     *        1.232803, 5.331337, -22.474379,
     *        -2.045228, -1.224161, -2.843022, 
     *        -15.298911, -1.232085, -2.455110
     */

Fortran interface:

      PROGRAM IMATDIV
      INTEGER :: M=4, N=3
      INTEGER :: LDA=4, LDB=4
      REAL(4) :: ALPHA=2.0
      REAL(4) :: A(4, 3), BC(4, 3)
      DATA A/0.645728, 0.664078, 0.775762,
             0.806953, 0.601041, 0.714864,
             0.915711, 0.803360, 0.562129,
             0.522928, 0.647835, 0.824213/
      DATA BC/-2.414662, -3.030372, 6.424446,   
              1.232803, 5.331337, -22.474379,
              -2.045228, -1.224161, -2.843022,
              -15.298911, -1.232085, -2.455110/

      EXTERNAL SIMATDIV
      CALL SIMATDIV('C', 'N', M, N, ALPHA, A, LDA, BC, LDB)
      END

     * Output BC: 
     *        1.798285, 2.196716, 1.565241,      
     *        2.386664, 1.469238, 1.978835,
     *        3.396264, 1.824785, 1.380008, 
     *        1.925460, 1.502539, 2.252343