KASKADE 7 development version
Loading...
Searching...
No Matches
Kaskade::NumaCRSPattern< Index > Class Template Reference

A NUMA-aware compressed row storage sparsity pattern. More...

#include <threadedMatrix.hh>

Public Member Functions

 NumaCRSPattern ()
 Constructs an empty 0x0 pattern.
Index N () const
 The number of rows.
Index M () const
 The number of columns.
size_t storage () const
 Returns the number of stored entries.
size_t nonzeroes () const
 Returns the number of structurally nonzero entries.
int nodes () const
 Returns the number of NUMA nodes/chunks used.
std::shared_ptr< ChunkPattern > pattern (int i) const
 Returns the individual pattern of chunk i.
bool isSymmetric () const
 Returns the symmetry status of the pattern.
int chunk (Index row) const
 Returns the number of the chunk containing the given row.
std::vector< Index > const & rowStart () const
 Returns the limiting row indices between the chunks.
bool exists (Index r, Index c) const
 queries whether an entry is present in the sparsity pattern
Constructors
template<class IndexA>
 NumaCRSPattern (NumaCRSPattern< IndexA > const &p)
 Copy constructor.
 NumaCRSPattern (NumaCRSPatternCreator< Index > const &creator)
 Constructor creating a sparsity pattern from the given creator.
template<class Expanded, class Condensed, class Matrix>
 NumaCRSPattern (Expanded const &eIndices, Condensed const &cIndices, Matrix const &mat)
 Constructor.
template<class Matrix>
 NumaCRSPattern (Matrix const &matrix, bool isSymmetric, bool isTransposed, bool symmetric)
 Constructor extracting the sparsity pattern of a given matrix (usually a Dune::BCRSMatrix).

Detailed Description

template<class Index = size_t>
class Kaskade::NumaCRSPattern< Index >

A NUMA-aware compressed row storage sparsity pattern.

Template Parameters
Indexintegral type for row/column indices

Definition at line 623 of file threadedMatrix.hh.

Constructor & Destructor Documentation

◆ NumaCRSPattern() [1/5]

template<class Index = size_t>
Kaskade::NumaCRSPattern< Index >::NumaCRSPattern ( )
inline

Constructs an empty 0x0 pattern.

Definition at line 632 of file threadedMatrix.hh.

Referenced by NumaCRSPattern(), and NumaCRSPattern().

◆ NumaCRSPattern() [2/5]

template<class Index = size_t>
template<class IndexA>
Kaskade::NumaCRSPattern< Index >::NumaCRSPattern ( NumaCRSPattern< IndexA > const & p)
inline

Copy constructor.

Definition at line 645 of file threadedMatrix.hh.

◆ NumaCRSPattern() [3/5]

template<class Index = size_t>
Kaskade::NumaCRSPattern< Index >::NumaCRSPattern ( NumaCRSPatternCreator< Index > const & creator)
inline

Constructor creating a sparsity pattern from the given creator.

Definition at line 658 of file threadedMatrix.hh.

◆ NumaCRSPattern() [4/5]

template<class Index = size_t>
template<class Expanded, class Condensed, class Matrix>
Kaskade::NumaCRSPattern< Index >::NumaCRSPattern ( Expanded const & eIndices,
Condensed const & cIndices,
Matrix const & mat )
inline

Constructor.

This works like Matlab A(idx,idx), where idx is given by eIndices.

Template Parameters
Expandedan array type with value type convertible to Index
Condensedan array type with value type convertible to Index
Parameters
eIndicessorted global array of expanded indices
cIndicessorted global array of condensed indices
mata matrix with BCRSMatrix interface

Definition at line 683 of file threadedMatrix.hh.

◆ NumaCRSPattern() [5/5]

template<class Index = size_t>
template<class Matrix>
Kaskade::NumaCRSPattern< Index >::NumaCRSPattern ( Matrix const & matrix,
bool isSymmetric,
bool isTransposed,
bool symmetric )
inline

Constructor extracting the sparsity pattern of a given matrix (usually a Dune::BCRSMatrix).

