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.
Merge request reports
Activity
I forgot to add this, when updating the
MatrixIndexSet
class in !550 (merged).added 1 commit
- 3d23f92a - Export missing functionality in MatrixIndexSet
enabled an automatic merge when the pipeline for 3d23f92a succeeds
mentioned in commit 64f5f518
143 143 size_type rows() const {return rows_;} 144 144 145 /** \brief Return the number of columns */ 146 size_type cols() const {return cols_;} 147 148 /** 149 * \brief Return column indices of entries in given row 150 * 151 * This returns a range of all column indices 152 * that have been added for the given column. 153 * Since there are different internal implementations 154 * of this range, the result is stored in a std::variant<...> 155 * which has to be accessed using `std::visit`. 156 */ 157 const auto& columnIndices(size_type row) const { 158 return indices_[row]; IMO there's no reason to make
FlatSet
public, because you don't need to know the type. The documentation tells you all you need to know: You get aconst
reference to anstd:variant<...>
storing a range of unspecified type. Hence you should usestd::visit([&](const auto& columnIndex) { ... }, matrixIndexSet.columnIndices(row));
mentioned in merge request !607