libsemigroups
Public Member Functions | List of all members
libsemigroups::Partition< T > Class Template Reference

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 &copy)=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...
 
Partitionoperator= (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...
 

Detailed Description

template<typename T>
class libsemigroups::Partition< T >

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.

Constructor & Destructor Documentation

§ Partition() [1/3]

template<typename T>
libsemigroups::Partition< T >::Partition ( size_t  nr_parts = 0)
inlineexplicit

A constructor.

This constructor returns a partition with nr_parts empty parts.

§ Partition() [2/3]

template<typename T>
libsemigroups::Partition< T >::Partition ( std::vector< std::vector< T *> *> *  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.

§ ~Partition()

template<typename T>
libsemigroups::Partition< T >::~Partition ( )
inline

A default destructor.

Deletes the vector and all of its contents passed to the constructor, if any.

§ Partition() [3/3]

template<typename T>
libsemigroups::Partition< T >::Partition ( Partition< T > const &  copy)
delete

The copy constructor is deleted for Partition to avoid unintended copying.

Member Function Documentation

§ at() [1/2]

template<typename T>
std::vector<T*>* libsemigroups::Partition< T >::at ( size_t  part_index) const
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.

§ at() [2/2]

template<typename T>
T* libsemigroups::Partition< T >::at ( size_t  part_index,
size_t  elm_nr 
) const
inline

Returns the element with index elm_nr in part part_index.

§ operator=()

template<typename T>
Partition& libsemigroups::Partition< T >::operator= ( Partition< T > const &  part)
delete

The assignment operator is deleted for Partition to avoid unintended copying.

§ operator[]()

template<typename T>
std::vector<T*>* libsemigroups::Partition< T >::operator[] ( size_t  part_index) const
inline

Returns the part with index part_index.

This method asserts that the parameter part_index is less than the number of parts.

§ size()

template<typename T>
size_t libsemigroups::Partition< T >::size ( ) const
inline

Returns the number of parts in the partition.


The documentation for this class was generated from the following file: