11namespace bisimulation {
13template<
typename DataType>
16 : nextBlock(nextBlock), previousBlock(previousBlock), beginIndex(beginIndex), endIndex(endIndex), id(id), mData() {
17 if (nextBlock !=
nullptr) {
18 nextBlock->previousBlock =
this;
20 if (previousBlock !=
nullptr) {
21 previousBlock->nextBlock =
this;
24 STORM_LOG_ASSERT(this->beginIndex < this->endIndex,
"Unable to create block of illegal size.");
27template<
typename DataType>
29 return this == &other;
32template<
typename DataType>
34 return this != &other;
37template<
typename DataType>
39 std::cout <<
"block [" <<
this <<
"] " << this->
id <<
" from " << this->beginIndex <<
" to " << this->endIndex <<
" with data [" << this->data() <<
"]\n";
40 std::cout <<
"states ";
41 for (
auto stateIt = partition.
begin(*
this), stateIte = partition.
end(*
this); stateIt != stateIte; ++stateIt) {
42 std::cout << *stateIt <<
", ";
47template<
typename DataType>
49 this->beginIndex = beginIndex;
51 STORM_LOG_ASSERT(beginIndex < endIndex,
"Unable to resize block to illegal size.");
54template<
typename DataType>
56 this->endIndex = endIndex;
58 STORM_LOG_ASSERT(beginIndex < endIndex,
"Unable to resize block to illegal size.");
61template<
typename DataType>
66template<
typename DataType>
68 return this->beginIndex;
71template<
typename DataType>
73 return this->endIndex;
76template<
typename DataType>
78 return *this->nextBlock;
81template<
typename DataType>
83 return this->nextBlock !=
nullptr;
86template<
typename DataType>
88 return this->nextBlock;
91template<
typename DataType>
93 return this->nextBlock;
96template<
typename DataType>
98 return *this->previousBlock;
101template<
typename DataType>
103 return this->previousBlock;
106template<
typename DataType>
108 return this->previousBlock;
111template<
typename DataType>
113 return this->previousBlock !=
nullptr;
116template<
typename DataType>
118 STORM_LOG_ASSERT(this->beginIndex < this->endIndex,
"Block has negative size.");
119 STORM_LOG_ASSERT(!this->hasPreviousBlock() || this->getPreviousBlock().getNextBlockPointer() ==
this,
"Illegal previous block.");
120 STORM_LOG_ASSERT(!this->hasNextBlock() || this->getNextBlock().getPreviousBlockPointer() ==
this,
"Illegal next block.");
124template<
typename DataType>
126 return (this->endIndex - this->beginIndex);
129template<
typename DataType>
134template<
typename DataType>
139template<
typename DataType>
141 mData.resetMarkers(*
this);
Block const & getPreviousBlock() const
Block const & getNextBlock() const
storm::storage::sparse::state_type getEndIndex() const
Block * getPreviousBlockPointer()
bool hasNextBlock() const
bool operator==(Block const &other) const
Block * getNextBlockPointer()
bool operator!=(Block const &other) const
std::size_t getNumberOfStates() const
void print(Partition< DataType > const &partition) const
bool hasPreviousBlock() const
storm::storage::sparse::state_type getBeginIndex() const
std::size_t getId() const
std::vector< storm::storage::sparse::state_type >::iterator begin(Block< DataType > const &block)
std::vector< storm::storage::sparse::state_type >::iterator end(Block< DataType > const &block)
#define STORM_LOG_ASSERT(cond, message)