libsemigroups  v3.0.0
C++ library for semigroups and monoids
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Loading...
Searching...
No Matches
libsemigroups::pbr Namespace Reference

This namespace contains helper functions for the PBR class.

Functions

PBR one (PBR const &x)
 Returns the identity PBR with degree x.degree().
 
PBR one (size_t n)
 Returns the identity PBR with specified degree.
 
void throw_if_adjacencies_unsorted (PBR const &x)
 Throws if a PBR has a list of points related to a point that is not sorted.
 
void throw_if_entry_out_of_bounds (PBR const &x)
 Throws if a PBR has a point related to a point that is greater than degree().
 
void throw_if_invalid (PBR const &x)
 Throws if a PBR is invalid.
 
void throw_if_not_even_length (PBR const &x)
 Throws if a PBR has an odd number of points.
 

Function Documentation

◆ one() [1/2]

PBR one ( PBR const & x)

This member function returns a new PBR with degree equal to the degree of x, where every value is adjacent to its negative. Equivalently, i is adjacent i+n and vice versa for every i less than the degree n.

Parameters
xA PBR.
Returns
A PBR.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
See also
one(size_t)

◆ one() [2/2]

PBR one ( size_t n)

This function returns a new PBR with degree equal to n where every value is adjacent to its negative. Equivalently, i is adjacent i+n and vice versa for every i less than the degree n.

Parameters
nthe degree.
Returns
A PBR.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
See also
one(PBR const&)

◆ throw_if_adjacencies_unsorted()

void throw_if_adjacencies_unsorted ( PBR const & x)

This function throws a LibsemigroupsException if the argument x has a list of points related to a point that is not sorted.

Parameters
xthe PBR to check.
Exceptions
LibsemigroupsExceptionif x has a list of points related to a point that is not sorted.
Complexity
Linear in the PBR::degree of x.

◆ throw_if_entry_out_of_bounds()

void throw_if_entry_out_of_bounds ( PBR const & x)

This function throws a LibsemigroupsException if the argument x has a point related to a point that is greater than degree().

Parameters
xthe PBR to check.
Exceptions
LibsemigroupsExceptionif x has a point related to a point that is greater than degree().
Complexity
Linear in the PBR::degree of x.

◆ throw_if_invalid()

void throw_if_invalid ( PBR const & x)
inline

This function throws a LibsemigroupsException if the argument x is not a valid PBR.

Parameters
xthe PBR to check.
Exceptions
LibsemigroupsExceptionif any of the following occur:
  • x does not describe a binary relation on an even number of points;
  • x has a point related to a point that is greater than degree();
  • a list of points related to a point is not sorted.
Complexity
Linear in the PBR::degree x.
See also

◆ throw_if_not_even_length()

void throw_if_not_even_length ( PBR const & x)

This function throws a LibsemigroupsException if the argument x does not describe a binary relation on an even number of points.

Parameters
xthe PBR to check.
Exceptions
LibsemigroupsExceptionx does not describe a binary relation on an even number of points.
Complexity
Constant.