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
1tonand-1to-n.Construct from adjacencies
1tonand-1to-n. The parameters left and right should be containers ofnlists of integer values, so that the list in positioniof left is the list of points adjacent toiin thePBR, and the list in positioniof right is the list of points adjacent ton + iin thePBR. A negative valueicorresponds ton - 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
0to2n - 1.Construct from adjacencies
0to2n - 1. The parameter x must be a container of lists ofintwith size2nfor some integern, and the list in positioniis the list of points adjacent toiin thePBRconstructed.- 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 aPBRis half the number of points in thePBR.- 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 thePBR.degreeof y; * thePBR.degreeof self is not the same as thePBR.degreeof x; or * either x or y is the same object as self.