|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apfloat.internal.IntElementaryModMath
org.apfloat.internal.IntModMath
public class IntModMath
Modulo arithmetic functions for int data.
| Constructor Summary | |
|---|---|
IntModMath()
Default constructor. |
|
| Method Summary | |
|---|---|
int[] |
createWTable(int w,
int n)
Create a table of powers of n:th root of unity. |
int |
getForwardNthRoot(int primitiveRoot,
long n)
Get forward n:th root of unity. |
int |
getInverseNthRoot(int primitiveRoot,
long n)
Get inverse n:th root of unity. |
int |
modDivide(int a,
int b)
Modular division. |
int |
modInverse(int a)
Modular inverse, that is 1 / a. |
int |
modPow(int a,
int n)
Modular power. |
int |
negate(int a)
Modular negation. |
| Methods inherited from class org.apfloat.internal.IntElementaryModMath |
|---|
getModulus, modAdd, modMultiply, modSubtract, setModulus |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IntModMath()
| Method Detail |
|---|
public final int[] createWTable(int 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 int getForwardNthRoot(int primitiveRoot,
long n)
w.Assumes that the modulus is prime.
primitiveRoot - Primitive root of the modulus.n - The transform length.
public int getInverseNthRoot(int primitiveRoot,
long n)
w-1.Assumes that the modulus is prime.
primitiveRoot - Primitive root of the modulus.n - The transform length.
public final int modInverse(int a)
1 / a. Assumes that the modulus is prime.
a - The operand.
a-1 mod m.
public final int modDivide(int a,
int b)
a - The dividend.b - The divisor.
a*b-1 mod m.public final int negate(int a)
a - The argument.
-a mod m.
public final int modPow(int a,
int n)
a - The base.n - The exponent.
an mod m.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||