libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
libsemigroups::bipartition Namespace Reference

This namespace contains helper functions for the Bipartition class.

Functions

Bipartition one (Bipartition const &f)
 Return the identity bipartition with the same degree as the given bipartition.
 
void throw_if_invalid (Bipartition const &x)
 Checks a bipartition.
 
std::vector< std::vector< int32_t > > underlying_partition (Bipartition const &x)
 Return the underlying partition of a Bipartition object.
 

Function Documentation

◆ one()

Bipartition one ( Bipartition const & f)
nodiscard
Parameters
fthe bipartition. Returns the identity bipartition of degree equal to f.degree().

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.

Returns
A newly constructed Bipartition.
Exceptions
This function guarantees not to throw a LibsemigroupsException.

◆ throw_if_invalid()

void throw_if_invalid ( Bipartition const & x)

This function checks a Bipartition object, and throws an exception if the object is not valid.

Parameters
xthe bipartition.
Exceptions
LibsemigroupsExceptionif x is invalid.

◆ underlying_partition()

std::vector< std::vector< int32_t > > underlying_partition ( Bipartition const & x)
nodiscard

The underlying partition of a bipartition x is the partition of a subset \(P\) of \(\{-n, \ldots, -1\}\cup \{1, \ldots, n\}\) such that:

  • \(\{|x|\mid x\in P\} = \{1, \ldots, n\}\);
  • a block of the partition consists of negative numbers if and only if the corresponding block of x is a transverse block.
Parameters
xthe bipartition.
Returns
A vector of vectors of integers.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Complexity
\(O(n)\) where \(n\) is the degree().