Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Block.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace storm {
6namespace storage {
7namespace bisimulation {
8// Forward-declare partition class.
9template<typename DataType>
10class Partition;
11
12template<typename DataType>
13class Block {
14 public:
15 friend class Partition<DataType>;
16
17 // Creates a new block with the given begin and end.
18 Block(storm::storage::sparse::state_type beginIndex, storm::storage::sparse::state_type endIndex, Block* previous, Block* next, std::size_t id);
19
20 Block() = default;
21 Block(Block const& other) = default;
22 Block& operator=(Block const& other) = default;
23 Block(Block&& other) = default;
24 Block& operator=(Block&& other) = default;
25
26 bool operator==(Block const& other) const;
27 bool operator!=(Block const& other) const;
28
29 // Prints the block to the standard output.
30 void print(Partition<DataType> const& partition) const;
31
32 // Returns the beginning index of the block.
34
35 // Returns the beginning index of the block.
37
38 // Gets the next block (if there is one).
39 Block const& getNextBlock() const;
40
41 // Gets a pointer to the next block (if there is one).
43
44 // Gets a pointer to the next block (if there is one).
45 Block const* getNextBlockPointer() const;
46
47 // Retrieves whether the block as a successor block.
48 bool hasNextBlock() const;
49
50 // Gets the next block (if there is one).
51 Block const& getPreviousBlock() const;
52
53 // Gets a pointer to the previous block (if there is one).
55
56 // Gets a pointer to the previous block (if there is one).
57 Block const* getPreviousBlockPointer() const;
58
59 // Retrieves whether the block as a successor block.
60 bool hasPreviousBlock() const;
61
62 // Checks consistency of the information in the block.
63 bool check() const;
64
65 // Retrieves the number of states in this block.
66 std::size_t getNumberOfStates() const;
67
68 // Retrieves the additional data associated with this block.
69 DataType& data();
70
71 // Retrieves the additional data associated with this block.
72 DataType const& data() const;
73
74 // Resets all markers.
75 void resetMarkers();
76
77 // Retrieves the ID of the block.
78 std::size_t getId() const;
79
80 private:
81 // Sets the beginning index of the block.
82 void setBeginIndex(storm::storage::sparse::state_type beginIndex);
83
84 // Sets the end index of the block.
85 void setEndIndex(storm::storage::sparse::state_type endIndex);
86
87 // Pointers to the next and previous block.
88 Block* nextBlock;
89 Block* previousBlock;
90
91 // The begin and end indices of the block in terms of the state vector of the partition.
94
95 // The ID of the block. This is only used for debugging purposes.
96 std::size_t id;
97
98 // A member that stores additional data that depends on the kind of bisimulation.
99 DataType mData;
100};
101} // namespace bisimulation
102} // namespace storage
103} // namespace storm
Block const & getPreviousBlock() const
Definition Block.cpp:97
Block const & getNextBlock() const
Definition Block.cpp:77
storm::storage::sparse::state_type getEndIndex() const
Definition Block.cpp:72
bool operator==(Block const &other) const
Definition Block.cpp:28
Block & operator=(Block &&other)=default
bool operator!=(Block const &other) const
Definition Block.cpp:33
std::size_t getNumberOfStates() const
Definition Block.cpp:125
Block(Block const &other)=default
void print(Partition< DataType > const &partition) const
Definition Block.cpp:38
storm::storage::sparse::state_type getBeginIndex() const
Definition Block.cpp:67
Block & operator=(Block const &other)=default
std::size_t getId() const
Definition Block.cpp:62
Block(Block &&other)=default