int coefficients.add) change the polynomial, others (like mult) do
not but return the result as a new polynomial.
| Modifier and Type | Class and Description |
|---|---|
| private static class | IntegerPolynomial.
Calls {@link ModularResultant#combineRho(ModularResultant, ModularResultant) |
| private class | IntegerPolynomial.
Calls {@link IntegerPolynomial#resultant(int) |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final List | |
| public int[] | |
| private static final int | |
| private static final int[] | PRIMES
Prime numbers > 4500 for resultant computation. |
| Access | Constructor and Description |
|---|---|
| public | IntegerPolynomial(int
the number of coefficients N)Constructs a new polynomial with |
| public | IntegerPolynomial(int[]
the coefficients coeffs)Constructs a new polynomial with a given set of coefficients. |
| public | IntegerPolynomial(BigIntPolynomial
the original polynomial p)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(IntegerPolynomial
another polynomial b, int modulus)Adds another polynomial which can have a different number of coefficients,
and takes the coefficient values mod |
| public void | add(IntegerPolynomial
another polynomial b)Adds another polynomial which can have a different number of coefficients. |
| public void | |
| public long | Returns: the centered norma modulus q)Computes the centered euclidean norm of the polynomial. |
| public void | |
| public Object | |
| public int | Returns: the number of coefficients equal tovaluean integer value)Counts the number of coefficients equal to an integer |
| pack-priv int | |
| public void | |
| public void | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| private boolean | Returns: true iff all coefficients are equal to zero, except for the lowest coefficient which must equal 1 or -1Tests if |
| public boolean | Returns: true iff all coefficients are equal to zero, except for the lowest coefficient which must equal 1Tests if |
| private boolean | |
| public static IntegerPolynomial | Returns: the decoded polynomialan encoded ternary polynomial data, int number of coefficients N, int q)Returns a polynomial with N coefficients between |
| public static IntegerPolynomial | Returns: the decoded polynomialan encoded ternary polynomial is, int number of coefficients N, int q)Returns a polynomial with N coefficients between |
| public static IntegerPolynomial | Returns: the decoded polynomialan encoded ternary polynomial data, int number of coefficients N)Decodes a byte array to a polynomial with |
| public static IntegerPolynomial | Returns: the decoded polynomiala byte array b, int number of coefficients N)Converts a byte array produced by |
| public static IntegerPolynomial | Returns: the decoded polynomialan input stream is, int number of coefficients N)Reads data produced by |
| public IntegerPolynomial | |
| public IntegerPolynomial | Returns: a new polynomialthe modulus q)Computes the inverse mod |
| public void | |
| private IntegerPolynomial | Returns: The inverse of this polynomial mod qComputes the inverse mod q from the inverse mod 2 |
| public void | |
| pack-priv void | |
| public void | |
| public IntegerPolynomial | mult(IntegerPolynomial
a polynomial poly2, int a modulus to apply modulus)Implements org. Multiplies the polynomial with another, taking the values mod modulus and the indices mod N |
| public IntegerPolynomial | mult(IntegerPolynomial
a polynomial poly2)Implements org. Multiplies the polynomial with another, taking the indices mod N |
| public BigIntPolynomial | mult(BigIntPolynomial
the polynomial to multiply by poly2)Implements org. Multiplies the polynomial by a |
| public void | |
| private void | |
| public void | |
| private IntegerPolynomial | |
| private void | multShiftSub(IntegerPolynomial b, int c, int k, int p)
Computes |
| public Resultant | Returns: (rho, res) satisfying res = rho*this + t*(x^n-1) for some integer t.Resultant of this polynomial with |
| public ModularResultant | Returns: (rho, res) satisfying res = rho*this + t*(x^n-1) mod p for some integer t.Resultant of this polynomial with |
| public Resultant | Returns: (rho, res) satisfying res = rho*this + t*(x^n-1) for some integer t.Multithreaded version of |
| public void | |
| pack-priv void | |
| private void | |
| private BigInteger | |
| public void | sub(IntegerPolynomial
another polynomial b, int modulus)Subtracts another polynomial which can have a different number of coefficients,
and takes the coefficient values mod |
| public void | sub(IntegerPolynomial
another polynomial b)Subtracts another polynomial which can have a different number of coefficients. |
| pack-priv void | |
| public int | Returns: the sum of all coefficientsReturns the sum of all coefficients, i.e. evaluates the polynomial at 0. |
| public byte[] | Returns: the encoded polynomialEncodes a polynomial whose coefficients are between 0 and q, to binary. |
| public byte[] | Returns: the encoded polynomialEncodes a polynomial with ternary coefficients to binary. |
| public byte[] | Returns: the encoded polynomialConverts a polynomial with ternary coefficients to binary. |
| public IntegerPolynomial | toIntegerPolynomial()
Implements org. Returns a polynomial that is equal to this polynomial (in the sense that |
| BIGINT_PRIMES | back to summary |
|---|---|
| private static final List<E> BIGINT_PRIMES | |
| coeffs | back to summary |
|---|---|
| public int[] coeffs | |
| NUM_EQUAL_RESULTANTS | back to summary |
|---|---|
| private static final int NUM_EQUAL_RESULTANTS | |
| PRIMES | back to summary |
|---|---|
| private static final int[] PRIMES Prime numbers > 4500 for resultant computation. Starting them below ~4400 causes incorrect results occasionally.
Fortunately, 4500 is about the optimum number for performance. | |
| IntegerPolynomial | back to summary |
|---|---|
| public IntegerPolynomial(int N) Constructs a new polynomial with
| |
| IntegerPolynomial | back to summary |
|---|---|
| public IntegerPolynomial(int[] coeffs) Constructs a new polynomial with a given set of coefficients.
| |
| IntegerPolynomial | back to summary |
|---|---|
| public IntegerPolynomial(BigIntPolynomial p) Constructs a
| |
| add | back to summary |
|---|---|
| public void add(IntegerPolynomial b, int modulus) Adds another polynomial which can have a different number of coefficients,
and takes the coefficient values mod
| |
| add | back to summary |
|---|---|
| public void add(IntegerPolynomial b) Adds another polynomial which can have a different number of coefficients.
| |
| center0 | back to summary |
|---|---|
| public void center0(int q) Shifts the values of all coefficients to the interval
| |
| centeredNormSq | back to summary |
|---|---|
| public long centeredNormSq(int q) Computes the centered euclidean norm of the polynomial.
| |
| clear | back to summary |
|---|---|
| public void clear() | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| count | back to summary |
|---|---|
| public int count(int value) Counts the number of coefficients equal to an integer
| |
| degree | back to summary |
|---|---|
| pack-priv int degree() Returns the degree of the polynomial
| |
| div | back to summary |
|---|---|
| public void div(int k) Divides each coefficient by
| |
| ensurePositive | back to summary |
|---|---|
| public void ensurePositive(int modulus) Adds
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| equalsAbsOne | back to summary |
|---|---|
| private boolean equalsAbsOne() Tests if
| |
| equalsOne | back to summary |
|---|---|
| public boolean equalsOne() Tests if
| |
| equalsZero | back to summary |
|---|---|
| private boolean equalsZero() Tests if
| |
| fromBinary | back to summary |
|---|---|
| public static IntegerPolynomial fromBinary(byte[] data, int N, int q) Returns a polynomial with N coefficients between
| |
| fromBinary | back to summary |
|---|---|
| public static IntegerPolynomial fromBinary(InputStream is, int N, int q) throws IOException Returns a polynomial with N coefficients between
| |
| fromBinary3Sves | back to summary |
|---|---|
| public static IntegerPolynomial fromBinary3Sves(byte[] data, int N) Decodes a byte array to a polynomial with
| |
| fromBinary3Tight | back to summary |
|---|---|
| public static IntegerPolynomial fromBinary3Tight(byte[] b, int N) Converts a byte array produced by
| |
| fromBinary3Tight | back to summary |
|---|---|
| public static IntegerPolynomial fromBinary3Tight(InputStream is, int N) throws IOException Reads data produced by
| |
| invertF3 | back to summary |
|---|---|
| public IntegerPolynomial invertF3() Computes the inverse mod 3.
Returns
| |
| invertFq | back to summary |
|---|---|
| public IntegerPolynomial invertFq(int q) Computes the inverse mod
| |
| mod | back to summary |
|---|---|
| public void mod(int modulus) Takes each coefficient modulo | |
| mod2ToModq | back to summary |
|---|---|
| private IntegerPolynomial mod2ToModq(IntegerPolynomial Fq, int q) Computes the inverse mod q from the inverse mod 2
| |
| mod3 | back to summary |
|---|---|
| public void mod3() Takes each coefficient modulo 3 such that all coefficients are ternary. | |
| modCenter | back to summary |
|---|---|
| pack-priv void modCenter(int modulus) Reduces all coefficients to the interval [-modulus/2, modulus/2) | |
| modPositive | back to summary |
|---|---|
| public void modPositive(int modulus) Ensures all coefficients are between 0 and
| |
| mult | back to summary |
|---|---|
| public IntegerPolynomial mult(IntegerPolynomial poly2, int modulus) Implements org. Multiplies the polynomial with another, taking the values mod modulus and the indices mod N
| |
| mult | back to summary |
|---|---|
| public IntegerPolynomial mult(IntegerPolynomial poly2) Implements org. Multiplies the polynomial with another, taking the indices mod N
| |
| mult | back to summary |
|---|---|
| public BigIntPolynomial mult(BigIntPolynomial poly2) Implements org. Doc from org. Multiplies the polynomial by a
| |
| mult | back to summary |
|---|---|
| public void mult(int factor) Multiplies each coefficient by a | |
| mult2 | back to summary |
|---|---|
| private void mult2(int modulus) Multiplies each coefficient by a 2 and applies a modulus. Does not return a new polynomial but modifies this polynomial.
| |
| mult3 | back to summary |
|---|---|
| public void mult3(int modulus) Multiplies each coefficient by a 2 and applies a modulus. Does not return a new polynomial but modifies this polynomial.
| |
| multRecursive | back to summary |
|---|---|
| private IntegerPolynomial multRecursive(IntegerPolynomial poly2) Karazuba multiplication | |
| multShiftSub | back to summary |
|---|---|
| private void multShiftSub(IntegerPolynomial b, int c, int k, int p) Computes | |
| resultant | back to summary |
|---|---|
| public Resultant resultant() Resultant of this polynomial with
Unlike EESS, this implementation does not compute all resultants modulo primes
such that their product exceeds the maximum possible resultant, but rather stops
when Because of the above, callers must verify the output and try a different polynomial if necessary.
| |
| resultant | back to summary |
|---|---|
| public ModularResultant resultant(int p) Resultant of this polynomial with
| |
| resultantMultiThread | back to summary |
|---|---|
| public Resultant resultantMultiThread() Multithreaded version of
| |
| rotate1 | back to summary |
|---|---|
| public void rotate1() Multiplication by | |
| shiftGap | back to summary |
|---|---|
| pack-priv void shiftGap(int q) Shifts all coefficients so the largest gap is centered around
| |
| sort | back to summary |
|---|---|
| private void sort(int[] ints) | |
| squareSum | back to summary |
|---|---|
| private BigInteger squareSum() Adds the squares of all coefficients.
| |
| sub | back to summary |
|---|---|
| public void sub(IntegerPolynomial b, int modulus) Subtracts another polynomial which can have a different number of coefficients,
and takes the coefficient values mod
| |
| sub | back to summary |
|---|---|
| public void sub(IntegerPolynomial b) Subtracts another polynomial which can have a different number of coefficients.
| |
| sub | back to summary |
|---|---|
| pack-priv void sub(int b) Subtracts a | |
| sumCoeffs | back to summary |
|---|---|
| public int sumCoeffs() Returns the sum of all coefficients, i.e. evaluates the polynomial at 0.
| |
| toBinary | back to summary |
|---|---|
| public byte[] toBinary(int q) Encodes a polynomial whose coefficients are between 0 and q, to binary. q must be a power of 2.
| |
| toBinary3Sves | back to summary |
|---|---|
| public byte[] toBinary3Sves() Encodes a polynomial with ternary coefficients to binary.
| |
| toBinary3Tight | back to summary |
|---|---|
| public byte[] toBinary3Tight() Converts a polynomial with ternary coefficients to binary.
| |
| toIntegerPolynomial | back to summary |
|---|---|
| public IntegerPolynomial toIntegerPolynomial() Implements org. Doc from org. Returns a polynomial that is equal to this polynomial (in the sense that
| |
| Modifier and Type | Field and Description |
|---|---|
| private ModularResultant | |
| private ModularResultant |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ModularResultant | call()
Implements java. Computes a result, or throws an exception if unable to do so. |
| modRes1 | back to summary |
|---|---|
| private ModularResultant modRes1 | |
| modRes2 | back to summary |
|---|---|
| private ModularResultant modRes2 | |
| CombineTask | back to summary |
|---|---|
| private CombineTask(ModularResultant modRes1, ModularResultant modRes2) | |
| call | back to summary |
|---|---|
| public ModularResultant call() Implements java. Doc from java. Computes a result, or throws an exception if unable to do so.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ModularResultant | call()
Implements java. Computes a result, or throws an exception if unable to do so. |
| modulus | back to summary |
|---|---|
| private int modulus | |
| ModResultantTask | back to summary |
|---|---|
| private ModResultantTask(int modulus) | |
| call | back to summary |
|---|---|
| public ModularResultant call() Implements java. Doc from java. Computes a result, or throws an exception if unable to do so.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private BigInteger |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public BigInteger |
| PrimeGenerator | back to summary |
|---|---|
| private PrimeGenerator() | |
| nextPrime | back to summary |
|---|---|
| public BigInteger nextPrime() | |