LAMA
lama::CSRUtilsInterface::Mult< ValueType > Struct Template Reference

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

Detailed Description

template<typename ValueType>
struct lama::CSRUtilsInterface::Mult< ValueType >

Define structure for multiplication routines.


Member Typedef Documentation

template<typename ValueType >
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

template<typename ValueType >
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

Parameters:
[out]cJA,cValuesare the matrix values of output matrix
[in]cIAcontains already computed offsets
[in]numRowsis number of rows for matrices a, b, c
[in]numColumsis number of columns for matrices a, b, c
[in]diagonalPropertyif true result matrix gets diagonal property
[in]alphais a scalar scaling factor for matrix a
[in]aIA,aJA,aValuesis input matrix a in CSR format
[in]betais a scalar scaling factor for matrix b
[in]bIA,bJA,bValuesis input matrix b in CSR format

In this routine the row offsets of C must already be determined before.

template<typename ValueType >
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

Parameters:
[out]cValuesare the matrix values of output matrix
[in]cIA,cJAcontain structure of output matrix
[in]numRowsis number of rows for matrix c and a
[in]alphais a scalar scaling factor
[in]aIA,aJA,aValuesis input matrix a in CSR format
[in]bIA,bJA,bValuesis 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.

template<typename ValueType >
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.

Parameters:
resultis the result vector
alphais scaling factor for matrix x vector
xis input vector for matrix multiplication
betais scaling factor for additional vector
yis additional input vector to add
numRowsis number of elements for all vectors and rows of matrix
csrIA,csrJA,csrValuesare arrays of CSR storage
syncTokenoptional, if available starts asynchronous computation
template<typename ValueType >
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

template<typename ValueType >
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

Parameters:
resultis the result vector
alphais scaling factor for matrix x vector
xis input vector for matrix multiplication
numNonZeroRowsis size of rowIndexes
rowIndexesare indexes of non-empty rows in matrix
csrIA,csrJA,csrValuesare arrays of CSR storage
syncTokenoptional, 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


The documentation for this struct was generated from the following file: