Skip to content
Snippets Groups Projects
Commit 3d23f92a authored by Carsten Gräser's avatar Carsten Gräser
Browse files

Export missing functionality in MatrixIndexSet

The `MatrixIndexSet` class provides access to an
incomplete subset of its internal data. While
the number of rows is exported, the number of cols
and the column indices per row have been missing
so far. This was an oversight, since one can hardly
use the class without this, unless one relies on
the dedicated `exportIdx()` method for `BCRSMatrix`.

With the missing data exported, one can now easily
use `MatrixIndexSet` to build patterns for
other sparse matrix classes.
parent 52260791
No related branches found
No related tags found
1 merge request!559Export missing functionality in MatrixIndexSet
Pipeline #69094 passed
......@@ -142,6 +142,22 @@ namespace Dune {
/** \brief Return the number of rows */
size_type rows() const {return rows_;}
/** \brief Return the number of columns */
size_type cols() const {return cols_;}
/**
* \brief Return column indices of entries in given row
*
* This returns a range of all column indices
* that have been added for the given column.
* Since there are different internal implementations
* of this range, the result is stored in a std::variant<...>
* which has to be accessed using `std::visit`.
*/
const auto& columnIndices(size_type row) const {
return indices_[row];
}
/** \brief Return the number of entries in a given row */
size_type rowsize(size_type row) const {
return std::visit([&](const auto& rowIndices) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment