All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
GraphBLAS Namespace Reference

Implements the GraphBLAS interface. More...

Functions

template<class SemiRing , class Matrix , typename L >
Matrix eWiseBinOp (const Matrix &A, const Matrix &B, L binOp)
 Computes binOp(A(i,j), B(i,j)) for all i,j element-wise. More...
 
template<class SemiRing = ArithmeticSemiring, class Matrix >
Matrix MxM (const Matrix &A, const Matrix &B)
 Computes the matrix-matrix multiplication of A and B. More...
 
template<class SemiRing = ArithmeticSemiring, class Matrix >
void MxM (const Matrix &A, const Matrix &B, Matrix &C)
 Computes the matrix-matrix multiplication of A and B and adds it to C where the add operation is that of the specified Semiring (i.e. More...
 
template<class SemiRing = ArithmeticSemiring, typename F , class Matrix >
void MxM (const Matrix &A, const Matrix &B, Matrix &C, F accum)
 Computes the matrix-matrix multiplication of A and B and adds it to C where the add operation is specified by the binary function accum (i.e. More...
 
template<class SemiRing = ArithmeticSemiring, class Matrix >
NetworKit::Vector MxV (const Matrix &A, const NetworKit::Vector &v)
 Computes the matrix-vector product of matrix A and Vector v. More...
 
template<class SemiRing = ArithmeticSemiring, class Matrix >
void MxV (const Matrix &A, const NetworKit::Vector &v, NetworKit::Vector &c)
 Computes the matrix-vector product of matrix A and Vector v and adds it to c where the add operation is that of the specified Semiring (i.e. More...
 
template<class SemiRing = ArithmeticSemiring, typename F , class Matrix >
void MxV (const Matrix &A, const NetworKit::Vector &v, NetworKit::Vector &c, F accum)
 Computes the matrix-vector product of matrix A and Vector v and adds it to c where the add operation is that of the specified binary function accum (i.e. More...
 
template<class SemiRing = ArithmeticSemiring, class Matrix >
Matrix eWiseAdd (const Matrix &A, const Matrix &B)
 Computes SemiRing::add(A(i,j), B(i,j)) for all i,j element-wise and returns the resulting matrix. More...
 
template<class SemiRing = ArithmeticSemiring, class Matrix >
Matrix eWiseMult (const Matrix &A, const Matrix &B)
 Computes SemiRing::mult(A(i,j), B(i,j)) for all i,j element-wise and returns the resulting matrix. More...
 
template<class SemiRing = ArithmeticSemiring, class Matrix >
NetworKit::Vector rowReduce (const Matrix &matrix)
 Computes the row-reduction of the matrix and returns the result as a vector. More...
 
template<class SemiRing = ArithmeticSemiring, class Matrix >
NetworKit::Vector columnReduce (const Matrix &matrix)
 Computes the column-reduction of the matrix and returns the result as a Vector. More...
 

Detailed Description

Implements the GraphBLAS interface.

For more information visit https://graphblas.org.

Function Documentation

template<class SemiRing = ArithmeticSemiring, class Matrix >
NetworKit::Vector GraphBLAS::columnReduce ( const Matrix &  matrix)

Computes the column-reduction of the matrix and returns the result as a Vector.

That is, the elements of each column are summed up to form the respective entry in the result Vector. The add operator is that of the specified Semiring. The default Semiring is the ArithmeticSemiring.

Parameters
matrix
template<class SemiRing = ArithmeticSemiring, class Matrix >
Matrix GraphBLAS::eWiseAdd ( const Matrix &  A,
const Matrix &  B 
)

Computes SemiRing::add(A(i,j), B(i,j)) for all i,j element-wise and returns the resulting matrix.

The default Semiring is the ArithmeticSemiring.

Parameters
A
B
template<class SemiRing , class Matrix , typename L >
Matrix GraphBLAS::eWiseBinOp ( const Matrix &  A,
const Matrix &  B,
binOp 
)

Computes binOp(A(i,j), B(i,j)) for all i,j element-wise.

Note that the dimensions of A and B must coincide and that the zero must be the same.

Parameters
A
B
binOp
Returns
The resulting matrix.
template<class SemiRing = ArithmeticSemiring, class Matrix >
Matrix GraphBLAS::eWiseMult ( const Matrix &  A,
const Matrix &  B 
)

Computes SemiRing::mult(A(i,j), B(i,j)) for all i,j element-wise and returns the resulting matrix.

The default Semiring is the ArithmeticSemiring.

Parameters
A
B
Returns
template<class SemiRing = ArithmeticSemiring, class Matrix >
Matrix GraphBLAS::MxM ( const Matrix &  A,
const Matrix &  B 
)

Computes the matrix-matrix multiplication of A and B.

Note that A.numberOfColumns() must be equal to B.numberOfRows() and the zero elements must be the same. The default Semiring is the ArithmeticSemiring.

Parameters
A
B
Returns
The result of the multiplication A * B.
template<class SemiRing = ArithmeticSemiring, class Matrix >
void GraphBLAS::MxM ( const Matrix &  A,
const Matrix &  B,
Matrix &  C 
)

Computes the matrix-matrix multiplication of A and B and adds it to C where the add operation is that of the specified Semiring (i.e.

C(i,j) = SemiRing::add(C(i,j), (A*B)(i,j))). The default Semiring is the ArithmeticSemiring.

Parameters
A
B
C
template<class SemiRing = ArithmeticSemiring, typename F , class Matrix >
void GraphBLAS::MxM ( const Matrix &  A,
const Matrix &  B,
Matrix &  C,
accum 
)

Computes the matrix-matrix multiplication of A and B and adds it to C where the add operation is specified by the binary function accum (i.e.

C(i,j) = accum(C(i,j), (A*B)(i,j))). The default Semiring is the ArithmeticSemiring.

Parameters
A
B
C
accum
template<class SemiRing = ArithmeticSemiring, class Matrix >
NetworKit::Vector GraphBLAS::MxV ( const Matrix &  A,
const NetworKit::Vector v 
)

Computes the matrix-vector product of matrix A and Vector v.

The default Semiring is the ArithmeticSemiring.

Parameters
A
v
template<class SemiRing = ArithmeticSemiring, class Matrix >
void GraphBLAS::MxV ( const Matrix &  A,
const NetworKit::Vector v,
NetworKit::Vector c 
)

Computes the matrix-vector product of matrix A and Vector v and adds it to c where the add operation is that of the specified Semiring (i.e.

c[i] = SemiRing::add(c[i], (A*v)[i]). The default Semiring is the ArithmeticSemiring.

Parameters
A
v
c
template<class SemiRing = ArithmeticSemiring, typename F , class Matrix >
void GraphBLAS::MxV ( const Matrix &  A,
const NetworKit::Vector v,
NetworKit::Vector c,
accum 
)

Computes the matrix-vector product of matrix A and Vector v and adds it to c where the add operation is that of the specified binary function accum (i.e.

c[i] = accum(c[i], (A*v)[i]). The default Semiring is the ArithmeticSemiring.

Parameters
A
v
c
template<class SemiRing = ArithmeticSemiring, class Matrix >
NetworKit::Vector GraphBLAS::rowReduce ( const Matrix &  matrix)

Computes the row-reduction of the matrix and returns the result as a vector.

That is, the elements of each row are summed up to form the respective entry in the result vector. The add operator is that of the specified Semiring. The default Semiring is the ArithmeticSemiring.

Parameters
matrix