Storm
A Modern Probabilistic Model Checker
|
The flexible sparse matrix is used during state elimination. More...
#include <FlexibleSparseMatrix.h>
Public Types | |
typedef uint_fast64_t | index_type |
typedef ValueType | value_type |
typedef std::vector< storm::storage::MatrixEntry< index_type, value_type > > | row_type |
typedef row_type::iterator | iterator |
typedef row_type::const_iterator | const_iterator |
Public Member Functions | |
FlexibleSparseMatrix ()=default | |
Constructs an empty flexible sparse matrix. | |
FlexibleSparseMatrix (index_type rows) | |
Constructs a flexible sparse matrix with rows many rows. | |
FlexibleSparseMatrix (storm::storage::SparseMatrix< ValueType > const &matrix, bool setAllValuesToOne=false, bool revertEquationSystem=false) | |
Constructs a flexible sparse matrix from a sparse matrix. | |
void | reserveInRow (index_type row, index_type numberOfElements) |
Reserves space for elements in row. | |
row_type & | getRow (index_type) |
Returns an object representing the given row. | |
row_type const & | getRow (index_type) const |
Returns an object representing the given row. | |
row_type & | getRow (index_type rowGroup, index_type offset) |
Returns an object representing the offset'th row in the rowgroup. | |
row_type const & | getRow (index_type rowGroup, index_type entryInGroup) const |
Returns an object representing the offset'th row in the rowgroup. | |
std::vector< index_type > const & | getRowGroupIndices () const |
Returns the grouping of rows of this matrix. | |
index_type | getRowCount () const |
Returns the number of rows of the matrix. | |
index_type | getColumnCount () const |
Returns the number of columns of the matrix. | |
index_type | getNonzeroEntryCount () const |
Returns the cached number of nonzero entries in the matrix. | |
index_type | getRowGroupCount () const |
Returns the number of row groups in the matrix. | |
index_type | getRowGroupSize (index_type group) const |
Returns the size of the given row group. | |
value_type | getRowSum (index_type row) const |
Computes the sum of the entries in a given row. | |
void | updateDimensions () |
Recomputes the number of columns and the number of non-zero entries. | |
bool | empty () const |
Checks if the matrix has no elements. | |
bool | hasTrivialRowGrouping () const |
Retrieves whether the matrix has a (possibly) trivial row grouping. | |
void | filterEntries (storm::storage::BitVector const &rowConstraint, storm::storage::BitVector const &columnConstraint) |
Erases all entries whose row and column does not satisfy the given rowConstraint and the given columnConstraint. | |
storm::storage::SparseMatrix< ValueType > | createSparseMatrix () |
Creates a sparse matrix from the flexible sparse matrix. | |
storm::storage::SparseMatrix< ValueType > | createSparseMatrix (storm::storage::BitVector const &rowConstraint, storm::storage::BitVector const &columnConstraint) |
Creates a sparse matrix from the flexible sparse matrix. | |
bool | rowHasDiagonalElement (storm::storage::sparse::state_type state) |
Checks whether the given state has a self-loop with an arbitrary probability in the probability matrix. | |
std::ostream & | printRow (std::ostream &out, index_type const &rowIndex) const |
Print row. | |
Friends | |
template<typename TPrime > | |
std::ostream & | operator<< (std::ostream &out, FlexibleSparseMatrix< TPrime > const &matrix) |
The flexible sparse matrix is used during state elimination.
Definition at line 21 of file FlexibleSparseMatrix.h.
typedef row_type::const_iterator storm::storage::FlexibleSparseMatrix< ValueType >::const_iterator |
Definition at line 30 of file FlexibleSparseMatrix.h.
typedef uint_fast64_t storm::storage::FlexibleSparseMatrix< ValueType >::index_type |
Definition at line 26 of file FlexibleSparseMatrix.h.
typedef row_type::iterator storm::storage::FlexibleSparseMatrix< ValueType >::iterator |
Definition at line 29 of file FlexibleSparseMatrix.h.
typedef std::vector<storm::storage::MatrixEntry<index_type, value_type> > storm::storage::FlexibleSparseMatrix< ValueType >::row_type |
Definition at line 28 of file FlexibleSparseMatrix.h.
typedef ValueType storm::storage::FlexibleSparseMatrix< ValueType >::value_type |
Definition at line 27 of file FlexibleSparseMatrix.h.
|
default |
Constructs an empty flexible sparse matrix.
storm::storage::FlexibleSparseMatrix< ValueType >::FlexibleSparseMatrix | ( | index_type | rows | ) |
Constructs a flexible sparse matrix with rows many rows.
rows | number of rows. |
Definition at line 14 of file FlexibleSparseMatrix.cpp.
storm::storage::FlexibleSparseMatrix< ValueType >::FlexibleSparseMatrix | ( | storm::storage::SparseMatrix< ValueType > const & | matrix, |
bool | setAllValuesToOne = false , |
||
bool | revertEquationSystem = false |
||
) |
Constructs a flexible sparse matrix from a sparse matrix.
matrix | Sparse matrix to construct from. |
setAllValuesToOne | If true, all set entries are set to one. Default is false. |
revertEquationSystem | If true, the matrix that will be created is the matrix (1-A), where A is the provided matrix. |
Definition at line 19 of file FlexibleSparseMatrix.cpp.
storm::storage::SparseMatrix< ValueType > storm::storage::FlexibleSparseMatrix< ValueType >::createSparseMatrix | ( | ) |
Creates a sparse matrix from the flexible sparse matrix.
Definition at line 181 of file FlexibleSparseMatrix.cpp.
storm::storage::SparseMatrix< ValueType > storm::storage::FlexibleSparseMatrix< ValueType >::createSparseMatrix | ( | storm::storage::BitVector const & | rowConstraint, |
storm::storage::BitVector const & | columnConstraint | ||
) |
Creates a sparse matrix from the flexible sparse matrix.
Only the selected rows and columns will be considered. Empty rowGroups will be ignored
rowConstraint | A bit vector indicating which rows to keep. |
columnConstraint | A bit vector indicating which columns to keep. |
Definition at line 214 of file FlexibleSparseMatrix.cpp.
bool storm::storage::FlexibleSparseMatrix< ValueType >::empty | ( | ) | const |
Checks if the matrix has no elements.
Definition at line 147 of file FlexibleSparseMatrix.cpp.
void storm::storage::FlexibleSparseMatrix< ValueType >::filterEntries | ( | storm::storage::BitVector const & | rowConstraint, |
storm::storage::BitVector const & | columnConstraint | ||
) |
Erases all entries whose row and column does not satisfy the given rowConstraint and the given columnConstraint.
rowConstraint | A bit vector indicating which row entries to keep. |
columnConstraint | A bit vector indicating which column entries to keep. |
Definition at line 162 of file FlexibleSparseMatrix.cpp.
FlexibleSparseMatrix< ValueType >::index_type storm::storage::FlexibleSparseMatrix< ValueType >::getColumnCount | ( | ) | const |
Returns the number of columns of the matrix.
Definition at line 105 of file FlexibleSparseMatrix.cpp.
FlexibleSparseMatrix< ValueType >::index_type storm::storage::FlexibleSparseMatrix< ValueType >::getNonzeroEntryCount | ( | ) | const |
Returns the cached number of nonzero entries in the matrix.
Definition at line 110 of file FlexibleSparseMatrix.cpp.
FlexibleSparseMatrix< ValueType >::row_type const & storm::storage::FlexibleSparseMatrix< ValueType >::getRow | ( | index_type | rowGroup, |
index_type | entryInGroup | ||
) | const |
Returns an object representing the offset'th row in the rowgroup.
rowGroup | the row group |
offset | which row in the group |
Definition at line 88 of file FlexibleSparseMatrix.cpp.
FlexibleSparseMatrix< ValueType >::row_type & storm::storage::FlexibleSparseMatrix< ValueType >::getRow | ( | index_type | rowGroup, |
index_type | offset | ||
) |
Returns an object representing the offset'th row in the rowgroup.
rowGroup | the row group |
offset | which row in the group |
Definition at line 81 of file FlexibleSparseMatrix.cpp.
FlexibleSparseMatrix< ValueType >::row_type & storm::storage::FlexibleSparseMatrix< ValueType >::getRow | ( | index_type | index | ) |
Returns an object representing the given row.
row | The row to get. |
Definition at line 71 of file FlexibleSparseMatrix.cpp.
FlexibleSparseMatrix< ValueType >::row_type const & storm::storage::FlexibleSparseMatrix< ValueType >::getRow | ( | index_type | index | ) | const |
Returns an object representing the given row.
row | The row to get. |
Definition at line 76 of file FlexibleSparseMatrix.cpp.
FlexibleSparseMatrix< ValueType >::index_type storm::storage::FlexibleSparseMatrix< ValueType >::getRowCount | ( | ) | const |
Returns the number of rows of the matrix.
Definition at line 100 of file FlexibleSparseMatrix.cpp.
FlexibleSparseMatrix< ValueType >::index_type storm::storage::FlexibleSparseMatrix< ValueType >::getRowGroupCount | ( | ) | const |
Returns the number of row groups in the matrix.
Definition at line 115 of file FlexibleSparseMatrix.cpp.
std::vector< typename FlexibleSparseMatrix< ValueType >::index_type > const & storm::storage::FlexibleSparseMatrix< ValueType >::getRowGroupIndices | ( | ) | const |
Returns the grouping of rows of this matrix.
Definition at line 95 of file FlexibleSparseMatrix.cpp.
FlexibleSparseMatrix< ValueType >::index_type storm::storage::FlexibleSparseMatrix< ValueType >::getRowGroupSize | ( | index_type | group | ) | const |
Returns the size of the given row group.
group | The group whose size to retrieve. |
Definition at line 120 of file FlexibleSparseMatrix.cpp.
ValueType storm::storage::FlexibleSparseMatrix< ValueType >::getRowSum | ( | index_type | row | ) | const |
Computes the sum of the entries in a given row.
row | The row that is to be summed. |
Definition at line 125 of file FlexibleSparseMatrix.cpp.
bool storm::storage::FlexibleSparseMatrix< ValueType >::hasTrivialRowGrouping | ( | ) | const |
Retrieves whether the matrix has a (possibly) trivial row grouping.
Definition at line 157 of file FlexibleSparseMatrix.cpp.
std::ostream & storm::storage::FlexibleSparseMatrix< ValueType >::printRow | ( | std::ostream & | out, |
index_type const & | rowIndex | ||
) | const |
Print row.
out | Output stream. |
rowIndex | Index of row to print. |
Definition at line 281 of file FlexibleSparseMatrix.cpp.
void storm::storage::FlexibleSparseMatrix< ValueType >::reserveInRow | ( | index_type | row, |
index_type | numberOfElements | ||
) |
Reserves space for elements in row.
row | Row to reserve in. |
numberOfElements | Number of elements to reserve space for. |
Definition at line 66 of file FlexibleSparseMatrix.cpp.
bool storm::storage::FlexibleSparseMatrix< ValueType >::rowHasDiagonalElement | ( | storm::storage::sparse::state_type | state | ) |
Checks whether the given state has a self-loop with an arbitrary probability in the probability matrix.
state | The state for which to check whether it possesses a self-loop. |
Definition at line 267 of file FlexibleSparseMatrix.cpp.
void storm::storage::FlexibleSparseMatrix< ValueType >::updateDimensions | ( | ) |
Recomputes the number of columns and the number of non-zero entries.
Definition at line 134 of file FlexibleSparseMatrix.cpp.
|
friend |