13namespace transformer {
20 std::vector<Interval>
const& originalVector) {
23 bool hasNonTrivialMEC =
false;
24 for (
auto const& group : decomposition) {
25 if (!group.isTrivial()) {
26 hasNonTrivialMEC =
true;
35 if (!hasNonTrivialMEC) {
45 for (uint64_t row = 0; row < originalMatrix.
getRowCount(); row++) {
46 if (indexMap.at(row) >= decomposition.
size() || decomposition.
getBlock(indexMap.at(row)).
isTrivial()) {
48 for (
auto const& entry : originalMatrix.
getRow(row)) {
50 builder.
addNextValue(row, entry.getColumn(), entry.getValue());
53 auto const& group = decomposition.
getBlock(indexMap.at(row));
55 uint64_t smallestInGroup = *group.
begin();
56 if (row != smallestInGroup) {
58 builder.
addNextValue(row, smallestInGroup, utility::one<Interval>());
62 boost::container::flat_set<uint64_t> groupSet;
63 for (
auto const& state : group) {
64 for (
auto const& entry : originalMatrix.
getRow(state)) {
65 if (group.getStates().contains(entry.getColumn()) ||
utility::isZero(entry.getValue())) {
69 uint64_t groupIndex = indexMap.at(entry.getColumn());
70 uint64_t stateRepresentingGroup = groupIndex >= decomposition.
size() ? entry.getColumn() : *decomposition.
getBlock(groupIndex).
begin();
71 groupSet.insert(stateRepresentingGroup);
74 STORM_LOG_DEBUG(
"Transformed group of size " << groupSet.size() <<
" for state " << row);
76 for (
auto const& state : groupSet) {
83 return builder.
build();
block_type const & getBlock(uint_fast64_t index) const
Retrieves the block with the given index.
std::size_t size() const
Retrieves the number of blocks of this decomposition.
This class represents the decomposition of a nondeterministic model into its maximal end components.
std::vector< uint64_t > computeStateToSccIndexMap(uint64_t numberOfStates) const
Computes a vector that for each state has the index of the scc of that state in it.
A class that can be used to build a sparse matrix by adding value by value.
void addNextValue(index_type row, index_type column, value_type const &value)
Sets the matrix entry at the given row and column to the given value.
SparseMatrix< value_type > build(index_type overriddenRowCount=0, index_type overriddenColumnCount=0, index_type overriddenRowGroupCount=0)
A class that holds a possibly non-square matrix in the compressed row storage format.
const_rows getRow(index_type row) const
Returns an object representing the given row.
index_type getColumnCount() const
Returns the number of columns of the matrix.
storm::storage::SparseMatrix< value_type > transpose(bool joinGroups=false, bool keepZeros=false) const
Transposes the matrix.
index_type getRowCount() const
Returns the number of rows of the matrix.
iterator begin()
Returns an iterator to the states in this SCC.
bool isTrivial() const
Retrieves whether this SCC is trivial.
#define STORM_LOG_DEBUG(message)
bool isZero(ValueType const &a)
carl::Interval< double > Interval
Interval type.