Getters¶
This page contains information about attributes of the Bipartition
class.
-
size_t libsemigroups::Bipartition::degree() const noexcept¶
Returns the degree of the bipartition.
A bipartition is of degree \(n\) if it is a partition of \(\{0, \ldots, 2n - 1\}\).
- Parameters
(None)
- Throws
(None) – This function is
noexcept
and is guaranteed never to throw.- Returns
A value of type
size_t
.
-
inline size_t libsemigroups::Bipartition::hash_value() const¶
Returns a hash value.
- Parameters
(None)
- Complexity
Linear in degree().
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A value of
size_t
.
-
Bipartition libsemigroups::Bipartition::identity() const¶
Returns an identity bipartition.
The identity bipartition of degree \(n\) has blocks \(\{i, -i\}\) for all \(i\in \{0, \ldots, n - 1\}\). This member function returns a new identity bipartition of degree equal to the degree of
this
.- Parameters
(None)
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A newly constructed Bipartition.
-
bool libsemigroups::Bipartition::is_transverse_block(size_t index)¶
Check if a block is a transverse block.
A block of a biparition is transverse if it contains integers less than and greater than \(n\), which is the degree of the bipartition. This member function asserts that the parameter
index
is less than the number of blocks in the bipartition.- Complexity
At worst \(O(n)\) where \(n\) is the degree().
- Parameters
index – the index of a block
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
true
if the block with indexindex
is transverse, andfalse
if not.
-
Blocks *libsemigroups::Bipartition::left_blocks()¶
Return a pointer to the left blocks of a bipartition.
The left blocks of a bipartition is the partition of \(\{0, \ldots, n - 1\}\) induced by the bipartition. This member function returns a Blocks object representing this partition.
- Complexity
\(O(n)\) where \(n\) is the degree().
- Parameters
(None)
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A pointer to a newly constructed Blocks object.
-
uint32_t libsemigroups::Bipartition::number_of_blocks() const¶
Returns the number of blocks in a Bipartition.
This function returns the number of parts in the partition that instances of this class represent.
- Complexity
At worst \(O(2n)\) where \(n\) is the degree().
- Parameters
(None)
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
The number of blocks in a Blocks object.
-
uint32_t libsemigroups::Bipartition::number_of_left_blocks()¶
Returns the number of blocks containing a positive integer.
The left blocks of a bipartition is the partition of \(\{0, \ldots, n - 1\}\) induced by the bipartition. This member function returns the number of blocks in this partition.
- Complexity
At worst \(O(n)\) where \(n\) is the degree().
- Parameters
(None)
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A value of type
uint32_t
.
-
uint32_t libsemigroups::Bipartition::number_of_right_blocks()¶
Returns the number of blocks containing a negative integer.
The right blocks of a bipartition is the partition of \(\{n, \ldots, 2n - 1\}\) induced by the bipartition. This member function returns the number of blocks in this partition.
- Complexity
At worst \(O(n)\) where \(n\) is the degree().
- Parameters
(None)
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A value of type
uint32_t
.
-
size_t libsemigroups::Bipartition::rank()¶
Returns the number of transverse blocks.
The rank of a bipartition is the number of blocks containing both positive and negative values.
- Parameters
(None)
- Complexity
\(O(2n)\) where \(n\) is the degree().
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A value of type
size_t
.
-
Blocks *libsemigroups::Bipartition::right_blocks()¶
Return a pointer to the right blocks of a bipartition.
The right blocks of a bipartition is the partition of \(\{n, \ldots, 2n - 1\}\) induced by the bipartition.
- Complexity
\(O(n)\) where \(n\) is the degree().
- Parameters
(None)
- Throws
(None) – This function guarantees not to throw a
LibsemigroupsException
.- Returns
A pointer to a newly constructed Blocks object.