The Transf16 class
Class representing transformations.
SIMD accelerated class Transf16 representing transformations on
up to 16 points.
This class belongs to the hpcombi subpackage of libsemigroups_pybind11.
The functionality described on this page is only available if
LIBSEMIGROUPS_HPCOMBI_ENABLED is True.
Contents
Class representing transformations. |
|
Copy a |
|
|
Returns the identity partial transformation. |
Check whether or not a |
Full API
- class hpcombi.Transf16
- __init__(*args, **kwargs)
Overloaded function.
- __init__(self: Transf16) None
Default constructor.
Constructs a
Transf16object with its entries uninitialized. This means there is no guarantee about the values in the constructed object.>>> from libsemigroups_pybind11.hpcombi import Transf16 >>> x = Transf16()
- __init__(self: Transf16, img: list[int]) None
Construct a
Transf16from a list of images.This function constructs a
Transf16from the list img of its entries. If the length of img is less than16, then the constructedTransf16is padded with fixed points at the end.- Parameters:
- Raises:
LibsemigroupsError – if any value in img is in the range \([16, 256)\).
LibsemigroupsError – if the length of img exceeds
16.TypeError – if any value in img is larger than
255.
>>> from libsemigroups_pybind11.hpcombi import Transf16 >>> Transf16([1, 3, 1, 10]) Transf16([ 1, 3, 1,10, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15])
- __init__(self: Transf16, n: int) None
Construct a transformation from its 64 bits compressed.
This function constructs a
Transf16from its integer representation n.- Parameters:
n (int) – the integer representation.
- Raises:
TypeError – if n is not in the range \([0, 2 ^{64})\).
>>> from libsemigroups_pybind11.hpcombi import Transf16 >>> Transf16(2 ** 64 - 1) Transf16([15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]) >>> int(Transf16([15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15])) 18446744073709551615
- copy(self: Transf16) Transf16
Copy a
Transf16.- Returns:
A copy of the argument.
- Return type:
>>> from libsemigroups_pybind11.hpcombi import Transf16 >>> x = Transf16([1, 2, 3, 4, 4]) >>> x.copy() is not x True >>> x.copy() == x True
- static one() Transf16
Returns the identity partial transformation.
This function returns the identity
Transf16which fixes every value in \([0, 16)\).- Returns:
The identity transformation.
- Return type:
>>> from libsemigroups_pybind11.hpcombi import Transf16 >>> x = Transf16([1, 0, 1]) >>> x * x.one() == Transf16.one() * x == x True
- validate(self: Transf16, bound: int = 16) bool
Check whether or not a
Transf16is well-defined.This function returns
Trueif self is a well-defined partial transformation (i.e. no image value is larger than15) on the values0up to bound.- Parameters:
bound (int) – the bound (defaults to
16).- Returns:
Whether or not self is valid.
- Return type:
Note
It should not be possible to create an invalid
Transf16inlibsemigroups_pybind11, and this function is only included for completeness.>>> from libsemigroups_pybind11.hpcombi import Transf16 >>> Transf16([1, 0, 1]).validate() True