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