13namespace bisimulation {
15template<
typename DataType>
18 : nextBlock(nextBlock), previousBlock(previousBlock), beginIndex(beginIndex), endIndex(endIndex), id(id), mData() {
19 if (nextBlock !=
nullptr) {
20 nextBlock->previousBlock =
this;
22 if (previousBlock !=
nullptr) {
23 previousBlock->nextBlock =
this;
26 STORM_LOG_ASSERT(this->beginIndex < this->endIndex,
"Unable to create block of illegal size.");
29template<
typename DataType>
31 return this == &other;
34template<
typename DataType>
36 return this != &other;
39template<
typename DataType>
41 std::cout <<
"block [" <<
this <<
"] " << this->
id <<
" from " << this->beginIndex <<
" to " << this->endIndex <<
" with data [" << this->data() <<
"]\n";
42 std::cout <<
"states ";
43 for (
auto stateIt = partition.
begin(*
this), stateIte = partition.
end(*
this); stateIt != stateIte; ++stateIt) {
44 std::cout << *stateIt <<
", ";
49template<
typename DataType>
51 this->beginIndex = beginIndex;
53 STORM_LOG_ASSERT(beginIndex < endIndex,
"Unable to resize block to illegal size.");
56template<
typename DataType>
58 this->endIndex = endIndex;
60 STORM_LOG_ASSERT(beginIndex < endIndex,
"Unable to resize block to illegal size.");
63template<
typename DataType>
68template<
typename DataType>
70 return this->beginIndex;
73template<
typename DataType>
75 return this->endIndex;
78template<
typename DataType>
80 return *this->nextBlock;
83template<
typename DataType>
85 return this->nextBlock !=
nullptr;
88template<
typename DataType>
90 return this->nextBlock;
93template<
typename DataType>
95 return this->nextBlock;
98template<
typename DataType>
100 return *this->previousBlock;
103template<
typename DataType>
105 return this->previousBlock;
108template<
typename DataType>
110 return this->previousBlock;
113template<
typename DataType>
115 return this->previousBlock !=
nullptr;
118template<
typename DataType>
120 STORM_LOG_ASSERT(this->beginIndex < this->endIndex,
"Block has negative size.");
121 STORM_LOG_ASSERT(!this->hasPreviousBlock() || this->getPreviousBlock().getNextBlockPointer() ==
this,
"Illegal previous block.");
122 STORM_LOG_ASSERT(!this->hasNextBlock() || this->getNextBlock().getPreviousBlockPointer() ==
this,
"Illegal next block.");
126template<
typename DataType>
128 return (this->endIndex - this->beginIndex);
131template<
typename DataType>
136template<
typename DataType>
141template<
typename DataType>
143 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)