LAMA
|
Define structure for multiplication routines. More...
#include <LAMAInterface.hpp>
Public Types | |
typedef void(* | scaleRows )(ValueType csrValues[], const IndexType csrIA[], const IndexType numRows, const ValueType values[]) |
This operation multiplies each row with an own value. | |
typedef void(* | normalGEMV )(ValueType result[], const ValueType alpha, const ValueType x[], const ValueType beta, const ValueType y[], const IndexType numRows, const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken) |
result = alpha * CSR-Matrix * x + b * y. | |
typedef void(* | sparseGEMV )(ValueType result[], const ValueType alpha, const ValueType x[], const IndexType numNonZeroRows, const IndexType rowIndexes[], const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken) |
result = alpha * CSR-Matrix * x, CSR matrix has only some non-zero rows | |
typedef void(* | gemm )(ValueType result[], const ValueType alpha, const ValueType x[], const ValueType beta, const ValueType y[], const IndexType m, const IndexType n, const IndexType p, const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken) |
This method computes result = alpha * CSR * x + beta * y with dense result, x, y. | |
typedef void(* | matrixAdd )(IndexType cJA[], ValueType cValues[], const IndexType cIA[], const IndexType numRows, const IndexType numColumns, const bool diagonalProperty, const ValueType alpha, const IndexType aIA[], const IndexType aJA[], const ValueType aValues[], const ValueType beta, const IndexType bIA[], const IndexType bJA[], const ValueType bValues[]) |
computes c = alpha * a + beta * b for CSR sparse matrices a, b, c | |
typedef void(* | matrixMultiply )(ValueType cValues[], const IndexType cIA[], const IndexType cJA[], const IndexType numRows, const ValueType alpha, const IndexType aIA[], const IndexType aJA[], const ValueType aValues[], const IndexType bIA[], const IndexType bJA[], const ValueType bValues[]) |
computes c = alpha * a * b for CSR sparse matrices a, b, c |
Define structure for multiplication routines.
typedef void( * lama::CSRUtilsInterface::Mult< ValueType >::gemm)(ValueType result[], const ValueType alpha, const ValueType x[], const ValueType beta, const ValueType y[], const IndexType m, const IndexType n, const IndexType p, const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken) |
This method computes result = alpha * CSR * x + beta * y with dense result, x, y.
param[out] result has size m x n param[in] alpha scaling factor param[in] x has size p x n param[in] beta scaling factor param[in] y has size m x n param[in] csrIA offset array of CSR matrix, has size m + 1 param[in] csrJA has size csrIA[m], values between 0 and p-1 param[in] csrVaues is value array of CSR matrix param[in,out] syncToken might be used for asynchronous execution
typedef void( * lama::CSRUtilsInterface::Mult< ValueType >::matrixAdd)(IndexType cJA[], ValueType cValues[], const IndexType cIA[], const IndexType numRows, const IndexType numColumns, const bool diagonalProperty, const ValueType alpha, const IndexType aIA[], const IndexType aJA[], const ValueType aValues[], const ValueType beta, const IndexType bIA[], const IndexType bJA[], const ValueType bValues[]) |
computes c = alpha * a + beta * b for CSR sparse matrices a, b, c
[out] | cJA,cValues | are the matrix values of output matrix |
[in] | cIA | contains already computed offsets |
[in] | numRows | is number of rows for matrices a, b, c |
[in] | numColums | is number of columns for matrices a, b, c |
[in] | diagonalProperty | if true result matrix gets diagonal property |
[in] | alpha | is a scalar scaling factor for matrix a |
[in] | aIA,aJA,aValues | is input matrix a in CSR format |
[in] | beta | is a scalar scaling factor for matrix b |
[in] | bIA,bJA,bValues | is input matrix b in CSR format |
In this routine the row offsets of C must already be determined before.
typedef void( * lama::CSRUtilsInterface::Mult< ValueType >::matrixMultiply)(ValueType cValues[], const IndexType cIA[], const IndexType cJA[], const IndexType numRows, const ValueType alpha, const IndexType aIA[], const IndexType aJA[], const ValueType aValues[], const IndexType bIA[], const IndexType bJA[], const ValueType bValues[]) |
computes c = alpha * a * b for CSR sparse matrices a, b, c
[out] | cValues | are the matrix values of output matrix |
[in] | cIA,cJA | contain structure of output matrix |
[in] | numRows | is number of rows for matrix c and a |
[in] | alpha | is a scalar scaling factor |
[in] | aIA,aJA,aValues | is input matrix a in CSR format |
[in] | bIA,bJA,bValues | is input matrix b in CSR format |
In this routine the final structure of C must already be determined before. Only those values of C are computed for which cIA, cJA specify an available entry.
typedef void( * lama::CSRUtilsInterface::Mult< ValueType >::normalGEMV)(ValueType result[], const ValueType alpha, const ValueType x[], const ValueType beta, const ValueType y[], const IndexType numRows, const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken) |
result = alpha * CSR-Matrix * x + b * y.
result | is the result vector |
alpha | is scaling factor for matrix x vector |
x | is input vector for matrix multiplication |
beta | is scaling factor for additional vector |
y | is additional input vector to add |
numRows | is number of elements for all vectors and rows of matrix |
csrIA,csrJA,csrValues | are arrays of CSR storage |
syncToken | optional, if available starts asynchronous computation |
typedef void( * lama::CSRUtilsInterface::Mult< ValueType >::scaleRows)(ValueType csrValues[], const IndexType csrIA[], const IndexType numRows, const ValueType values[]) |
This operation multiplies each row with an own value.
csr[i,j] *= values[i], for i = 0, ..., numRows-1
typedef void( * lama::CSRUtilsInterface::Mult< ValueType >::sparseGEMV)(ValueType result[], const ValueType alpha, const ValueType x[], const IndexType numNonZeroRows, const IndexType rowIndexes[], const IndexType csrIA[], const IndexType csrJA[], const ValueType csrValues[], class SyncToken *syncToken) |
result = alpha * CSR-Matrix * x, CSR matrix has only some non-zero rows
result | is the result vector |
alpha | is scaling factor for matrix x vector |
x | is input vector for matrix multiplication |
numNonZeroRows | is size of rowIndexes |
rowIndexes | are indexes of non-empty rows in matrix |
csrIA,csrJA,csrValues | are arrays of CSR storage |
syncToken | optional, if available starts asynchronous computation |
Note: this routine does not provide the term 'beta * y' as it would require to run over the full result vector