Class DenseTernaryPolynomial

    • Constructor Detail

      • DenseTernaryPolynomial

        public DenseTernaryPolynomial​(IntegerPolynomial intPoly)
        Constructs a DenseTernaryPolynomial from a IntegerPolynomial. The two polynomials are independent of each other.
        Parameters:
        intPoly - the original polynomial
      • DenseTernaryPolynomial

        public DenseTernaryPolynomial​(int[] coeffs)
        Constructs a new DenseTernaryPolynomial with a given set of coefficients.
        Parameters:
        coeffs - the coefficients
    • Method Detail

      • generateRandom

        public static DenseTernaryPolynomial generateRandom​(int N,
                                                            int numOnes,
                                                            int numNegOnes,
                                                            java.security.SecureRandom random)
        Generates a random polynomial with numOnes coefficients equal to 1, numNegOnes coefficients equal to -1, and the rest equal to 0.
        Parameters:
        N - number of coefficients
        numOnes - number of 1's
        numNegOnes - number of -1's
      • generateRandom

        public static DenseTernaryPolynomial generateRandom​(int N,
                                                            java.security.SecureRandom random)
        Generates a polynomial with coefficients randomly selected from {-1, 0, 1}.
        Parameters:
        N - number of coefficients
      • size

        public int size()
        Description copied from interface: TernaryPolynomial
        Returns the maximum number of coefficients the polynomial can have
        Specified by:
        size in interface TernaryPolynomial