MyraMath
Classes | Functions
gemm.h File Reference

Variety of routines for mixed dense*sparse or dense*sparse matrix multiplies. The dense*dense case is already covered by dense/gemm.h, and the sparse*sparse case is within sparse/multiply.h. However, if both A and B are sparse, it's more common to treat the product (A*B) as a cascade of two operators, e.g. Y = A*(B*X), etc. More...

#include <myramath/utility/detail/LIBPUBLIC.h>
#include <myramath/utility/Number.h>
Include dependency graph for gemm.h:

Go to the source code of this file.

Classes

class  myra::Matrix< Number >
 Tabulates an IxJ matrix. Allows random access, has column major layout to be compatible with BLAS/LAPACK. More...
 
class  myra::MatrixRange< Number >
 Represents a mutable MatrixRange. More...
 
class  myra::CMatrixRange< Number >
 Represents a const MatrixRange. More...
 
class  myra::CSparseMatrixRange< Number >
 Represents a const SparseMatrixRange. More...
 

Functions

void myra::gemm_inplace (const MatrixRange< NumberS > &C, const CSparseMatrixRange< NumberS > &A, char op_A, const CMatrixRange< NumberS > &B, char op_B, NumberS alpha=1, NumberS beta=0)
 Performs C = alpha*op(A)*B + beta*C, for sparse A and dense B/C.
 
void myra::gemm_inplace (const MatrixRange< NumberD > &C, const CSparseMatrixRange< NumberD > &A, char op_A, const CMatrixRange< NumberD > &B, char op_B, NumberD alpha, NumberD beta)
 
void myra::gemm_inplace (const MatrixRange< NumberC > &C, const CSparseMatrixRange< NumberC > &A, char op_A, const CMatrixRange< NumberC > &B, char op_B, NumberC alpha, NumberC beta)
 
void myra::gemm_inplace (const MatrixRange< NumberZ > &C, const CSparseMatrixRange< NumberZ > &A, char op_A, const CMatrixRange< NumberZ > &B, char op_B, NumberZ alpha, NumberZ beta)
 
Matrix< NumberS > myra::gemm (const CSparseMatrixRange< NumberS > &A, char op_A, const CMatrixRange< NumberS > &B, char op_B, NumberS alpha=1)
 Returns C = alpha*op(A)*op(B), for sparse A and dense B/C. Note alpha is defaulted to 1.
 
Matrix< NumberD > myra::gemm (const CSparseMatrixRange< NumberD > &A, char op_A, const CMatrixRange< NumberD > &B, char op_B, NumberD alpha)
 
Matrix< NumberC > myra::gemm (const CSparseMatrixRange< NumberC > &A, char op_A, const CMatrixRange< NumberC > &B, char op_B, NumberC alpha)
 
Matrix< NumberZ > myra::gemm (const CSparseMatrixRange< NumberZ > &A, char op_A, const CMatrixRange< NumberZ > &B, char op_B, NumberZ alpha)
 
Matrix< NumberS > myra::gemm (const CSparseMatrixRange< NumberS > &A, char op_A, const CMatrixRange< NumberS > &B, NumberS alpha=1)
 Returns C = alpha*op(A)*op(B), for sparse A and dense B/C. Note op_B is assumed 'N' and alpha is defaulted to 1.
 
Matrix< NumberD > myra::gemm (const CSparseMatrixRange< NumberD > &A, char op_A, const CMatrixRange< NumberD > &B, NumberD alpha)
 
Matrix< NumberC > myra::gemm (const CSparseMatrixRange< NumberC > &A, char op_A, const CMatrixRange< NumberC > &B, NumberC alpha)
 
Matrix< NumberZ > myra::gemm (const CSparseMatrixRange< NumberZ > &A, char op_A, const CMatrixRange< NumberZ > &B, NumberZ alpha)
 
Matrix< NumberS > myra::gemm (const CSparseMatrixRange< NumberS > &A, const CMatrixRange< NumberS > &B, char op_B, NumberS alpha=1)
 Returns C = alpha*op(A)*op(B), for sparse A and dense B/C. Note op_A is assumed 'N' and alpha is defaulted to 1.
 
Matrix< NumberD > myra::gemm (const CSparseMatrixRange< NumberD > &A, const CMatrixRange< NumberD > &B, char op_B, NumberD alpha)
 
Matrix< NumberC > myra::gemm (const CSparseMatrixRange< NumberC > &A, const CMatrixRange< NumberC > &B, char op_B, NumberC alpha)
 
Matrix< NumberZ > myra::gemm (const CSparseMatrixRange< NumberZ > &A, const CMatrixRange< NumberZ > &B, char op_B, NumberZ alpha)
 
Matrix< NumberS > myra::gemm (const CSparseMatrixRange< NumberS > &A, const CMatrixRange< NumberS > &B, NumberS alpha=1)
 Returns C = alpha*op(A)*op(B), for sparse A and dense B/C. Note op_A and op_B are assumed 'N' and alpha is defaulted to 1.
 
Matrix< NumberD > myra::gemm (const CSparseMatrixRange< NumberD > &A, const CMatrixRange< NumberD > &B, NumberD alpha)
 
Matrix< NumberC > myra::gemm (const CSparseMatrixRange< NumberC > &A, const CMatrixRange< NumberC > &B, NumberC alpha)
 
Matrix< NumberZ > myra::gemm (const CSparseMatrixRange< NumberZ > &A, const CMatrixRange< NumberZ > &B, NumberZ alpha)
 
Matrix< NumberS > myra::operator* (const CSparseMatrixRange< NumberS > &A, const CMatrixRange< NumberS > &B)
 Returns A*B, for sparse A and dense B.
 
Matrix< NumberD > myra::operator* (const CSparseMatrixRange< NumberD > &A, const CMatrixRange< NumberD > &B)
 
