The PBR class
Class for representing PBRs.
Partitioned binary relations (PBRs) are a generalisation of a bipartitions, and were introduced by Martin and Mazorchuk in [MM11].
Contents
| Class for representing PBRs. | |
| 
 | Copy a  | 
| 
 | Returns the degree of a  | 
| Returns the number of points of a  | |
| Multiply two PBR objects and store the product in self. | 
Full API
- class PBR
- __init__(*args, **kwargs)
- Overloaded function. - __init__(self: PBR, n: int) None
- Construct empty PBR of given degree. - Parameters:
- n (int) – the degree 
 
 - __init__(self: PBR, left: list[list[int]], right: list[list[int]]) None
- Construct from adjacencies - 1to- nand- -1to- -n.- Construct from adjacencies - 1to- nand- -1to- -n. The parameters left and right should be containers of- nlists of integer values, so that the list in position- iof left is the list of points adjacent to- iin the- PBR, and the list in position- iof right is the list of points adjacent to- n + iin the- PBR. A negative value- icorresponds to- n - i.- Parameters:
- Raises:
- if the resultant PBR: - would not describe a binary relation on an even number of points; or 
- would have a point related to a point that is greater than - PBR.degree;
 
 
 - __init__(self: PBR, x: list[list[int]]) None
- Construct from adjacencies - 0to- 2n - 1.- Construct from adjacencies - 0to- 2n - 1. The parameter x must be a container of lists of- intwith size- 2nfor some integer- n, and the list in position- iis the list of points adjacent to- iin the- PBRconstructed.- Parameters:
- x (list[list[int]]) – the container of lists of adjacencies. 
- Raises:
- if the resultant PBR: - would not describe a binary relation on an even number of points; or 
- would have a point related to a point that is greater than - PBR.degree;
- x contains a list of points related to a point that is not sorted. 
 
 
 
 - degree(self: PBR) int
- Returns the degree of a - PBR.- Returns the degree of a - PBR, where the degree of a- PBRis half the number of points in the- PBR.- Returns:
- The degree of the PBR. 
- Return type:
- Complexity:
- Constant. 
 
 - number_of_points(self: PBR) int
- Returns the number of points of a - PBR.- Returns:
- A value of type - int.
- Return type:
- Complexity:
- Constant. 
 
 - product_inplace(self: PBR, x: PBR, y: PBR, thread_id: int) None
- Multiply two PBR objects and store the product in self. - The parameter thread_id is required since some temporary storage is required to find the product of x and y. Note that if different threads call this member function with the same value of thread_id then bad things will happen. - Parameters:
- Raises:
- LibsemigroupsError – if: * the - PBR.degreeof x is not the same as the- PBR.degreeof y; * the- PBR.degreeof self is not the same as the- PBR.degreeof x; or * either x or y is the same object as self.