Template Parameters
Matrixthe type of the supplied matrix to copy
Parameters
matrixthe matrix to be copied
isSymmetricwhether the supplied matrix is symmetric
isTransposedwhether the supplied matrix is transposed
symmetricwhether only the lower triangular part should be stored

This copies the sparsity pattern of the provided Dune ISTL matrix. The number of chunks created is the number of NUMA nodes as reported by the NumaThreadPool.

Note that !isSymmetric && symmetric is highly questionable and hence not allowed.

Definition at line 719 of file threadedMatrix.hh.

Member Function Documentation

◆ chunk()

template<class Index = size_t>
int Kaskade::NumaCRSPattern< Index >::chunk ( Index row) const
inline

Returns the number of the chunk containing the given row.

Parameters
rowthe index of the row in the range [0,N]

For row==N, the total number of chunks is returned (i.e. one behind the last chunk).

Definition at line 806 of file threadedMatrix.hh.

Referenced by exists().

◆ exists()

template<class Index = size_t>
bool Kaskade::NumaCRSPattern< Index >::exists ( Index r,
Index c ) const
inline

queries whether an entry is present in the sparsity pattern

Definition at line 827 of file threadedMatrix.hh.

◆ isSymmetric()

template<class Index = size_t>
bool Kaskade::NumaCRSPattern< Index >::isSymmetric ( ) const
inline

Returns the symmetry status of the pattern.

If true, the matrix is symmetric, and only the lower triangular entries are actually stored.

Definition at line 798 of file threadedMatrix.hh.

Referenced by NumaCRSPattern(), NumaCRSPattern(), NumaCRSPattern(), and Kaskade::operator+().

◆ M()

template<class Index = size_t>
Index Kaskade::NumaCRSPattern< Index >::M ( ) const
inline

The number of columns.

Definition at line 754 of file threadedMatrix.hh.

Referenced by NumaCRSPattern(), NumaCRSPattern(), and Kaskade::operator+().

◆ N()

template<class Index = size_t>
Index Kaskade::NumaCRSPattern< Index >::N ( ) const
inline

The number of rows.

Definition at line 749 of file threadedMatrix.hh.

Referenced by chunk(), NumaCRSPattern(), and Kaskade::operator+().

◆ nodes()

template<class Index = size_t>
int Kaskade::NumaCRSPattern< Index >::nodes ( ) const
inline

Returns the number of NUMA nodes/chunks used.

Definition at line 783 of file threadedMatrix.hh.

Referenced by NumaCRSPattern(), NumaCRSPattern(), NumaCRSPattern(), NumaCRSPattern(), and Kaskade::operator+().

◆ nonzeroes()

template<class Index = size_t>
size_t Kaskade::NumaCRSPattern< Index >::nonzeroes ( ) const
inline

Returns the number of structurally nonzero entries.

Definition at line 772 of file threadedMatrix.hh.

Referenced by Kaskade::operator+().

◆ pattern()

template<class Index = size_t>
std::shared_ptr< ChunkPattern > Kaskade::NumaCRSPattern< Index >::pattern ( int i) const
inline

Returns the individual pattern of chunk i.

Definition at line 788 of file threadedMatrix.hh.

Referenced by NumaCRSPattern(), and Kaskade::operator+().

◆ rowStart()

template<class Index = size_t>
std::vector< Index > const & Kaskade::NumaCRSPattern< Index >::rowStart ( ) const
inline

Returns the limiting row indices between the chunks.

For \( 0\le i < n \), the chunk \( i \) contains the rows in the half-open range [ rowStart()[i], rowStart()[i+1] [.

Definition at line 822 of file threadedMatrix.hh.

Referenced by NumaCRSPattern().

◆ storage()

template<class Index = size_t>
size_t Kaskade::NumaCRSPattern< Index >::storage ( ) const
inline

Returns the number of stored entries.

This differs from nonzeroes() for symmetric storage.

Definition at line 761 of file threadedMatrix.hh.


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