?omatdiv
Perform scaling and division of two matrices including their out-of-place transposition/copying.
That is,
.

Interface Definition
C interface:
void cblas_somatdiv(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, float *B, const BLASINT ldb, float *C, const BLASINT ldc);
void cblas_domatdiv(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, double *B, const BLASINT ldb, double *C, const BLASINT ldc);
void cblas_comatdiv(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, float *B, const BLASINT ldb, float *C, const BLASINT ldc);
void cblas_zomatdiv(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, double *B, const BLASINT ldb, double *C, const BLASINT ldc);
Fortran interface:
CALL SOMATDIV(ORDER, TRANSA, TRANSB, M, N, ALPHA, A, LDA, B, LDB, C, LDC)
CALL DOMATDIV(ORDER, TRANSA, TRANSB, M, N, ALPHA, A, LDA, B, LDB, C, LDC)
CALL COMATDIV(ORDER, TRANSA, TRANSB, M, N, ALPHA, A, LDA, B, LDB, C, LDC)
CALL ZOMATDIV(ORDER, TRANSA, TRANSB, M, N, ALPHA, A, LDA, 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, or a conjugate matrix.
|
Input |
TransB |
Enumeration type CBLAS_TRANSPOSE |
Indicates whether matrix B is a conventional matrix, a transpose matrix, or a conjugate matrix.
|
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 |
|
Multiplication coefficient. |
Input |
A |
|
Matrix A. |
Input |
lda |
Integer |
|
Input |
B |
|
Matrix B. |
Input |
ldb |
Integer |
|
Input |
C |
|
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;
/**
* 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
* B:
* 0.718160, 0.604610, 0.991237,
* 0.676218, 0.818167, 0.722511,
* 0.539246, 0.880499, 0.814675,
* 0.543172, 0.862320, 0.731872
* C:
* 0, 0, 0,
* 0, 0, 0,
* 0, 0, 0,
* 0, 0, 0
*/
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 b[12] = {0.718160, 0.604610, 0.991237,
0.676218, 0.818167, 0.722511,
0.539246, 0.880499, 0.814675,
0.543172, 0.862320, 0.731872
};
float c[12] = {0};
cblas_somatdiv(CblasColMajor, CblasNoTrans, CblasNoTrans, m, n, alpha, a, lda, b, ldb, c, ldc);
/**
* Output C:
* 1.798285, 2.196716, 1.565241,
* 2.386664, 1.469238, 1.978835,
* 3.396264, 1.824785, 1.380008,
* 1.925460, 1.502539, 2.252343
*/
Fortran interface:
PROGRAM OMATDIV
INTEGER :: M=4, N=3
INTEGER :: LDA=4, LDB=4, LDC=4
REAL(4) :: ALPHA=2.0
REAL(4) :: A(4, 3), B(4, 3), C(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 B/0.718160, 0.604610, 0.991237,
0.676218, 0.818167, 0.722511,
0.539246, 0.880499, 0.814675,
0.543172, 0.862320, 0.731872/
DATA C/0.0, 0.0, 0.0,
0.0, 0.0, 0.0,
0.0, 0.0, 0.0/
EXTERNAL SOMATDIV
CALL SOMATDIV('C', 'N', 'N', M, N, ALPHA, A, LDA, B, LDB, C, LDC)
END
* Output C:
* 1.798285, 2.196716, 1.565241,
* 2.386664, 1.469238, 1.978835,
* 3.396264, 1.824785, 1.380008,
* 1.925460, 1.502539, 2.252343