Module garoupa.algebra.matrix.mat128bit
Classes
class Mat128bit (i)-
Expand source code
class Mat128bit(Element): def __init__(self, i, _m=None): """nxn modulo o Usage: >>> a = Mat(4783632, 6, 5) >>> a [[1 2 1 0 4 3] [0 1 0 1 1 2] [0 0 1 2 0 0] [0 0 0 1 0 0] [0 0 0 0 1 0] [0 0 0 0 0 1]] """ super().__init__(i, 2**128) self.m = int2bm(i) if _m is None else _m def __mul__(self, other): m = bmm(self.m, other.m, 2) return Mat128bit(bm2int(m), _m=m) def __repr__(self): return f"{self.m}" def __invert__(self): m = bminv(self.m) return Mat128bit(bm2int(m), _m=m)Element(i: int, order: int)
nxn modulo o Usage:
>>> a = Mat(4783632, 6, 5) >>> a [[1 2 1 0 4 3] [0 1 0 1 1 2] [0 0 1 2 0 0] [0 0 0 1 0 0] [0 0 0 0 1 0] [0 0 0 0 0 1]]Ancestors
- Element
- abc.ABC
Inherited members