public class FloatModMath extends FloatElementaryModMath
float data.| Constructor and Description |
|---|
FloatModMath()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
float[] |
createWTable(float w,
int n)
Create a table of powers of n:th root of unity.
|
float |
getForwardNthRoot(float primitiveRoot,
long n)
Get forward n:th root of unity.
|
float |
getInverseNthRoot(float primitiveRoot,
long n)
Get inverse n:th root of unity.
|
float |
modDivide(float a,
float b)
Modular division.
|
float |
modInverse(float a)
Modular inverse, that is
1 / a. |
float |
modPow(float a,
float n)
Modular power.
|
float |
negate(float a)
Modular negation.
|
getModulus, modAdd, modMultiply, modSubtract, setModuluspublic final float[] createWTable(float w,
int n)
w - The n:th root of unity modulo the current modulus.n - The table length (= transform length).table[i]=wi mod m, i = 0, ..., n-1.public float getForwardNthRoot(float primitiveRoot,
long n)
w.Assumes that the modulus is prime.
primitiveRoot - Primitive root of the modulus.n - The transform length.public float getInverseNthRoot(float primitiveRoot,
long n)
w-1.Assumes that the modulus is prime.
primitiveRoot - Primitive root of the modulus.n - The transform length.public final float modInverse(float a)
1 / a. Assumes that the modulus is prime.a - The operand.a-1 mod m.public final float modDivide(float a,
float b)
a - The dividend.b - The divisor.a*b-1 mod m.public final float negate(float a)
a - The argument.-a mod m.public final float modPow(float a,
float n)
a - The base.n - The exponent.an mod m.Copyright © 2025. All rights reserved.