Class ProductFormPolynomial

  • All Implemented Interfaces:
    Polynomial

    public class ProductFormPolynomial
    extends java.lang.Object
    implements Polynomial
    A polynomial of the form f1*f2+f3, where f1,f2,f3 are very sparsely populated ternary polynomials.
    • Method Detail

      • generateRandom

        public static ProductFormPolynomial generateRandom​(int N,
                                                           int df1,
                                                           int df2,
                                                           int df3Ones,
                                                           int df3NegOnes,
                                                           java.security.SecureRandom random)
      • fromBinary

        public static ProductFormPolynomial fromBinary​(byte[] data,
                                                       int N,
                                                       int df1,
                                                       int df2,
                                                       int df3Ones,
                                                       int df3NegOnes)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • fromBinary

        public static ProductFormPolynomial fromBinary​(java.io.InputStream is,
                                                       int N,
                                                       int df1,
                                                       int df2,
                                                       int df3Ones,
                                                       int df3NegOnes)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • toBinary

        public byte[] toBinary()
      • mult

        public IntegerPolynomial mult​(IntegerPolynomial b)
        Description copied from interface: Polynomial
        Multiplies the polynomial by an IntegerPolynomial, taking the indices mod N.
        Specified by:
        mult in interface Polynomial
        Parameters:
        b - a polynomial
        Returns:
        the product of the two polynomials
      • mult

        public BigIntPolynomial mult​(BigIntPolynomial b)
        Description copied from interface: Polynomial
        Multiplies the polynomial by a BigIntPolynomial, taking the indices mod N. Does not change this polynomial but returns the result as a new polynomial.
        Both polynomials must have the same number of coefficients.
        Specified by:
        mult in interface Polynomial
        Parameters:
        b - the polynomial to multiply by
        Returns:
        a new polynomial
      • mult

        public IntegerPolynomial mult​(IntegerPolynomial poly2,
                                      int modulus)
        Description copied from interface: Polynomial
        Multiplies the polynomial by an IntegerPolynomial, taking the coefficient values mod modulus and the indices mod N.
        Specified by:
        mult in interface Polynomial
        Parameters:
        poly2 - a polynomial
        modulus - a modulus to apply
        Returns:
        the product of the two polynomials
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object