Class BigIntPoly

    • Constructor Detail

      • BigIntPoly

        public BigIntPoly​(int n)
        Constructor for an empty polynomial with initial capacity n.
        Parameters:
        n -
    • Method Detail

      • set

        public BigInteger set​(int n,
                              BigInteger value)
        Set a polynomial coefficient.
        Specified by:
        set in interface List<BigInteger>
        Overrides:
        set in class ArrayList<BigInteger>
        Parameters:
        n - the zero-based index of the coefficient. n=0 for the constant term. If the polynomial has not yet the degree to need this coefficient, the intermediate coefficients are implicitly set to zero.
        value - the new value of the coefficient.
      • multiply

        public BigIntPoly multiply​(BigIntPoly val)
        Multiply by another polynomial.
        Parameters:
        val - the other polynomial
        Returns:
        the product of this with the other polynomial
      • at

        public BigInteger at​(int n)
        Retrieve a polynomial coefficient.
        Parameters:
        n - the zero-based index of the coefficient. n=0 for the constant term.
        Returns:
        the polynomial coefficient in front of x^n.
      • degree

        public int degree()
        Returns:
        the polynomial degree.