Storm
A Modern Probabilistic Model Checker
|
A class that holds a possibly non-square matrix in the compressed row storage format. More...
#include <SparseMatrix.h>
Classes | |
class | const_rows |
This class represents a number of consecutive rows of the matrix. More... | |
class | rows |
This class represents a number of consecutive rows of the matrix. More... | |
Public Types | |
enum | MatrixStatus { UNINITIALIZED , INITIALIZED } |
An enum representing the internal state of the matrix. More... | |
typedef SparseMatrixIndexType | index_type |
typedef ValueType | value_type |
typedef std::vector< MatrixEntry< index_type, value_type > >::iterator | iterator |
typedef std::vector< MatrixEntry< index_type, value_type > >::const_iterator | const_iterator |
Public Member Functions | |
SparseMatrix () | |
Constructs an empty sparse matrix. | |
SparseMatrix (SparseMatrix< value_type > const &other) | |
Constructs a sparse matrix by performing a deep-copy of the given matrix. | |
SparseMatrix (SparseMatrix< value_type > const &other, bool insertDiagonalElements) | |
Constructs a sparse matrix by performing a deep-copy of the given matrix. | |
SparseMatrix (SparseMatrix< value_type > &&other) | |
Constructs a sparse matrix by moving the contents of the given matrix to the newly created one. | |
SparseMatrix (index_type columnCount, std::vector< index_type > const &rowIndications, std::vector< MatrixEntry< index_type, value_type > > const &columnsAndValues, boost::optional< std::vector< index_type > > const &rowGroupIndices) | |
Constructs a sparse matrix by copying the given contents. | |
SparseMatrix (index_type columnCount, std::vector< index_type > &&rowIndications, std::vector< MatrixEntry< index_type, value_type > > &&columnsAndValues, boost::optional< std::vector< index_type > > &&rowGroupIndices) | |
Constructs a sparse matrix by moving the given contents. | |
SparseMatrix< value_type > & | operator= (SparseMatrix< value_type > const &other) |
Assigns the contents of the given matrix to the current one by deep-copying its contents. | |
SparseMatrix< value_type > & | operator= (SparseMatrix< value_type > &&other) |
Assigns the contents of the given matrix to the current one by moving its contents. | |
bool | operator== (SparseMatrix< value_type > const &other) const |
Determines whether the current and the given matrix are semantically equal. | |
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 | getEntryCount () const |
Returns the number of entries in the matrix. | |
index_type | getRowGroupEntryCount (index_type const group) const |
Returns the number of entries in the given row group of the matrix. | |
index_type | getNonzeroEntryCount () const |
Returns the cached number of nonzero entries in the matrix. | |
void | updateNonzeroEntryCount () const |
Recompute the nonzero entry count. | |
void | updateDimensions () const |
Recomputes the number of columns and the number of non-zero entries. | |
void | updateNonzeroEntryCount (std::make_signed< index_type >::type difference) |
Change the nonzero entry count by the provided value. | |
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. | |
index_type | getSizeOfLargestRowGroup () const |
Returns the size of the largest row group of the matrix. | |
index_type | getNumRowsInRowGroups (storm::storage::BitVector const &groupConstraint) const |
Returns the total number of rows that are in one of the specified row groups. | |
std::vector< index_type > const & | getRowGroupIndices () const |
Returns the grouping of rows of this matrix. | |
boost::integer_range< index_type > | getRowGroupIndices (index_type group) const |
Returns the row indices within the given group. | |
std::vector< index_type > | swapRowGroupIndices (std::vector< index_type > &&newRowGrouping) |
Swaps the grouping of rows of this matrix. | |
void | setRowGroupIndices (std::vector< index_type > const &newRowGroupIndices) |
Sets the row grouping to the given one. | |
bool | hasTrivialRowGrouping () const |
Retrieves whether the matrix has a trivial row grouping. | |
void | makeRowGroupingTrivial () |
Makes the row grouping of this matrix trivial. | |
storm::storage::BitVector | getRowFilter (storm::storage::BitVector const &groupConstraint) const |
Returns a bitvector representing the set of rows, with all indices set that correspond to one of the selected row groups. | |
storm::storage::BitVector | getRowFilter (storm::storage::BitVector const &groupConstraint, storm::storage::BitVector const &columnConstraints) const |
Returns the indices of all rows that. | |
storm::storage::BitVector | getRowGroupFilter (storm::storage::BitVector const &rowConstraint, bool setIfForAllRowsInGroup) const |
Returns the indices of all row groups selected by the row constraints. | |
void | makeRowsAbsorbing (storm::storage::BitVector const &rows, bool dropZeroEntries=false) |
This function makes the given rows absorbing. | |
void | makeRowGroupsAbsorbing (storm::storage::BitVector const &rowGroupConstraint, bool dropZeroEntries=false) |
This function makes the groups of rows given by the bit vector absorbing. | |
void | makeRowDirac (index_type row, index_type column, bool dropZeroEntries=false) |
This function makes the given row Dirac. | |
std::vector< ValueType > | getRowSumVector () const |
Sums the entries in all rows. | |
value_type | getConstrainedRowSum (index_type row, storm::storage::BitVector const &columns) const |
Sums the entries in the given row and columns. | |
std::vector< value_type > | getConstrainedRowSumVector (storm::storage::BitVector const &rowConstraint, storm::storage::BitVector const &columnConstraint) const |
Computes a vector whose i-th entry is the sum of the entries in the i-th selected row where only those entries are added that are in selected columns. | |
std::vector< value_type > | getConstrainedRowGroupSumVector (storm::storage::BitVector const &rowGroupConstraint, storm::storage::BitVector const &columnConstraint) const |
Computes a vector whose entries represent the sums of selected columns for all rows in selected row groups. | |
SparseMatrix | getSubmatrix (bool useGroups, storm::storage::BitVector const &rowConstraint, storm::storage::BitVector const &columnConstraint, bool insertDiagonalEntries=false, storm::storage::BitVector const &makeZeroColumns=storm::storage::BitVector()) const |
Creates a submatrix of the current matrix by dropping all rows and columns whose bits are not set to one in the given bit vector. | |
SparseMatrix | restrictRows (storm::storage::BitVector const &rowsToKeep, bool allowEmptyRowGroups=false) const |
Restrict rows in grouped rows matrix. | |
SparseMatrix | permuteRows (std::vector< index_type > const &inversePermutation) const |
Permute rows of the matrix according to the vector. | |
SparseMatrix | permuteRowGroupsAndColumns (std::vector< index_type > const &inverseRowGroupPermutation, std::vector< index_type > const &columnPermutation) const |
Permutes row groups and columns of the matrix according to the given permutations. | |
SparseMatrix | filterEntries (storm::storage::BitVector const &rowFilter) const |
Returns a copy of this matrix that only considers entries in the selected rows. | |
void | dropZeroEntries () |
Removes all zero entries from this. | |
bool | compareRows (index_type i1, index_type i2) const |
Compares two rows. | |
BitVector | duplicateRowsInRowgroups () const |
Finds duplicate rows in a rowgroup. | |
void | swapRows (index_type const &row1, index_type const &row2) |
Swaps the two rows. | |
SparseMatrix | selectRowsFromRowGroups (std::vector< index_type > const &rowGroupToRowIndexMapping, bool insertDiagonalEntries=true) const |
Selects exactly one row from each row group of this matrix and returns the resulting matrix. | |
SparseMatrix | selectRowsFromRowIndexSequence (std::vector< index_type > const &rowIndexSequence, bool insertDiagonalEntries=true) const |
Selects the rows that are given by the sequence of row indices, allowing to select rows arbitrarily often and with an arbitrary order The resulting matrix will have a trivial row grouping. | |
storm::storage::SparseMatrix< value_type > | transpose (bool joinGroups=false, bool keepZeros=false) const |
Transposes the matrix. | |
SparseMatrix< ValueType > | transposeSelectedRowsFromRowGroups (std::vector< uint64_t > const &rowGroupChoices, bool keepZeros=false) const |
Transposes the matrix w.r.t. | |
void | convertToEquationSystem () |
Transforms the matrix into an equation system. | |
void | invertDiagonal () |
Inverts all entries on the diagonal, i.e. | |
void | negateAllNonDiagonalEntries () |
Negates (w.r.t. | |
void | deleteDiagonalEntries (bool dropZeroEntries=false) |
Sets all diagonal elements to zero. | |
std::pair< storm::storage::SparseMatrix< value_type >, std::vector< value_type > > | getJacobiDecomposition () const |
Calculates the Jacobi decomposition of this sparse matrix. | |
template<typename OtherValueType , typename ResultValueType = OtherValueType> | |
ResultValueType | getPointwiseProductRowSum (storm::storage::SparseMatrix< OtherValueType > const &otherMatrix, index_type const &row) const |
Performs a pointwise multiplication of the entries in the given row of this matrix and the entries of the given row of the other matrix and returns the sum. | |
template<typename OtherValueType , typename ResultValueType = OtherValueType> | |
std::vector< ResultValueType > | getPointwiseProductRowSumVector (storm::storage::SparseMatrix< OtherValueType > const &otherMatrix) const |
Performs a pointwise matrix multiplication of the matrix with the given matrix and returns a vector containing the sum of the entries in each row of the resulting matrix. | |
void | multiplyWithVector (std::vector< value_type > const &vector, std::vector< value_type > &result, std::vector< value_type > const *summand=nullptr) const |
Multiplies the matrix with the given vector and writes the result to the given result vector. | |
void | multiplyWithVectorForward (std::vector< value_type > const &vector, std::vector< value_type > &result, std::vector< value_type > const *summand=nullptr) const |
void | multiplyWithVectorBackward (std::vector< value_type > const &vector, std::vector< value_type > &result, std::vector< value_type > const *summand=nullptr) const |
void | multiplyAndReduce (storm::solver::OptimizationDirection const &dir, std::vector< uint64_t > const &rowGroupIndices, std::vector< ValueType > const &vector, std::vector< ValueType > const *summand, std::vector< ValueType > &result, std::vector< uint64_t > *choices) const |
Multiplies the matrix with the given vector, reduces it according to the given direction and and writes the result to the given result vector. | |
void | multiplyAndReduceForward (storm::solver::OptimizationDirection const &dir, std::vector< uint64_t > const &rowGroupIndices, std::vector< ValueType > const &vector, std::vector< ValueType > const *b, std::vector< ValueType > &result, std::vector< uint64_t > *choices) const |
template<typename Compare > | |
void | multiplyAndReduceForward (std::vector< uint64_t > const &rowGroupIndices, std::vector< ValueType > const &vector, std::vector< ValueType > const *summand, std::vector< ValueType > &result, std::vector< uint64_t > *choices) const |
void | multiplyAndReduceBackward (storm::solver::OptimizationDirection const &dir, std::vector< uint64_t > const &rowGroupIndices, std::vector< ValueType > const &vector, std::vector< ValueType > const *b, std::vector< ValueType > &result, std::vector< uint64_t > *choices) const |
template<typename Compare > | |
void | multiplyAndReduceBackward (std::vector< uint64_t > const &rowGroupIndices, std::vector< ValueType > const &vector, std::vector< ValueType > const *b, std::vector< ValueType > &result, std::vector< uint64_t > *choices) const |
value_type | multiplyRowWithVector (index_type row, std::vector< value_type > const &vector) const |
Multiplies a single row of the matrix with the given vector and returns the result. | |
void | multiplyVectorWithMatrix (std::vector< value_type > const &vector, std::vector< value_type > &result) const |
Multiplies the vector to the matrix from the left and writes the result to the given result vector. | |
void | scaleRowsInPlace (std::vector< value_type > const &factors) |
Scales each row of the matrix, i.e., multiplies each element in row i with factors[i]. | |
void | divideRowsInPlace (std::vector< value_type > const &divisors) |
Divides each row of the matrix, i.e., divides each element in row i with divisors[i]. | |
void | performSuccessiveOverRelaxationStep (ValueType omega, std::vector< ValueType > &x, std::vector< ValueType > const &b) const |
Performs one step of the successive over-relaxation technique. | |
void | performWalkerChaeStep (std::vector< ValueType > const &x, std::vector< ValueType > const &columnSums, std::vector< ValueType > const &b, std::vector< ValueType > const &ax, std::vector< ValueType > &result) const |
Performs one step of the Walker-Chae technique. | |
value_type | getRowSum (index_type row) const |
Computes the sum of the entries in a given row. | |
index_type | getNonconstantEntryCount () const |
Returns the number of non-constant entries. | |
index_type | getNonconstantRowGroupCount () const |
Returns the number of rowGroups that contain a non-constant value. | |
bool | isProbabilistic () const |
Checks for each row whether it sums to one. | |
bool | hasOnlyPositiveEntries () const |
Checks whether each present entry is strictly positive (omitted entries are not considered). | |
template<typename OtherValueType > | |
bool | isSubmatrixOf (SparseMatrix< OtherValueType > const &matrix) const |
Checks if the current matrix is a submatrix of the given matrix, where a matrix A is called a submatrix of B if B has no entries in position where A has none. | |
bool | isIdentityMatrix () const |
std::string | getDimensionsAsString () const |
Returns a string describing the dimensions of the matrix. | |
void | printAsMatlabMatrix (std::ostream &out) const |
Prints the matrix in a dense format, as also used by e.g. | |
std::size_t | hash () const |
Calculates a hash value over all values contained in the matrix. | |
const_rows | getRows (index_type startRow, index_type endRow) const |
Returns an object representing the consecutive rows given by the parameters. | |
rows | getRows (index_type startRow, index_type endRow) |
Returns an object representing the consecutive rows given by the parameters. | |
const_rows | getRow (index_type row) const |
Returns an object representing the given row. | |
rows | getRow (index_type row) |
Returns an object representing the given row. | |
const_rows | getRow (index_type rowGroup, index_type offset) const |
Returns an object representing the offset'th row in the rowgroup. | |
rows | getRow (index_type rowGroup, index_type offset) |
Returns an object representing the offset'th row in the rowgroup. | |
const_rows | getRowGroup (index_type rowGroup) const |
Returns an object representing the given row group. | |
rows | getRowGroup (index_type rowGroup) |
Returns an object representing the given row group. | |
const_iterator | begin (index_type row) const |
Retrieves an iterator that points to the beginning of the given row. | |
iterator | begin (index_type row) |
Retrieves an iterator that points to the beginning of the given row. | |
const_iterator | begin () const |
Retrieves an iterator that points to the beginning of the first row of the matrix. | |
iterator | begin () |
Retrieves an iterator that points to the beginning of the first row of the matrix. | |
const_iterator | end (index_type row) const |
Retrieves an iterator that points past the end of the given row. | |
iterator | end (index_type row) |
Retrieves an iterator that points past the end of the given row. | |
const_iterator | end () const |
Retrieves an iterator that points past the end of the last row of the matrix. | |
iterator | end () |
Retrieves an iterator that points past the end of the last row of the matrix. | |
template<typename NewValueType > | |
SparseMatrix< NewValueType > | toValueType () const |
Returns a copy of the matrix with the chosen internal data type. | |
Friends | |
class | storm::adapters::GmmxxAdapter< ValueType > |
class | storm::adapters::EigenAdapter |
class | storm::adapters::StormAdapter |
class | SparseMatrixBuilder< ValueType > |
template<typename TPrime > | |
std::ostream & | operator<< (std::ostream &out, SparseMatrix< TPrime > const &matrix) |
A class that holds a possibly non-square matrix in the compressed row storage format.
That is, it is supposed to store non-zero entries only, but zeros may be explicitly stored if necessary for certain operations. Likewise, the matrix is intended to store one value per column only. However, the functions provided by the matrix are implemented in a way that makes it safe to store several entries per column.
The creation of a matrix can be done in several ways. If the number of rows, columns and entries is known prior to creating the matrix, the matrix can be constructed using this knowledge, which saves reallocations. On the other hand, if either one of these values is not known a priori, the matrix can be constructed as an empty matrix that needs to perform reallocations as more and more entries are inserted in the matrix.
It should be observed that due to the nature of the sparse matrix format, entries can only be inserted in order, i.e. row by row and column by column.
Definition at line 332 of file SparseMatrix.h.
typedef std::vector<MatrixEntry<index_type,value_type>>::const_iterator storm::storage::SparseMatrix< ValueType >::const_iterator |
Definition at line 343 of file SparseMatrix.h.
typedef SparseMatrixIndexType storm::storage::SparseMatrix< ValueType >::index_type |
Definition at line 340 of file SparseMatrix.h.
typedef std::vector<MatrixEntry<index_type,value_type>>::iterator storm::storage::SparseMatrix< ValueType >::iterator |
Definition at line 342 of file SparseMatrix.h.
typedef ValueType storm::storage::SparseMatrix< ValueType >::value_type |
Definition at line 341 of file SparseMatrix.h.
enum storm::storage::SparseMatrix::MatrixStatus |
An enum representing the internal state of the matrix.
After creation, the matrix is UNINITIALIZED. Only after a call to finalize(), the status of the matrix is set to INITIALIZED and the matrix can be used.
Enumerator | |
---|---|
UNINITIALIZED | |
INITIALIZED |
Definition at line 436 of file SparseMatrix.h.
storm::storage::SparseMatrix< ValueType >::SparseMatrix | ( | ) |
Constructs an empty sparse matrix.
Definition at line 498 of file SparseMatrix.cpp.
storm::storage::SparseMatrix< ValueType >::SparseMatrix | ( | SparseMatrix< value_type > const & | other | ) |
Constructs a sparse matrix by performing a deep-copy of the given matrix.
other | The matrix from which to copy the content. |
Definition at line 504 of file SparseMatrix.cpp.
storm::storage::SparseMatrix< ValueType >::SparseMatrix | ( | SparseMatrix< value_type > const & | other, |
bool | insertDiagonalElements | ||
) |
Constructs a sparse matrix by performing a deep-copy of the given matrix.
other | The matrix from which to copy the content. |
insertDiagonalElements | If set to true, the copy will have all diagonal elements. If they did not exist in the original matrix, they are inserted and set to value zero. |
Definition at line 517 of file SparseMatrix.cpp.
storm::storage::SparseMatrix< ValueType >::SparseMatrix | ( | SparseMatrix< value_type > && | other | ) |
Constructs a sparse matrix by moving the contents of the given matrix to the newly created one.
other | The matrix from which to move the content. |
Definition at line 524 of file SparseMatrix.cpp.
storm::storage::SparseMatrix< ValueType >::SparseMatrix | ( | index_type | columnCount, |
std::vector< index_type > const & | rowIndications, | ||
std::vector< MatrixEntry< index_type, value_type > > const & | columnsAndValues, | ||
boost::optional< std::vector< index_type > > const & | rowGroupIndices | ||
) |
Constructs a sparse matrix by copying the given contents.
columnCount | The number of columns of the matrix. |
rowIndications | The row indications vector of the matrix to be constructed. |
columnsAndValues | The vector containing the columns and values of the entries in the matrix. |
rowGroupIndices | The vector representing the row groups in the matrix. |
Definition at line 540 of file SparseMatrix.cpp.
storm::storage::SparseMatrix< ValueType >::SparseMatrix | ( | index_type | columnCount, |
std::vector< index_type > && | rowIndications, | ||
std::vector< MatrixEntry< index_type, value_type > > && | columnsAndValues, | ||
boost::optional< std::vector< index_type > > && | rowGroupIndices | ||
) |
Constructs a sparse matrix by moving the given contents.
columnCount | The number of columns of the matrix. |
rowIndications | The row indications vector of the matrix to be constructed. |
columnsAndValues | The vector containing the columns and values of the entries in the matrix. |
rowGroupIndices | The vector representing the row groups in the matrix. |
Definition at line 555 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::iterator storm::storage::SparseMatrix< ValueType >::begin | ( | ) |
Retrieves an iterator that points to the beginning of the first row of the matrix.
Definition at line 2400 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::const_iterator storm::storage::SparseMatrix< ValueType >::begin | ( | ) | const |
Retrieves an iterator that points to the beginning of the first row of the matrix.
Definition at line 2395 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::iterator storm::storage::SparseMatrix< ValueType >::begin | ( | index_type | row | ) |
Retrieves an iterator that points to the beginning of the given row.
row | The row to the beginning of which the iterator has to point. |
Definition at line 2389 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::const_iterator storm::storage::SparseMatrix< ValueType >::begin | ( | index_type | row | ) | const |
Retrieves an iterator that points to the beginning of the given row.
row | The row to the beginning of which the iterator has to point. |
Definition at line 2383 of file SparseMatrix.cpp.
bool storm::storage::SparseMatrix< ValueType >::compareRows | ( | index_type | i1, |
index_type | i2 | ||
) | const |
Compares two rows.
i1 | Index of first row |
i2 | Index of second row |
Definition at line 946 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::convertToEquationSystem | ( | ) |
Transforms the matrix into an equation system.
That is, it transforms the matrix A into a matrix (1-A).
Definition at line 1571 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::deleteDiagonalEntries | ( | bool | dropZeroEntries = false | ) |
Sets all diagonal elements to zero.
dropZeroEntries | if true, zero entries resulting from the transformation are dropped from the matrix after the transformation. Dropping zero entries takes time linear in the number of matrix entries. |
Definition at line 1619 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::divideRowsInPlace | ( | std::vector< value_type > const & | divisors | ) |
Divides each row of the matrix, i.e., divides each element in row i with divisors[i].
divisors | The divisors with which each row is divided. |
Definition at line 2300 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::dropZeroEntries | ( | ) |
Removes all zero entries from this.
Definition at line 1311 of file SparseMatrix.cpp.
BitVector storm::storage::SparseMatrix< ValueType >::duplicateRowsInRowgroups | ( | ) | const |
Finds duplicate rows in a rowgroup.
Definition at line 963 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::iterator storm::storage::SparseMatrix< ValueType >::end | ( | ) |
Retrieves an iterator that points past the end of the last row of the matrix.
Definition at line 2422 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::const_iterator storm::storage::SparseMatrix< ValueType >::end | ( | ) | const |
Retrieves an iterator that points past the end of the last row of the matrix.
Definition at line 2417 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::iterator storm::storage::SparseMatrix< ValueType >::end | ( | index_type | row | ) |
Retrieves an iterator that points past the end of the given row.
row | The row past the end of which the iterator has to point. |
Definition at line 2411 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::const_iterator storm::storage::SparseMatrix< ValueType >::end | ( | index_type | row | ) | const |
Retrieves an iterator that points past the end of the given row.
row | The row past the end of which the iterator has to point. |
Definition at line 2405 of file SparseMatrix.cpp.
SparseMatrix< ValueType > storm::storage::SparseMatrix< ValueType >::filterEntries | ( | storm::storage::BitVector const & | rowFilter | ) | const |
Returns a copy of this matrix that only considers entries in the selected rows.
Non-selected rows will not have any entries
rowFilter | the selected rows |
Definition at line 1287 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getColumnCount | ( | ) | const |
Returns the number of columns of the matrix.
Definition at line 666 of file SparseMatrix.cpp.
std::vector< ValueType > storm::storage::SparseMatrix< ValueType >::getConstrainedRowGroupSumVector | ( | storm::storage::BitVector const & | rowGroupConstraint, |
storm::storage::BitVector const & | columnConstraint | ||
) | const |
Computes a vector whose entries represent the sums of selected columns for all rows in selected row groups.
rowGroupConstraint | A bit vector that indicates which row groups are to be considered. |
columnConstraint | A bit vector that indicates which columns to sum. |
Definition at line 1101 of file SparseMatrix.cpp.
ValueType storm::storage::SparseMatrix< ValueType >::getConstrainedRowSum | ( | index_type | row, |
storm::storage::BitVector const & | columns | ||
) | const |
Sums the entries in the given row and columns.
row | The row whose entries to add. |
columns | A bit vector that indicates which columns to add. |
Definition at line 1079 of file SparseMatrix.cpp.
std::vector< ValueType > storm::storage::SparseMatrix< ValueType >::getConstrainedRowSumVector | ( | storm::storage::BitVector const & | rowConstraint, |
storm::storage::BitVector const & | columnConstraint | ||
) | const |
Computes a vector whose i-th entry is the sum of the entries in the i-th selected row where only those entries are added that are in selected columns.
rowConstraint | A bit vector that indicates for which rows to compute the constrained sum. |
columnConstraint | A bit vector that indicates which columns to add in the selected rows. |
Definition at line 1090 of file SparseMatrix.cpp.
std::string storm::storage::SparseMatrix< ValueType >::getDimensionsAsString | ( | ) | const |
Returns a string describing the dimensions of the matrix.
Definition at line 2554 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getEntryCount | ( | ) | const |
Returns the number of entries in the matrix.
Definition at line 671 of file SparseMatrix.cpp.
std::pair< storm::storage::SparseMatrix< ValueType >, std::vector< ValueType > > storm::storage::SparseMatrix< ValueType >::getJacobiDecomposition | ( | ) | const |
Calculates the Jacobi decomposition of this sparse matrix.
For this operation, the matrix must be square.
Definition at line 1635 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getNonconstantEntryCount | ( | ) | const |
Returns the number of non-constant entries.
Definition at line 2436 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getNonconstantRowGroupCount | ( | ) | const |
Returns the number of rowGroups that contain a non-constant value.
Definition at line 2447 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getNonzeroEntryCount | ( | ) | const |
Returns the cached number of nonzero entries in the matrix.
Definition at line 689 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getNumRowsInRowGroups | ( | storm::storage::BitVector const & | groupConstraint | ) | const |
Returns the total number of rows that are in one of the specified row groups.
Definition at line 749 of file SparseMatrix.cpp.
template double storm::storage::SparseMatrix< ValueType >::getPointwiseProductRowSum | ( | storm::storage::SparseMatrix< OtherValueType > const & | otherMatrix, |
index_type const & | row | ||
) | const |
Performs a pointwise multiplication of the entries in the given row of this matrix and the entries of the given row of the other matrix and returns the sum.
otherMatrix | A reference to the matrix with which to perform the pointwise multiplication. This matrix must be a submatrix of the current matrix in the sense that it may not have entries at indices where there is no entry in the current matrix. |
Definition at line 1672 of file SparseMatrix.cpp.
template std::vector< double > storm::storage::SparseMatrix< ValueType >::getPointwiseProductRowSumVector | ( | storm::storage::SparseMatrix< OtherValueType > const & | otherMatrix | ) | const |
Performs a pointwise matrix multiplication of the matrix with the given matrix and returns a vector containing the sum of the entries in each row of the resulting matrix.
otherMatrix | A reference to the matrix with which to perform the pointwise multiplication. This matrix must be a submatrix of the current matrix in the sense that it may not have entries at indices where there is no entry in the current matrix. |
Definition at line 1697 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::rows storm::storage::SparseMatrix< ValueType >::getRow | ( | index_type | row | ) |
Returns an object representing the given row.
row | The row to get. |
Definition at line 2335 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::const_rows storm::storage::SparseMatrix< ValueType >::getRow | ( | index_type | row | ) | const |
Returns an object representing the given row.
row | The row to get. |
Definition at line 2330 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::rows storm::storage::SparseMatrix< 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 2351 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::const_rows storm::storage::SparseMatrix< ValueType >::getRow | ( | index_type | rowGroup, |
index_type | offset | ||
) | 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 2340 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getRowCount | ( | ) | const |
Returns the number of rows of the matrix.
Definition at line 661 of file SparseMatrix.cpp.
storm::storage::BitVector storm::storage::SparseMatrix< ValueType >::getRowFilter | ( | storm::storage::BitVector const & | groupConstraint | ) | const |
Returns a bitvector representing the set of rows, with all indices set that correspond to one of the selected row groups.
groups | the selected row groups |
Definition at line 821 of file SparseMatrix.cpp.
storm::storage::BitVector storm::storage::SparseMatrix< ValueType >::getRowFilter | ( | storm::storage::BitVector const & | groupConstraint, |
storm::storage::BitVector const & | columnConstraints | ||
) | const |
Returns the indices of all rows that.
groupConstraint | the selected groups |
columnConstraints | the selected columns |
Definition at line 830 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::rows storm::storage::SparseMatrix< ValueType >::getRowGroup | ( | index_type | rowGroup | ) |
Returns an object representing the given row group.
rowGroup | The row group to get. |
Definition at line 2373 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::const_rows storm::storage::SparseMatrix< ValueType >::getRowGroup | ( | index_type | rowGroup | ) | const |
Returns an object representing the given row group.
rowGroup | The row group to get. |
Definition at line 2363 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getRowGroupCount | ( | ) | const |
Returns the number of row groups in the matrix.
Definition at line 721 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getRowGroupEntryCount | ( | index_type const | group | ) | const |
Returns the number of entries in the given row group of the matrix.
Definition at line 676 of file SparseMatrix.cpp.
storm::storage::BitVector storm::storage::SparseMatrix< ValueType >::getRowGroupFilter | ( | storm::storage::BitVector const & | rowConstraint, |
bool | setIfForAllRowsInGroup | ||
) | const |
Returns the indices of all row groups selected by the row constraints.
rowConstraint | the selected rows |
setIfForAllRowsInGroup | if true, a group is selected if the rowConstraint is true for all rows within that group. If false, a group is selected if the rowConstraint is true for some row within that group |
Definition at line 851 of file SparseMatrix.cpp.
std::vector< typename SparseMatrix< ValueType >::index_type > const & storm::storage::SparseMatrix< ValueType >::getRowGroupIndices | ( | ) | const |
Returns the grouping of rows of this matrix.
Definition at line 767 of file SparseMatrix.cpp.
boost::integer_range< typename SparseMatrix< ValueType >::index_type > storm::storage::SparseMatrix< ValueType >::getRowGroupIndices | ( | index_type | group | ) | const |
Returns the row indices within the given group.
Definition at line 777 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getRowGroupSize | ( | index_type | group | ) | const |
Returns the size of the given row group.
group | The group whose size to retrieve. |
Definition at line 730 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::rows storm::storage::SparseMatrix< ValueType >::getRows | ( | index_type | startRow, |
index_type | endRow | ||
) |
Returns an object representing the consecutive rows given by the parameters.
startRow | The starting row. |
endRow | The ending row (which is not included in the result). |
Definition at line 2325 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::const_rows storm::storage::SparseMatrix< ValueType >::getRows | ( | index_type | startRow, |
index_type | endRow | ||
) | const |
Returns an object representing the consecutive rows given by the parameters.
startRow | The starting row. |
endRow | The ending row (which is not included in the result). |
Definition at line 2320 of file SparseMatrix.cpp.
ValueType storm::storage::SparseMatrix< 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 2427 of file SparseMatrix.cpp.
std::vector< ValueType > storm::storage::SparseMatrix< ValueType >::getRowSumVector | ( | ) | const |
Sums the entries in all rows.
Definition at line 1067 of file SparseMatrix.cpp.
SparseMatrix< ValueType >::index_type storm::storage::SparseMatrix< ValueType >::getSizeOfLargestRowGroup | ( | ) | const |
Returns the size of the largest row group of the matrix.
Definition at line 735 of file SparseMatrix.cpp.
SparseMatrix< ValueType > storm::storage::SparseMatrix< ValueType >::getSubmatrix | ( | bool | useGroups, |
storm::storage::BitVector const & | rowConstraint, | ||
storm::storage::BitVector const & | columnConstraint, | ||
bool | insertDiagonalEntries = false , |
||
storm::storage::BitVector const & | makeZeroColumns = storm::storage::BitVector() |
||
) | const |
Creates a submatrix of the current matrix by dropping all rows and columns whose bits are not set to one in the given bit vector.
useGroups | If set to true, the constraint for the rows is interpreted as selecting whole row groups. If it is not set, the row constraint is interpreted over the actual rows. Note that empty row groups will be dropped altogether. That is, if no row of a row group is selected or the row group is already empty, the submatrix will not have this row group. |
constraint | A bit vector indicating which rows to keep. |
columnConstraint | A bit vector indicating which columns to keep. |
insertDiagonalEntries | If set to true, the resulting matrix will have zero entries in column i for each row i, if there is no value yet. This can then be used for inserting other values later. |
Definition at line 1120 of file SparseMatrix.cpp.
std::size_t storm::storage::SparseMatrix< ValueType >::hash | ( | ) | const |
Calculates a hash value over all values contained in the matrix.
Definition at line 2634 of file SparseMatrix.cpp.
bool storm::storage::SparseMatrix< ValueType >::hasOnlyPositiveEntries | ( | ) | const |
Checks whether each present entry is strictly positive (omitted entries are not considered).
Definition at line 2480 of file SparseMatrix.cpp.
bool storm::storage::SparseMatrix< ValueType >::hasTrivialRowGrouping | ( | ) | const |
Retrieves whether the matrix has a trivial row grouping.
Definition at line 804 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::invertDiagonal | ( | ) |
Inverts all entries on the diagonal, i.e.
sets the diagonal values to one minus their previous value. Requires the matrix to contain each diagonal entry and to be square.
Definition at line 1577 of file SparseMatrix.cpp.
bool storm::storage::SparseMatrix< ValueType >::isIdentityMatrix | ( | ) | const |
Definition at line 2525 of file SparseMatrix.cpp.
bool storm::storage::SparseMatrix< ValueType >::isProbabilistic | ( | ) | const |
Checks for each row whether it sums to one.
Definition at line 2461 of file SparseMatrix.cpp.
template bool storm::storage::SparseMatrix< ValueType >::isSubmatrixOf | ( | SparseMatrix< OtherValueType > const & | matrix | ) | const |
Checks if the current matrix is a submatrix of the given matrix, where a matrix A is called a submatrix of B if B has no entries in position where A has none.
Additionally, the matrices must be of equal size.
matrix | The matrix that possibly is a supermatrix of the current matrix. |
Definition at line 2492 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::makeRowDirac | ( | index_type | row, |
index_type | column, | ||
bool | dropZeroEntries = false |
||
) |
This function makes the given row Dirac.
This means that all entries will be set to 0 except the one at the specified column, which is set to 1 instead.
row | The row to be made Dirac. |
column | The index of the column whose value is to be set to 1. |
dropZeroEntries | if true, zero entries resulting from the transformation are dropped from the matrix after the transformation. Dropping zero entries takes time linear in the number of matrix entries. |
Definition at line 906 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::makeRowGroupingTrivial | ( | ) |
Makes the row grouping of this matrix trivial.
Has no effect when the row grouping is already trivial.
Definition at line 809 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::makeRowGroupsAbsorbing | ( | storm::storage::BitVector const & | rowGroupConstraint, |
bool | dropZeroEntries = false |
||
) |
This function makes the groups of rows given by the bit vector absorbing.
rowGroupConstraint | A bit vector indicating which row groups to make absorbing. |
dropZeroEntries | if true, zero entries resulting from the transformation are dropped from the matrix after the transformation. Dropping zero entries takes time linear in the number of matrix entries. |
Definition at line 886 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::makeRowsAbsorbing | ( | storm::storage::BitVector const & | rows, |
bool | dropZeroEntries = false |
||
) |
This function makes the given rows absorbing.
rows | A bit vector indicating which rows are to be made absorbing. |
dropZeroEntries | if true, zero entries resulting from the transformation are dropped from the matrix after the transformation. Dropping zero entries takes time linear in the number of matrix entries. |
Definition at line 874 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::multiplyAndReduce | ( | storm::solver::OptimizationDirection const & | dir, |
std::vector< uint64_t > const & | rowGroupIndices, | ||
std::vector< ValueType > const & | vector, | ||
std::vector< ValueType > const * | summand, | ||
std::vector< ValueType > & | result, | ||
std::vector< uint64_t > * | choices | ||
) | const |
Multiplies the matrix with the given vector, reduces it according to the given direction and and writes the result to the given result vector.
dir | The optimization direction for the reduction. |
rowGroupIndices | The row groups for the reduction |
vector | The vector with which to multiply the matrix. |
summand | If given, this summand will be added to the result of the multiplication. |
result | The vector that is supposed to hold the result of the multiplication after the operation. |
choices | If given, the choices made in the reduction process will be written to this vector. Note that if the direction is maximize, the choice for a row group is only updated if the value obtained with the 'new' choice has a value strictly better (wrt. to the optimization direction) value. |
Definition at line 2250 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::multiplyAndReduceBackward | ( | std::vector< uint64_t > const & | rowGroupIndices, |
std::vector< ValueType > const & | vector, | ||
std::vector< ValueType > const * | b, | ||
std::vector< ValueType > & | result, | ||
std::vector< uint64_t > * | choices | ||
) | const |
Definition at line 2038 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::multiplyAndReduceBackward | ( | storm::solver::OptimizationDirection const & | dir, |
std::vector< uint64_t > const & | rowGroupIndices, | ||
std::vector< ValueType > const & | vector, | ||
std::vector< ValueType > const * | b, | ||
std::vector< ValueType > & | result, | ||
std::vector< uint64_t > * | choices | ||
) | const |
Definition at line 2026 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::multiplyAndReduceForward | ( | std::vector< uint64_t > const & | rowGroupIndices, |
std::vector< ValueType > const & | vector, | ||
std::vector< ValueType > const * | summand, | ||
std::vector< ValueType > & | result, | ||
std::vector< uint64_t > * | choices | ||
) | const |
Definition at line 1940 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::multiplyAndReduceForward | ( | storm::solver::OptimizationDirection const & | dir, |
std::vector< uint64_t > const & | rowGroupIndices, | ||
std::vector< ValueType > const & | vector, | ||
std::vector< ValueType > const * | b, | ||
std::vector< ValueType > & | result, | ||
std::vector< uint64_t > * | choices | ||
) | const |
Definition at line 1928 of file SparseMatrix.cpp.
ValueType storm::storage::SparseMatrix< ValueType >::multiplyRowWithVector | ( | index_type | row, |
std::vector< value_type > const & | vector | ||
) | const |
Multiplies a single row of the matrix with the given vector and returns the result.
row | The index of the row with which to multiply |
vector | The vector with which to multiply the row. |
Definition at line 1848 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::multiplyVectorWithMatrix | ( | std::vector< value_type > const & | vector, |
std::vector< value_type > & | result | ||
) | const |
Multiplies the vector to the matrix from the left and writes the result to the given result vector.
vector | The vector with which the matrix is to be multiplied. This vector is interpreted as being a row vector. |
result | The vector that is supposed to hold the result of the multiplication after the operation. |
Definition at line 2272 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::multiplyWithVector | ( | std::vector< value_type > const & | vector, |
std::vector< value_type > & | result, | ||
std::vector< value_type > const * | summand = nullptr |
||
) | const |
Multiplies the matrix with the given vector and writes the result to the given result vector.
vector | The vector with which to multiply the matrix. |
result | The vector that is supposed to hold the result of the multiplication after the operation. |
summand | If given, this summand will be added to the result of the multiplication. |
Definition at line 1707 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::multiplyWithVectorBackward | ( | std::vector< value_type > const & | vector, |
std::vector< value_type > & | result, | ||
std::vector< value_type > const * | summand = nullptr |
||
) | const |
Definition at line 1757 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::multiplyWithVectorForward | ( | std::vector< value_type > const & | vector, |
std::vector< value_type > & | result, | ||
std::vector< value_type > const * | summand = nullptr |
||
) | const |
Definition at line 1728 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::negateAllNonDiagonalEntries | ( | ) |
Negates (w.r.t.
addition) all entries that are not on the diagonal.
Definition at line 1607 of file SparseMatrix.cpp.
SparseMatrix< ValueType > & storm::storage::SparseMatrix< ValueType >::operator= | ( | SparseMatrix< value_type > && | other | ) |
Assigns the contents of the given matrix to the current one by moving its contents.
other | The matrix from which to move to contents. |
Definition at line 589 of file SparseMatrix.cpp.
SparseMatrix< ValueType > & storm::storage::SparseMatrix< ValueType >::operator= | ( | SparseMatrix< value_type > const & | other | ) |
Assigns the contents of the given matrix to the current one by deep-copying its contents.
other | The matrix from which to copy-assign. |
Definition at line 572 of file SparseMatrix.cpp.
bool storm::storage::SparseMatrix< ValueType >::operator== | ( | SparseMatrix< value_type > const & | other | ) | const |
Determines whether the current and the given matrix are semantically equal.
other | The matrix with which to compare the current matrix. |
Definition at line 606 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::performSuccessiveOverRelaxationStep | ( | ValueType | omega, |
std::vector< ValueType > & | x, | ||
std::vector< ValueType > const & | b | ||
) | const |
Performs one step of the successive over-relaxation technique.
omega | The Omega parameter for SOR. |
x | The current solution vector. The result will be written to the very same vector. |
b | The 'right-hand side' of the problem. |
Definition at line 1858 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::performWalkerChaeStep | ( | std::vector< ValueType > const & | x, |
std::vector< ValueType > const & | columnSums, | ||
std::vector< ValueType > const & | b, | ||
std::vector< ValueType > const & | ax, | ||
std::vector< ValueType > & | result | ||
) | const |
Performs one step of the Walker-Chae technique.
x | The current solution vector. |
columnSums | The sums the individual columns. |
b | The 'right-hand side' of the problem. |
ax | A vector resulting from multiplying the current matrix with the vector x. |
result | The vector to which to write the result. |
Definition at line 1892 of file SparseMatrix.cpp.
SparseMatrix< ValueType > storm::storage::SparseMatrix< ValueType >::permuteRowGroupsAndColumns | ( | std::vector< index_type > const & | inverseRowGroupPermutation, |
std::vector< index_type > const & | columnPermutation | ||
) | const |
Permutes row groups and columns of the matrix according to the given permutations.
That is, in row group i, write the entries of row group inverseRowGroupPermutation[i] and in column columnPermutation[j], write the entries of column j.
Definition at line 1454 of file SparseMatrix.cpp.
SparseMatrix< ValueType > storm::storage::SparseMatrix< ValueType >::permuteRows | ( | std::vector< index_type > const & | inversePermutation | ) | const |
Permute rows of the matrix according to the vector.
That is, in row i, write the entry of row inversePermutation[i]. Consequently, a single row might actually be written into multiple other rows, and the function application is not necessarily a permutation. Notice that this method does not touch column entries, nor the row grouping.
Definition at line 1431 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::printAsMatlabMatrix | ( | std::ostream & | out | ) | const |
Prints the matrix in a dense format, as also used by e.g.
Matlab. Notice that the format does not support multiple rows in a rowgroup.
@out The stream to output to.
Definition at line 2609 of file SparseMatrix.cpp.
SparseMatrix< ValueType > storm::storage::SparseMatrix< ValueType >::restrictRows | ( | storm::storage::BitVector const & | rowsToKeep, |
bool | allowEmptyRowGroups = false |
||
) | const |
Restrict rows in grouped rows matrix.
Ensures that the number of groups stays the same.
rowsToKeep | A bit vector indicating which rows to keep. |
allowEmptyRowGroups | if set to true, the result can potentially have empty row groups. Otherwise, it is asserted that there are no empty row groups. |
Definition at line 1242 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::scaleRowsInPlace | ( | std::vector< value_type > const & | factors | ) |
Scales each row of the matrix, i.e., multiplies each element in row i with factors[i].
factors | The factors with which each row is scaled. |
Definition at line 2288 of file SparseMatrix.cpp.
SparseMatrix< ValueType > storm::storage::SparseMatrix< ValueType >::selectRowsFromRowGroups | ( | std::vector< index_type > const & | rowGroupToRowIndexMapping, |
bool | insertDiagonalEntries = true |
||
) | const |
Selects exactly one row from each row group of this matrix and returns the resulting matrix.
insertDiagonalEntries | If set to true, the resulting matrix will have zero entries in column i for each row in row group i. This can then be used for inserting other values later. |
Definition at line 1332 of file SparseMatrix.cpp.
SparseMatrix< ValueType > storm::storage::SparseMatrix< ValueType >::selectRowsFromRowIndexSequence | ( | std::vector< index_type > const & | rowIndexSequence, |
bool | insertDiagonalEntries = true |
||
) | const |
Selects the rows that are given by the sequence of row indices, allowing to select rows arbitrarily often and with an arbitrary order The resulting matrix will have a trivial row grouping.
rowIndexSequence | the sequence of row indices which specifies, which rows are contained in the new matrix |
insertDiagonalEntries | If set to true, the resulting matrix will have zero entries in column i for each row. This can then be used for inserting other values later. |
Definition at line 1388 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::setRowGroupIndices | ( | std::vector< index_type > const & | newRowGroupIndices | ) |
Sets the row grouping to the given one.
newRowGroupIndices | The new row group indices. |
Definition at line 798 of file SparseMatrix.cpp.
std::vector< typename SparseMatrix< ValueType >::index_type > storm::storage::SparseMatrix< ValueType >::swapRowGroupIndices | ( | std::vector< index_type > && | newRowGrouping | ) |
Swaps the grouping of rows of this matrix.
Definition at line 788 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::swapRows | ( | index_type const & | row1, |
index_type const & | row2 | ||
) |
Swaps the two rows.
row1 | Index of first row |
row2 | Index of second row |
Definition at line 978 of file SparseMatrix.cpp.
|
inline |
Returns a copy of the matrix with the chosen internal data type.
Definition at line 1210 of file SparseMatrix.h.
SparseMatrix< ValueType > storm::storage::SparseMatrix< ValueType >::transpose | ( | bool | joinGroups = false , |
bool | keepZeros = false |
||
) | const |
Transposes the matrix.
joinGroups | A flag indicating whether the row groups are supposed to be treated as single rows. |
keepZeros | A flag indicating whether entries with value zero should be kept. |
Definition at line 1478 of file SparseMatrix.cpp.
SparseMatrix< ValueType > storm::storage::SparseMatrix< ValueType >::transposeSelectedRowsFromRowGroups | ( | std::vector< uint64_t > const & | rowGroupChoices, |
bool | keepZeros = false |
||
) | const |
Transposes the matrix w.r.t.
the selected rows. This is equivalent to selectRowsFromRowGroups(rowGroupChoices, false).transpose(false, keepZeros) but avoids creating one intermediate matrix.
rowGroupChoices | A mapping from each row group index to a selected row in this group. |
keepZeros | A flag indicating whether entries with value zero should be kept. |
Definition at line 1527 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::updateDimensions | ( | ) | const |
Recomputes the number of columns and the number of non-zero entries.
Definition at line 709 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::updateNonzeroEntryCount | ( | ) | const |
Recompute the nonzero entry count.
Definition at line 694 of file SparseMatrix.cpp.
void storm::storage::SparseMatrix< ValueType >::updateNonzeroEntryCount | ( | std::make_signed< index_type >::type | difference | ) |
Change the nonzero entry count by the provided value.
difference | Difference between old and new nonzero entry count. |
Definition at line 704 of file SparseMatrix.cpp.
|
friend |
|
friend |
Definition at line 337 of file SparseMatrix.h.
|
friend |
Definition at line 336 of file SparseMatrix.h.
|
friend |
Definition at line 314 of file SparseMatrix.h.
|
friend |
Definition at line 337 of file SparseMatrix.h.