Matrix< NumberC > myra::operator* (const CSparseMatrixRange< NumberC > &A, const CMatrixRange< NumberC > &B)
 
Matrix< NumberZ > myra::operator* (const CSparseMatrixRange< NumberZ > &A, const CMatrixRange< NumberZ > &B)
 
void myra::gemm_inplace (const MatrixRange< NumberS > &C, const CMatrixRange< NumberS > &A, char op_A, const CSparseMatrixRange< NumberS > &B, char op_B, NumberS alpha=1, NumberS beta=0)
 Performs C = alpha*A*op(B) + beta*C, for sparse B and dense A/C.
 
void myra::gemm_inplace (const MatrixRange< NumberD > &C, const CMatrixRange< NumberD > &A, char op_A, const CSparseMatrixRange< NumberD > &B, char op_B, NumberD alpha, NumberD beta)
 
void myra::gemm_inplace (const MatrixRange< NumberC > &C, const CMatrixRange< NumberC > &A, char op_A, const CSparseMatrixRange< NumberC > &B, char op_B, NumberC alpha, NumberC beta)
 
void myra::gemm_inplace (const MatrixRange< NumberZ > &C, const CMatrixRange< NumberZ > &A, char op_A, const CSparseMatrixRange< NumberZ > &B, char op_B, NumberZ alpha, NumberZ beta)
 
Matrix< NumberS > myra::gemm (const CMatrixRange< NumberS > &A, char op_A, const CSparseMatrixRange< NumberS > &B, char op_B, NumberS alpha=1)
 Returns C = alpha*op(A)*op(B), for sparse B and dense A/C. Note alpha is defaulted to 1.
 
Matrix< NumberD > myra::gemm (const CMatrixRange< NumberD > &A, char op_A, const CSparseMatrixRange< NumberD > &B, char op_B, NumberD alpha)
 
Matrix< NumberC > myra::gemm (const CMatrixRange< NumberC > &A, char op_A, const CSparseMatrixRange< NumberC > &B, char op_B, NumberC alpha)
 
Matrix< NumberZ > myra::gemm (const CMatrixRange< NumberZ > &A, char op_A, const CSparseMatrixRange< NumberZ > &B, char op_B, NumberZ alpha)
 
Matrix< NumberS > myra::gemm (const CMatrixRange< NumberS > &A, char op_A, const CSparseMatrixRange< NumberS > &B, NumberS alpha=1)
 Returns C = alpha*op(A)*op(B), for sparse B and dense A/C. Note op_B is assumed 'N' and alpha is defaulted to 1.
 
Matrix< NumberD > myra::gemm (const CMatrixRange< NumberD > &A, char op_A, const CSparseMatrixRange< NumberD > &B, NumberD alpha)
 
Matrix< NumberC > myra::gemm (const CMatrixRange< NumberC > &A, char op_A, const CSparseMatrixRange< NumberC > &B, NumberC alpha)
 
Matrix< NumberZ > myra::gemm (const CMatrixRange< NumberZ > &A, char op_A, const CSparseMatrixRange< NumberZ > &B, NumberZ alpha)
 
Matrix< NumberS > myra::gemm (const CMatrixRange< NumberS > &A, const CSparseMatrixRange< NumberS > &B, char op_B, NumberS alpha=1)
 Returns C = alpha*op(A)*op(B), for sparse B and dense A/C. Note op_A is assumed 'N' and alpha is defaulted to 1.
 
Matrix< NumberD > myra::gemm (const CMatrixRange< NumberD > &A, const CSparseMatrixRange< NumberD > &B, char op_B, NumberD alpha)
 
Matrix< NumberC > myra::gemm (const CMatrixRange< NumberC > &A, const CSparseMatrixRange< NumberC > &B, char op_B, NumberC alpha)
 
Matrix< NumberZ > myra::gemm (const CMatrixRange< NumberZ > &A, const CSparseMatrixRange< NumberZ > &B, char op_B, NumberZ alpha)
 
Matrix< NumberS > myra::gemm (const CMatrixRange< NumberS > &A, const CSparseMatrixRange< NumberS > &B, NumberS alpha=1)
 Returns C = alpha*op(A)*op(B), for sparse B and dense A/C. Note op_A and op_B are assumed 'N' and alpha is defaulted to 1.
 
Matrix< NumberD > myra::gemm (const CMatrixRange< NumberD > &A, const CSparseMatrixRange< NumberD > &B, NumberD alpha)
 
Matrix< NumberC > myra::gemm (const CMatrixRange< NumberC > &A, const CSparseMatrixRange< NumberC > &B, NumberC alpha)
 
Matrix< NumberZ > myra::gemm (const CMatrixRange< NumberZ > &A, const CSparseMatrixRange< NumberZ > &B, NumberZ alpha)
 
Matrix< NumberS > myra::operator* (const CMatrixRange< NumberS > &A, const CSparseMatrixRange< NumberS > &B)
 Returns A*B, for dense A and sparse B.
 
Matrix< NumberD > myra::operator* (const CMatrixRange< NumberD > &A, const CSparseMatrixRange< NumberD > &B)
 
Matrix< NumberC > myra::operator* (const CMatrixRange< NumberC > &A, const CSparseMatrixRange< NumberC > &B)
 
Matrix< NumberZ > myra::operator* (const CMatrixRange< NumberZ > &A, const CSparseMatrixRange< NumberZ > &B)
 

Detailed Description

Variety of routines for mixed dense*sparse or dense*sparse matrix multiplies. The dense*dense case is already covered by dense/gemm.h, and the sparse*sparse case is within sparse/multiply.h. However, if both A and B are sparse, it's more common to treat the product (A*B) as a cascade of two operators, e.g. Y = A*(B*X), etc.