mkl_?omatadd

Performs scaling and sum of two matrices including their out-of-place transposition/copying.

Syntax

Fortran:

call mkl_somatadd(ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc)

call mkl_domatadd(ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc)

call mkl_comatadd(ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc)

call mkl_zomatadd(ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc)

C:

mkl_somatadd(ordering, transa, transb, m, n, alpha, A, lda, beta, B, ldb, C, ldc);

mkl_domatadd(ordering, transa, transb, m, n, alpha, A, lda, beta, B, ldb, C, ldc);

mkl_comatadd(ordering, transa, transb, m, n, alpha, A, lda, beta, B, ldb, C, ldc);

mkl_zomatadd(ordering, transa, transb, m, n, alpha, A, lda, beta, B, ldb, C, ldc);

Include Files

The FORTRAN 77 interfaces are specified in the mkl_trans.fi include file and the C interfaces are specified in the mkl_trans.h include file. Always reference mkl_trans.h for the C interface correct resolution.

Description

The mkl_?omatadd routine scaling and sum of two matrices including their out-of-place transposition/copying. A transposition operation can be a normal matrix copy, a transposition, a conjugate transposition, or just a conjugation. The following out-of-place memory movement is done:

C := alpha*op(A) + beta*op(B)

op(A) is either transpose, conjugate-transpose, or leave alone depending on transa. If no transposition of the source matrices is required, m is the number of rows and n is the number of columns in the source matrices A and B. In this case, the output matrix C is m-by-n.

The routine parameter descriptions are common for all implemented interfaces with the exception of data types that refer here to the FORTRAN 77 standard types. Data types specific to the different interfaces are described in the section "Interfaces" below.

Note that different arrays should not overlap.

Input Parameters

ordering

CHARACTER*1. Ordering of the matrix storage.

If ordering = 'R' or 'r', the ordering is row-major.

If ordering = 'C' or 'c', the ordering is column-major.

transa

CHARACTER*1. Parameter that specifies the operation type on matrix A.

If transa = 'N' or 'n', op(A)=A and the matrix A is assumed unchanged on input.

If transa = 'T' or 't', it is assumed that A should be transposed.

If transa = 'C' or 'c', it is assumed that A should be conjugate transposed.

If transa = 'R' or 'r', it is assumed that A should be only conjugated.

If the data is real, then transa = 'R' is the same as transa = 'N', and transa = 'C' is the same as transa = 'T'.

transb

CHARACTER*1. Parameter that specifies the operation type on matrix B.

If transb = 'N' or 'n', op(B)=B and the matrix B is assumed unchanged on input.

If transb = 'T' or 't', it is assumed that B should be transposed.

If transb = 'C' or 'c', it is assumed that B should be conjugate transposed.

If transb = 'R' or 'r', it is assumed that B should be only conjugated.

If the data is real, then transb = 'R' is the same as transb = 'N', and transb = 'C' is the same as transb = 'T'.

m

INTEGER. The number of matrix rows.

n

INTEGER. The number of matrix columns.

alpha

REAL for mkl_somatadd.

DOUBLE PRECISION for mkl_domatadd.

COMPLEX for mkl_comatadd.

DOUBLE COMPLEX for mkl_zomatadd.

This parameter scales the input matrix by alpha.

a

REAL for mkl_somatadd.

DOUBLE PRECISION for mkl_domatadd.

COMPLEX for mkl_comatadd.

DOUBLE COMPLEX for mkl_zomatadd.

Array, DIMENSION a(lda,*).

lda

INTEGER. Distance between the first elements in adjacent columns (in the case of the column-major order) or rows (in the case of the row-major order) in the source matrix A; measured in the number of elements.

This parameter must be at least max(1,rows) if ordering = 'C' or 'c', and max(1,cols) otherwise.

beta

REAL for mkl_somatadd.

DOUBLE PRECISION for mkl_domatadd.

COMPLEX for mkl_comatadd.

