KASKADE 7 development version
|
A dense matrix class tailored towards NUMA architectures. More...
#include <numaMatrix.hh>
A dense matrix class tailored towards NUMA architectures.
The class satisfies the Dune ISTL recursive matrix interface similar to Dune::Matrix. The data storage, however, is organized in such a way as to benefit from NUMA architectures: the rows of the matrix are distributed evenly over the nodes. This implies that a good load balancing can only be achieved for matrices with (significantly) more rows than NUMA nodes. Avoid flat, long matrices.
There is no guarantee about placement or ordering of matrix elements, in particular none about the contiguity of element storage.
Entry | the entry type (usually a Dune::FieldMatrix<n,m,double>) |
\TODO: Currently, the implementation is mainly intended to gather a bag of coefficient vectors in one place, rather than to provide a fully-fledged matrix class.
Definition at line 447 of file numaMatrix.hh.
Public Types | |
typedef size_t | size_type |
typedef Entry | value_type |
typedef Dune::FieldTraits< Entry >::field_type | field_type |
the type of the scalar field. More... | |
typedef Dune::FieldTraits< field_type >::real_type | real_type |
typedef NumaDenseMatrixDetail::RowIterator< Entry > | RowIterator |
typedef NumaDenseMatrixDetail::RowIterator< Entry const > | ConstRowIterator |
typedef RowIterator::value_type | row_type |
typedef ConstRowIterator::value_type | const_row_type |
Public Member Functions | |
size_type | M () const |
Return the number of columns. More... | |
real_type | frobenius_norm () const |
frobenius norm: sqrt(sum over squared frobenius norms of entries) More... | |
real_type | frobenius_norm2 () const |
frobenius norm squared: sum over squared frobenius norms of entries More... | |
Construction, assignment, and resize. | |
NumaDenseMatrix ()=default | |
Creates a 0 x 0 matrix. More... | |
NumaDenseMatrix (NumaDenseMatrix const &a)=default | |
Copy constructor. More... | |
NumaDenseMatrix (NumaDenseMatrix &&a)=default | |
Move constructor. More... | |
NumaDenseMatrix (size_type r, size_type c, value_type v=value_type()) | |
Creates an r x c matrix with given entries. More... | |
NumaDenseMatrix & | operator= (NumaDenseMatrix const &a)=default |
Copy assignment. More... | |
Self & | operator= (field_type const &a) |
Assignment from scalar. More... | |
void | resize (size_type r, size_type c) |
Resizes the matrix to r x c, leaving the entries in an undefined state. More... | |
void | setSize (size_type r, size_type c) |
Resizes the matrix to r x c, leaving the entries in an undefined state. More... | |
Entry access | |
RowIterator | begin () |
Get iterator to first row. More... | |
RowIterator | end () |
Get iterator to one beyond last row. More... | |
ConstRowIterator | begin () const |
Get const iterator to first row. More... | |
ConstRowIterator | end () const |
Get const iterator to one beyond last row. More... | |
row_type | operator[] (size_type row) |
The subscript operator. More... | |
const_row_type const | operator[] (size_type row) const |
The const subscript operator. More... | |
Linear algebra operations. | |
Self & | operator*= (field_type const &a) |
Multiplication with a scalar. More... | |
Self & | operator/= (field_type const &scalar) |
Division by a scalar. More... | |
Self & | operator+= (Self const &b) |
Matrix addition. Both matrices have to have the same sizes. More... | |
Self & | operator-= (Self const &b) |
Matrix subtraction. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<class Entry > | |
std::ostream & | operator<< (std::ostream &out, NumaDenseMatrix< Entry > const &mat) |
typedef ConstRowIterator::value_type Kaskade::NumaDenseMatrix< Entry >::const_row_type |
Definition at line 466 of file numaMatrix.hh.
typedef NumaDenseMatrixDetail::RowIterator<Entry const> Kaskade::NumaDenseMatrix< Entry >::ConstRowIterator |
Definition at line 463 of file numaMatrix.hh.
typedef Dune::FieldTraits<Entry>::field_type Kaskade::NumaDenseMatrix< Entry >::field_type |
the type of the scalar field.
Definition at line 459 of file numaMatrix.hh.
typedef Dune::FieldTraits<field_type>::real_type Kaskade::NumaDenseMatrix< Entry >::real_type |
Definition at line 460 of file numaMatrix.hh.
typedef RowIterator::value_type Kaskade::NumaDenseMatrix< Entry >::row_type |
Definition at line 465 of file numaMatrix.hh.
typedef NumaDenseMatrixDetail::RowIterator<Entry> Kaskade::NumaDenseMatrix< Entry >::RowIterator |
Definition at line 462 of file numaMatrix.hh.
typedef size_t Kaskade::NumaDenseMatrix< Entry >::size_type |
Definition at line 453 of file numaMatrix.hh.
typedef Entry Kaskade::NumaDenseMatrix< Entry >::value_type |
Definition at line 454 of file numaMatrix.hh.
|
default |
Creates a 0 x 0 matrix.
|
default |
Copy constructor.
|
default |
Move constructor.
|
inline |
Creates an r x c matrix with given entries.
Definition at line 491 of file numaMatrix.hh.
|
inline |
Get iterator to first row.
Definition at line 539 of file numaMatrix.hh.
Referenced by Kaskade::NumaDenseMatrix< Entry >::operator<<().
|
inline |
Get const iterator to first row.
Definition at line 549 of file numaMatrix.hh.
|
inline |
Get iterator to one beyond last row.
Definition at line 544 of file numaMatrix.hh.
Referenced by Kaskade::NumaDenseMatrix< Entry >::operator<<().
|
inline |
Get const iterator to one beyond last row.
Definition at line 554 of file numaMatrix.hh.
|
inline |
frobenius norm: sqrt(sum over squared frobenius norms of entries)
Definition at line 625 of file numaMatrix.hh.
|
inline |
frobenius norm squared: sum over squared frobenius norms of entries
Definition at line 630 of file numaMatrix.hh.
Referenced by Kaskade::NumaDenseMatrix< Entry >::frobenius_norm().
|
inline |
Return the number of columns.
Definition at line 577 of file numaMatrix.hh.
|
inline |
Multiplication with a scalar.
Definition at line 587 of file numaMatrix.hh.
|
inline |
Matrix addition. Both matrices have to have the same sizes.
Definition at line 605 of file numaMatrix.hh.
|
inline |
Matrix subtraction.
Definition at line 614 of file numaMatrix.hh.
|
inline |
Division by a scalar.
Definition at line 596 of file numaMatrix.hh.
|
inline |
Assignment from scalar.
Definition at line 503 of file numaMatrix.hh.
|
default |
Copy assignment.
|
inline |
The subscript operator.
Rows do not exist as persistent data structures in the matrix. Hence the subscript operator returns a row object (in fact a view onto data held by the matrix) by value.
Definition at line 562 of file numaMatrix.hh.
|
inline |
The const subscript operator.
Rows do not exist as persistent data structures in the matrix. Hence the subscript operator returns a row object (in fact a view onto data held by the matrix) by value.
Definition at line 570 of file numaMatrix.hh.
|
inline |
Resizes the matrix to r x c, leaving the entries in an undefined state.
On resize, all row objects and iterators are invalidated. This method adheres to the Dune::DynamicMatrix interface.
Definition at line 514 of file numaMatrix.hh.
Referenced by Kaskade::NumaDenseMatrix< Entry >::setSize().
|
inline |
Resizes the matrix to r x c, leaving the entries in an undefined state.
On resize, all row objects and iterators are invalidated. This method adheres to the Dune::Matrix interface.
Definition at line 524 of file numaMatrix.hh.
|
related |
Definition at line 640 of file numaMatrix.hh.