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