Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::storage::SubmatrixBuilder< ValueType > Class Template Reference

Helper class to extract submatrices of a fixed sparse matrix. More...

#include <SubmatrixBuilder.h>

Public Types

using index_type = typename SparseMatrix<ValueType>::index_type
using entry_type = MatrixEntry<index_type, ValueType>

Public Member Functions

 SubmatrixBuilder (SparseMatrix< ValueType > const &matrix)
template<typename RowConstraintType, typename ColumnConstraintType>
SparseMatrix< ValueType > getByRowConstraint (RowConstraintType const &rowConstraint, ColumnConstraintType const &columnConstraint, bool const insertDiagonalElement, storm::OptionalRef< storm::storage::BitVector const > makeZeroColumns=storm::NullRef) const
 Creates the submatrix that keeps only the given rows and columns If the matrix has a non-trivial row grouping, the submatrix has one row group for each original group that has at least one selected row.
template<typename RowConstraintType, typename ColumnConstraintType>
SparseMatrix< ValueType > getByRowGroupConstraint (RowConstraintType const &rowGroupConstraint, ColumnConstraintType const &columnConstraint, bool const insertDiagonalElement, storm::OptionalRef< storm::storage::BitVector const > makeZeroColumns=storm::NullRef) const
 Creates the submatrix that keeps only the given row groups and columns The row group structure of the matrix is preserved, i.e., the i'th selected row group becomes row group i of the submatrix.

Detailed Description

template<typename ValueType>
class storm::storage::SubmatrixBuilder< ValueType >

Helper class to extract submatrices of a fixed sparse matrix.

Note
The referenced matrix must outlive this object and must not change its column count while this object is used.
Template Parameters
ValueTypeThe value type of the matrix.

Definition at line 24 of file SubmatrixBuilder.h.

Member Typedef Documentation

◆ entry_type

template<typename ValueType>
using storm::storage::SubmatrixBuilder< ValueType >::entry_type = MatrixEntry<index_type, ValueType>

Definition at line 27 of file SubmatrixBuilder.h.

◆ index_type

template<typename ValueType>
using storm::storage::SubmatrixBuilder< ValueType >::index_type = typename SparseMatrix<ValueType>::index_type

Definition at line 26 of file SubmatrixBuilder.h.

Constructor & Destructor Documentation

◆ SubmatrixBuilder()

template<typename ValueType>
storm::storage::SubmatrixBuilder< ValueType >::SubmatrixBuilder ( SparseMatrix< ValueType > const & matrix)
inlineexplicit

Definition at line 29 of file SubmatrixBuilder.h.

Member Function Documentation

◆ getByRowConstraint()

template<typename ValueType>
template<typename RowConstraintType, typename ColumnConstraintType>
SparseMatrix< ValueType > storm::storage::SubmatrixBuilder< ValueType >::getByRowConstraint ( RowConstraintType const & rowConstraint,
ColumnConstraintType const & columnConstraint,
bool const insertDiagonalElement,
storm::OptionalRef< storm::storage::BitVector const > makeZeroColumns = storm::NullRef ) const
inline

Creates the submatrix that keeps only the given rows and columns If the matrix has a non-trivial row grouping, the submatrix has one row group for each original group that has at least one selected row.

Template Parameters
RowConstraintType,ColumnConstraintTypeTypes (not necessarily equal) that can be iterated over. Iteration must yield the selected indices (convertible to uint64_t) in strictly ascending order and must be repeatable (i.e., the constraint is iterated multiple times).
Parameters
rowConstraintThe rows to keep.
columnConstraintThe columns to keep.
insertDiagonalElementIf true, every row i of the submatrix contains an entry in column i (with value zero if there is no such entry in the original matrix), provided that the submatrix has such a column.
makeZeroColumnsIf given, entries in these (original) columns are dropped from the submatrix (but the columns remain in the submatrix). Must be of size matrix.getColumnCount().
Exceptions
InvalidArgumentExceptionif a constraint is empty.

Definition at line 49 of file SubmatrixBuilder.h.

◆ getByRowGroupConstraint()

template<typename ValueType>
template<typename RowConstraintType, typename ColumnConstraintType>
SparseMatrix< ValueType > storm::storage::SubmatrixBuilder< ValueType >::getByRowGroupConstraint ( RowConstraintType const & rowGroupConstraint,
ColumnConstraintType const & columnConstraint,
bool const insertDiagonalElement,
storm::OptionalRef< storm::storage::BitVector const > makeZeroColumns = storm::NullRef ) const
inline

Creates the submatrix that keeps only the given row groups and columns The row group structure of the matrix is preserved, i.e., the i'th selected row group becomes row group i of the submatrix.

If insertDiagonalElement is true, the rows of row group i contain an entry in column i.

Template Parameters
RowConstraintType,ColumnConstraintTypeSee getByRowConstraint.
Parameters
rowGroupConstraintThe row groups to keep.
See also
getByRowConstraint for the remaining parameters.

Definition at line 65 of file SubmatrixBuilder.h.


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