libsemigroups
|
Class for signed partitions of the set \(\{0, \ldots, n - 1\}\). More...
#include <blocks.h>
Public Member Functions | |
Blocks () | |
A constructor. More... | |
Blocks (std::vector< u_int32_t > *blocks, std::vector< bool > *lookup) | |
A constructor. More... | |
Blocks (std::vector< u_int32_t > *blocks, std::vector< bool > *lookup, u_int32_t nr_blocks) | |
A constructor. More... | |
Blocks (Blocks const ©) | |
Copy constructor. More... | |
~Blocks () | |
Default destructor. More... | |
u_int32_t | block (size_t pos) const |
Returns the index of the block containing pos. More... | |
std::vector< u_int32_t >::const_iterator | cbegin () const |
Returns a const_iterator pointing to the index of the first block. More... | |
std::vector< u_int32_t >::const_iterator | cend () const |
Returns a const_iterator referring to past-the-end of the last block. More... | |
u_int32_t | degree () const |
Returns the degree of a Blocks object. More... | |
size_t | hash_value () const |
Returns a hash value for a this . More... | |
bool | is_transverse_block (size_t index) const |
Returns true if the block with index index is transverse. More... | |
std::vector< bool > const * | lookup () const |
Returns a pointer to the lookup table for block indices. More... | |
u_int32_t | nr_blocks () const |
Returns the number of blocks in the Blocks object. More... | |
bool | operator< (const Blocks &that) const |
Returns true if this is less than that . More... | |
Blocks & | operator= (Blocks const ©)=delete |
The assignment operator is deleted for Blocks to avoid unintended copying. More... | |
bool | operator== (const Blocks &that) const |
Returns true if this equals that . More... | |
u_int32_t | rank () |
Returns the number of signed (transverse) blocks in this . More... | |
Class for signed partitions of the set \(\{0, \ldots, n - 1\}\).
It is possible to associate to every Bipartition a pair of blocks, Bipartition::left_blocks and Bipartition::right_blocks, which determine the Green's \(\mathscr{L}\)- and \(\mathscr{R}\)-classes of the Bipartition in the monoid of all bipartitions. This is the purpose of this class.
The Blocks class is not currently used by any of the methods for the Semigroup class but the extra methods are used in the GAP package Semigroups package for GAP.
|
inline |
A constructor.
Constructs a blocks object of size 0.
|
inline |
A constructor.
The parameter blocks
must be non-empty, consist of non-negative integers, and have the property that if some positive \(i\) occurs in blocks
, then \(i - 1\) occurs earlier in blocks
. None of this is checked. The parameter blocks
is not copied, and is deleted by the destructor Blocks::~Blocks.
The parameter lookup
must have length equal to the number of different values in blocks
(or one more than the maximum value in the list); this is equal to the number of blocks in the partition. A value true
in position \(i\) indicates that the \(i\)th block is signed (transverse) and false
that it is unsigned.
|
inline |
A constructor.
The parameter blocks
must have length \(n\) for some integer \(n > 0\), consist of non-negative integers, and have the property that if \(i\), \(i > 0\) occurs in blocks
, then \(i - 1\) occurs earlier in blocks
. None of this is checked. The parameter blocks
is not copied, and is deleted by the destructor Blocks::~Blocks.
The parameter lookup
must have length equal to the number of different values in blocks
(or one more than the maximum value in the list); this is equal to the number of blocks in the partition. A value true
in position \(i\) indicates that the \(i\)th block is signed (transverse) and false
that it is unsigned.
The parameter nr_blocks
must be the number of blocks (i.e. one more than the maximum value in blocks
).
This constructor is provided for the situation where the number of blocks in blocks is known a priori and so does not need to be calculated in the constructor.
libsemigroups::Blocks::Blocks | ( | Blocks const & | copy | ) |
Copy constructor.
Copies all the information in copy and returns a new instance of Blocks.
|
inline |
Default destructor.
Deletes the blocks and lookup provided at construction time.
|
inline |
Returns the index of the block containing pos.
This method asserts that pos
is valid, i.e. that it is less than the degree of this
.
|
inline |
Returns a const_iterator pointing to the index of the first block.
This method asserts that degree is not 0.
|
inline |
Returns a const_iterator referring to past-the-end of the last block.
This method asserts that degree is not 0.
|
inline |
size_t libsemigroups::Blocks::hash_value | ( | ) | const |
Returns a hash value for a this
.
This method returns a hash value for an instance of Blocks. This value is recomputed every time this method is called.
|
inline |
Returns true
if the block with index index
is transverse.
This method returns true
if the block with index index
is a transverse (or signed) block and it returns false
if it is not transverse (or unsigned). This method asserts that the parameter index
is valid, i.e. that it is less than the degree of this
.
|
inline |
Returns a pointer to the lookup table for block indices.
The vector pointed to by the return value of this method has value true
in position i
if the i
th block of this
is a transverse block; the entry in position i
is false
otherwise.
|
inline |
Returns the number of blocks in the Blocks object.
This method returns the number of parts in the partition that instances of this class represent.
bool libsemigroups::Blocks::operator< | ( | const Blocks & | that | ) | const |
Returns true
if this
is less than that
.
This operator defines a total order on the set of all Blocks objects (including those of different degree).
The assignment operator is deleted for Blocks to avoid unintended copying.
bool libsemigroups::Blocks::operator== | ( | const Blocks & | that | ) | const |
Returns true
if this
equals that
.
Two Blocks objects are equal if and only if their underlying signed partitions are equal. It is ok to compare blocks of different degree with this operator.
u_int32_t libsemigroups::Blocks::rank | ( | ) |
Returns the number of signed (transverse) blocks in this
.
Equivalently, this method returns the number of true
values in Blocks::lookup().