46 bool addSelfLoopAtSinkStates =
false) {
49 for (
auto const& ec : ecs) {
50 for (
auto const& stateActionsPair : ec) {
51 keptStates.
set(stateActionsPair.first,
false);
55 <<
" original states plus " << ecs.
size() <<
"new end component states.");
58 std::vector<uint_fast64_t> newRowGroupIndices;
63 for (
auto keptState : keptStates) {
70 for (
auto const& ec : ecs) {
72 bool ecGetsSinkRow =
false;
73 for (
auto const& stateActionsPair : ec) {
77 if (stateActionsPair.second.find(row) == stateActionsPair.second.end()) {
81 ecGetsSinkRow |= addSinkRowStates.
get(stateActionsPair.first);
85 "Didn't expect to see more rows in the reduced matrix than in the original one.");
94 addSelfLoopAtSinkStates);
95 STORM_LOG_DEBUG(
"EndComponentEliminator is done. Resulting matrix has " << result.
matrix.getRowGroupCount() <<
" row groups.");
122 return transform(originalMatrix, ecs, subsystemStates, addSinkRowStates, addSelfLoopAtSinkStates);
135 uint_fast64_t row = 0;
136 for (uint_fast64_t rowGroup = 0; rowGroup < originalMatrix.
getRowGroupCount(); ++rowGroup) {
137 builder.newRowGroup(row);
139 bool keepRow = possibleECRows.
get(row);
141 for (
auto const& entry : originalMatrix.getRow(row)) {
142 keepRow &= subsystemStates.
get(entry.getColumn());
146 for (
auto const& entry : originalMatrix.getRow(row)) {
147 builder.addNextValue(row, entry.getColumn(), entry.getValue());
150 builder.addNextValue(row, sinkState, storm::utility::one<ValueType>());
154 builder.newRowGroup(row);
155 builder.addNextValue(row, sinkState, storm::utility::one<ValueType>());
160 sinkStateAsBitVector.set(sinkState);
162 auxSubsystemStates.
resize(subsystemStates.
size() + 1,
true);
165 auxSubsystemStates, sinkStateAsBitVector));
170 std::vector<uint_fast64_t>
const& newRowGroupIndices,
171 std::vector<uint_fast64_t>
const& newToOldRowMapping,
172 std::vector<uint_fast64_t>
const& oldToNewStateMapping,
174 uint_fast64_t numRowGroups = newRowGroupIndices.size() - 1;
175 uint_fast64_t newRow = 0;
178 for (uint_fast64_t newRowGroup = 0; newRowGroup < numRowGroups; ++newRowGroup) {
179 builder.newRowGroup(newRow);
180 for (; newRow < newRowGroupIndices[newRowGroup + 1]; ++newRow) {
181 if (sinkRows.
get(newRow)) {
182 if (addSelfLoopAtSinkStates) {
183 builder.addNextValue(newRow, newRowGroup, storm::utility::one<ValueType>());
188 std::map<uint_fast64_t, ValueType> sortedEntries;
189 for (
auto const& entry : originalMatrix.getRow(newToOldRowMapping[newRow])) {
190 uint_fast64_t newColumn = oldToNewStateMapping[entry.getColumn()];
191 if (newColumn < numRowGroups) {
192 auto insertResult = sortedEntries.insert(std::make_pair(newColumn, entry.getValue()));
193 if (!insertResult.second) {
195 insertResult.first->second += entry.getValue();
199 for (
auto const& sortedEntry : sortedEntries) {
200 builder.addNextValue(newRow, sortedEntry.first, sortedEntry.second);
205 return builder.build(newToOldRowMapping.size(), numRowGroups, numRowGroups);
storm::storage::BitVector performProbGreater0A(storm::storage::SparseMatrix< T > const &transitionMatrix, std::vector< uint_fast64_t > const &nondeterministicChoiceIndices, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool useStepBound, uint_fast64_t maximalSteps, boost::optional< storm::storage::BitVector > const &choiceConstraint)
Computes the sets of states that have probability greater 0 of satisfying phi until psi under any pos...