Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SparseMdpEndComponentInformation.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <vector>
5
6namespace storm {
7namespace storage {
8class BitVector;
9
10template<typename ValueType>
11class SparseMatrix;
12
13template<typename ValueType>
14class MaximalEndComponentDecomposition;
15
16template<typename ValueType>
17class Scheduler;
18} // namespace storage
19
20namespace modelchecker {
21namespace helper {
22
23template<typename ValueType>
25 public:
27 storm::storage::BitVector const& maybeStates);
28
29 bool isMaybeStateInEc(uint64_t maybeState) const;
30 bool isStateInEc(uint64_t state) const;
31
36 std::vector<uint64_t> const& getNumberOfMaybeStatesNotInEcBeforeIndices() const;
37
41 uint64_t getNumberOfMaybeStatesNotInEc() const;
42
46 uint64_t getEc(uint64_t state) const;
47
51 uint64_t getRowGroupAfterElimination(uint64_t state) const;
52
53 bool getEliminatedEndComponents() const;
54
55 uint64_t getNotInEcMarker() const;
56
59 storm::storage::SparseMatrix<ValueType> const& transitionMatrix, storm::storage::BitVector const& maybeStates,
60 storm::storage::BitVector const* sumColumns, storm::storage::BitVector const* selectedChoices, std::vector<ValueType> const* summand,
61 storm::storage::SparseMatrix<ValueType>& submatrix, std::vector<ValueType>* columnSumVector, std::vector<ValueType>* summandResultVector,
62 bool gatherExitChoices = false);
63
66 storm::storage::SparseMatrix<ValueType> const& transitionMatrix, std::vector<ValueType>& rhsVector, storm::storage::BitVector const& maybeStates,
67 storm::storage::SparseMatrix<ValueType>& submatrix, std::vector<ValueType>& subvector, bool gatherExitChoices = false);
68
69 void setValues(std::vector<ValueType>& result, storm::storage::BitVector const& maybeStates, std::vector<ValueType> const& fromResult);
70
71 template<typename SolutionType>
73 storm::storage::SparseMatrix<ValueType> const& transitionMatrix, storm::storage::SparseMatrix<ValueType> const& backwardTransitions,
74 std::vector<uint64_t> const& fromResult);
75
76 private:
77 // A constant that marks that a state is not contained in any EC.
78 uint64_t NOT_IN_EC;
79
80 // A flag storing whether end components have been eliminated.
81 bool eliminatedEndComponents;
82
83 // Data about end components.
84 std::vector<uint64_t> maybeStatesBefore;
85 std::vector<uint64_t> maybeStatesNotInEcBefore;
86 uint64_t numberOfMaybeStatesInEc;
87 uint64_t numberOfMaybeStatesNotInEc;
88 uint64_t numberOfEc;
89 std::vector<uint64_t> maybeStateToEc;
90 std::vector<std::vector<uint64_t>> ecToExitChoicesBefore; // Only available, if gatherExitChoices was enabled. Empty otherwise.
91};
92
93} // namespace helper
94} // namespace modelchecker
95} // namespace storm
uint64_t getRowGroupAfterElimination(uint64_t state) const
Retrieves the row group of the state after end component elimination.
uint64_t getNumberOfMaybeStatesNotInEc() const
Retrieves the total number of maybe states on in ECs.
void setScheduler(storm::storage::Scheduler< SolutionType > &scheduler, storm::storage::BitVector const &maybeStates, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< uint64_t > const &fromResult)
uint64_t getEc(uint64_t state) const
Retrieves the EC of the state (result may be NOT_IN_EC).
void setValues(std::vector< ValueType > &result, storm::storage::BitVector const &maybeStates, std::vector< ValueType > const &fromResult)
static SparseMdpEndComponentInformation< ValueType > eliminateEndComponents(storm::storage::MaximalEndComponentDecomposition< ValueType > const &endComponentDecomposition, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::BitVector const &maybeStates, storm::storage::BitVector const *sumColumns, storm::storage::BitVector const *selectedChoices, std::vector< ValueType > const *summand, storm::storage::SparseMatrix< ValueType > &submatrix, std::vector< ValueType > *columnSumVector, std::vector< ValueType > *summandResultVector, bool gatherExitChoices=false)
std::vector< uint64_t > const & getNumberOfMaybeStatesNotInEcBeforeIndices() const
Retrieves for each maybe state the number of maybe states not contained in ECs with an index smaller ...
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
This class represents the decomposition of a nondeterministic model into its maximal end components.
This class defines which action is chosen in a particular state of a non-deterministic model.
Definition Scheduler.h:18
A class that holds a possibly non-square matrix in the compressed row storage format.
storage::BitVector BitVector
LabParser.cpp.
Definition cli.cpp:18