20 #ifndef IDPARTITIONENUMERATOR_H_
21 #define IDPARTITIONENUMERATOR_H_
23 #include "IDPartition.h"
24 #include "InvalidStateException.h"
27 namespace basic_types {
168 unordered_set<IDPartition*, IDPartitionPointerHasher, IDPartitionPointerEquality>*
genPartitionsSet;
IDPartitionEnumerator()
Generates an enumerator with no IDs.
Definition: IDPartitionEnumerator.cpp:60
bool valid
Stores whether this IDPartitionEnumerator is still valid.
Definition: IDPartitionEnumerator.h:173
A hasher for pointers to IDPartions.
Definition: IDPartitionEnumerator.h:32
unordered_set< IDPartition *, IDPartitionPointerHasher, IDPartitionPointerEquality > * genPartitionsSet
Stores all enumerated IDPartitions to avoid enumerating the same IDPartition multiple times...
Definition: IDPartitionEnumerator.h:168
bool operator()(const IDPartition *x, const IDPartition *y) const
Checks if the given IDPartitions pointed to are equal.
Definition: IDPartitionEnumerator.cpp:46
Provides a possibility to enumerate all partitions on a given set of IDs.
Definition: IDPartitionEnumerator.h:66
size_t baseSetSize() const
Returns the size of the set of element on which partitions are enumerated.
Definition: IDPartitionEnumerator.cpp:130
size_t operator()(const IDPartition *s) const
Takes a pointer to an IDPartition and returns a hash value.
Definition: IDPartitionEnumerator.cpp:29
An equality checker for pointers to IDPartitions.
Definition: IDPartitionEnumerator.h:47
bool ended() const
Returns true, if all possible IDPartions were enumerated.
Definition: IDPartitionEnumerator.cpp:141
void throwIfNotValid() const
Checks if this IDPartitionEnumerator is still valid and throws an InvalidStateException if it is not...
Definition: IDPartitionEnumerator.cpp:134
void reset()
Resets this enumerator to start the enumeration process from the first element.
Definition: IDPartitionEnumerator.cpp:146
virtual ~IDPartitionEnumerator()
Destroy this instance of the enumerator.
Definition: IDPartitionEnumerator.cpp:109
IDPartition const & operator*() const
Returns the last IDPartition which was computed.
Definition: IDPartitionEnumerator.cpp:194
size_t lastNew
Stores the index of the first element of genPartitionsVec which was not already used to create more c...
Definition: IDPartitionEnumerator.h:157
size_t current
Stores at which index of genPartitionsVec the current IDPartition is stored.
Definition: IDPartitionEnumerator.h:151
unordered_set< SubIDPartition > IDPartition
An IDPartition is a set of sets of IDs (which is effectively a set of equivalence classes)...
Definition: IDPartition.h:37
IDPartitionEnumerator & operator++()
Computes the next IDPartition in the enumeration.
Definition: IDPartitionEnumerator.cpp:151
vector< IDPartition * > * genPartitionsVec
Stores all enumerated IDPartitions, where the order of the elements is the sequence in which the IDPa...
Definition: IDPartitionEnumerator.h:163
bool isValid() const
Return whether this IDPartitionEnumerator is in a valid state or not.
Definition: IDPartitionEnumerator.cpp:126