DOUBLE COMPLEX for mkl_zomatadd.

This parameter scales the input matrix by beta.

b

REAL for mkl_somatadd.

DOUBLE PRECISION for mkl_domatadd.

COMPLEX for mkl_comatadd.

DOUBLE COMPLEX for mkl_zomatadd.

Array, DIMENSION b(ldb,*).

ldb

INTEGER. Distance between the first elements in adjacent columns (in the case of the column-major order) or rows (in the case of the row-major order) in the source matrix B; measured in the number of elements.

This parameter must be at least max(1,rows) if ordering = 'C' or 'c', and max(1,cols) otherwise.

Output Parameters

c

REAL for mkl_somatadd.

DOUBLE PRECISION for mkl_domatadd.

COMPLEX for mkl_comatadd.

DOUBLE COMPLEX for mkl_zomatadd.

Array, DIMENSION c(ldc,*).

ldc

INTEGER. Distance between the first elements in adjacent columns (in the case of the column-major order) or rows (in the case of the row-major order) in the destination matrix C; measured in the number of elements.

To determine the minimum value of ldc, consider the following guideline:

If ordering = 'C' or 'c', then

  • If transa or transb = 'T' or 't' or 'C' or 'c', this parameter must be at least max(1,rows)

  • If transa or transb = 'N' or 'n' or 'R' or 'r', this parameter must be at least max(1,cols)

If ordering = 'R' or 'r', then

  • If transa or transb = 'T' or 't' or 'C' or 'c', this parameter must be at least max(1,cols)

  • If transa or transb = 'N' or 'n' or 'R' or 'r', this parameter must be at least max(1,rows)

Interfaces

FORTRAN 77:

SUBROUTINE mkl_somatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
   CHARACTER*1 ordering, transa, transb
   INTEGER m, n, lda, ldb, ldc
   REAL alpha, beta
   REAL a(lda,*), b(ldb,*), c(ldc,*)

SUBROUTINE mkl_domatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
   CHARACTER*1 ordering, transa, transb
   INTEGER m, n, lda, ldb, ldc   
   DOUBLE PRECISION alpha, beta
   DOUBLE PRECISION a(lda,*), b(ldb,*), c(ldc,*)

SUBROUTINE mkl_comatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
   CHARACTER*1 ordering, transa, transb
   INTEGER m, n, lda, ldb, ldc
   COMPLEX alpha, beta
   COMPLEX a(lda,*), b(ldb,*), c(ldc,*)

SUBROUTINE mkl_zomatadd ( ordering, transa, transb, m, n, alpha, a, lda, beta, b, ldb, c, ldc )
   CHARACTER*1 ordering, transa, transb
   INTEGER m, n, lda, ldb, ldc
   DOUBLE COMPLEX alpha, beta
   DOUBLE COMPLEX a(lda,*), b(ldb,*), c(ldc,*)

C:

void mkl_somatadd(char ordering, char transa, char transb, size_t m, size_t n, float *alpha, float *A, size_t lda, float *beta, float *B, size_t ldb, float *C, size_t ldc);

void mkl_domatadd(char ordering, char transa, char transb, size_t m, size_t n, double *alpha, double *A, size_t lda, double *beta, float *B, size_t ldb, double *C, size_t ldc);

void mkl_comatadd(char ordering, char transa, char transb, size_t m, size_t n,
 MKL_Complex8 *alpha, MKL_Complex8 *A, size_t lda, float *beta, float *B, size_t ldb, MKL_Complex8 *C, size_t ldc);

void mkl_zomatadd(char ordering, char transa, char transb, size_t m, size_t n,
 MKL_Complex16 *alpha, MKL_Complex16 *A, size_t lda, float *beta, float *B, size_t ldb, MKL_Complex16 *C, size_t ldc);

Submit feedback on this help topic

Copyright © 1994 - 2011, Intel Corporation. All rights reserved.