np.reciprocal¶
-
np.
reciprocal
(x)[source]¶ Returns the element-wise multiplicative inverse of a Galois field array.
References
Examples
In [1]: GF = galois.GF(31) In [2]: x = GF.Random(5, low=1); x Out[2]: GF([ 4, 24, 22, 5, 9], order=31) In [3]: y = np.reciprocal(x); y Out[3]: GF([ 8, 22, 24, 25, 7], order=31) In [4]: x * y Out[4]: GF([1, 1, 1, 1, 1], order=31)
In [5]: x ** -1 Out[5]: GF([ 8, 22, 24, 25, 7], order=31) In [6]: GF(1) / x Out[6]: GF([ 8, 22, 24, 25, 7], order=31) In [7]: GF(1) // x Out[7]: GF([ 8, 22, 24, 25, 7], order=31)