libsemigroups
|
Class for partitions of a set used by Congruence::nontrivial_classes. More...
#include <partition.h>
Public Member Functions | |
Partition (size_t nr_parts=0) | |
A constructor. More... | |
Partition (std::vector< std::vector< T * > * > *parts) | |
A constructor. More... | |
Partition (Partition const ©)=delete | |
The copy constructor is deleted for Partition to avoid unintended copying. More... | |
~Partition () | |
A default destructor. More... | |
std::vector< T * > * | at (size_t part_index) const |
Returns the part with index part_index . More... | |
T * | at (size_t part_index, size_t elm_nr) const |
Returns the element with index elm_nr in part part_index . More... | |
Partition & | operator= (Partition const &part)=delete |
The assignment operator is deleted for Partition to avoid unintended copying. More... | |
std::vector< T * > * | operator[] (size_t part_index) const |
Returns the part with index part_index . More... | |
size_t | size () const |
Returns the number of parts in the partition. More... | |
Class for partitions of a set used by Congruence::nontrivial_classes.
This class is for representing a partition of a set, i.e. an equivalence relation on that set. The template parameter T
is the type of objects, pointers to which are stored in the partition.
|
inlineexplicit |
A constructor.
This constructor returns a partition with nr_parts
empty parts.
|
inlineexplicit |
A constructor.
This constructor returns the Partition defined by the given vector, which is not copied, and is deleted by the destructor of this class.
|
inline |
A default destructor.
Deletes the vector and all of its contents passed to the constructor, if any.
|
delete |
The copy constructor is deleted for Partition to avoid unintended copying.
|
inline |
Returns the part with index part_index
.
This uses the at
method of the underlying std::vector, and so performs out-of-bounds checks.
|
inline |
Returns the element with index elm_nr
in part part_index
.
|
delete |
The assignment operator is deleted for Partition to avoid unintended copying.
|
inline |
Returns the part with index part_index
.
This method asserts that the parameter part_index
is less than the number of parts.
|
inline |
Returns the number of parts in the partition.