GenWordPolynomial
edu.jas.poly

Class GenWordPolynomial<C extends RingElem<C>>

    • Constructor Detail

      • GenWordPolynomial

        public GenWordPolynomial(GenWordPolynomialRing<C> r)
        Constructor for zero GenWordPolynomial.
        Parameters:
        r - polynomial ring factory.
      • GenWordPolynomial

        public GenWordPolynomial(GenWordPolynomialRing<C> r,                 C c,                 Word e)
        Constructor for GenWordPolynomial c * xe.
        Parameters:
        r - polynomial ring factory.
        c - coefficient.
        e - word.
      • GenWordPolynomial

        public GenWordPolynomial(GenWordPolynomialRing<C> r,                 C c)
        Constructor for GenWordPolynomial c * x0.
        Parameters:
        r - polynomial ring factory.
        c - coefficient.
      • GenWordPolynomial

        public GenWordPolynomial(GenWordPolynomialRing<C> r,                 Word e)
        Constructor for GenWordPolynomial xe.
        Parameters:
        r - polynomial ring factory.
        e - word.
    • Method Detail

      • length

        public int length()
        Length of GenWordPolynomial.
        Returns:
        number of coefficients of this GenWordPolynomial.
      • getMap

        public SortedMap<Word,C> getMap()
        Word to coefficient map of GenWordPolynomial.
        Returns:
        val as unmodifiable SortedMap.
      • doPutToMap

        public void doPutToMap(Word e,              C c)
        Put an Word to coefficient entry into the internal map of this GenWordPolynomial. Note: Do not use this method unless you are constructing a new polynomial. this is modified and breaks the immutability promise of this class.
        Parameters:
        c - coefficient.
        e - word.
      • doPutToMap

        public void doPutToMap(SortedMap<Word,C> vals)
        Put an a sorted map of words to coefficients into the internal map of this GenWordPolynomial. Note: Do not use this method unless you are constructing a new polynomial. this is modified and breaks the immutability promise of this class.
        Parameters:
        vals - sorted map of wordss and coefficients.
      • isConstant

        public boolean isConstant()
        Is GenWordPolynomial<C> a constant.
        Returns:
        If this is a constant polynomial then true is returned, else false.
      • isHomogeneous

        public boolean isHomogeneous()
        Is GenWordPolynomial<C> homogeneous.
        Returns:
        true, if this is homogeneous, else false.
      • numberOfVariables

        public int numberOfVariables()
        Number of variables.
        Returns:
        ring.alphabet.length().
      • leadingMonomial

        public Map.Entry<Word,C> leadingMonomial()
        Leading monomial.
        Returns:
        first map entry.
      • leadingWord

        public Word leadingWord()
        Leading word.
        Returns:
        first highest word.
      • trailingWord

        public Word trailingWord()
        Trailing word.
        Returns:
        last lowest word.
      • leadingBaseCoefficient

        public C leadingBaseCoefficient()
        Leading base coefficient.
        Returns:
        first coefficient.
      • trailingBaseCoefficient

        public C trailingBaseCoefficient()
        Trailing base coefficient.
        Returns:
        coefficient of constant term.
      • coefficient

        public C coefficient(Word e)
        Coefficient.
        Parameters:
        e - word.
        Returns:
        coefficient for given word.
      • degree

        public long degree()
        Maximal degree.
        Returns:
        maximal degree in any variables.
      • maxNorm

        public C maxNorm()
        GenWordPolynomial maximum norm.
        Returns:
        ||this||.
      • sumNorm

        public C sumNorm()
        GenWordPolynomial sum norm.
        Returns:
        sum of all absolute values of coefficients.
      • sum

        public GenWordPolynomial<C> sum(C a,                       Word e)
        GenWordPolynomial addition. This method is not very efficient, since this is copied.
        Parameters:
        a - coefficient.
        e - word.
        Returns:
        this + a e.
      • sum

        public GenWordPolynomial<C> sum(C a)
        GenWordPolynomial addition. This method is not very efficient, since this is copied.
        Parameters:
        a - coefficient.
        Returns:
        this + a x0.
      • subtract

        public GenWordPolynomial<C> subtract(C a,                            Word e)
        GenWordPolynomial subtraction. This method is not very efficient, since this is copied.
        Parameters:
        a - coefficient.
        e - word.
        Returns:
        this - a e.
      • subtract

        public GenWordPolynomial<C> subtract(C a)
        GenWordPolynomial subtract. This method is not very efficient, since this is copied.
        Parameters:
        a - coefficient.
        Returns:
        this + a x0.
      • multiply

        public GenWordPolynomial<C> multiply(C s)
        GenWordPolynomial multiplication. Product with coefficient ring element.
        Parameters:
        s - coefficient.
        Returns:
        this*s.
      • multiply

        public GenWordPolynomial<C> multiply(C s,                            C t)
        GenWordPolynomial multiplication. Product with coefficient ring element.
        Parameters:
        s - coefficient.
        t - coefficient.
        Returns:
        s*this*t.
      • monic

        public GenWordPolynomial<C> monic()
        GenWordPolynomial monic, i.e. leadingCoefficient == 1. If leadingCoefficient is not invertible returns this unmodified.
        Returns:
        monic(this).
      • multiply

        public GenWordPolynomial<C> multiply(C s,                            Word e)
        GenWordPolynomial multiplication. Product with ring element and word.
        Parameters:
        s - coefficient.
        e - left word.
        Returns:
        this * s e.
      • multiply

        public GenWordPolynomial<C> multiply(Word e,                            Word f)
        GenWordPolynomial left and right multiplication. Product with ring element and two words.
        Parameters:
        e - left word.
        f - right word.
        Returns:
        e * this * f.
      • multiply

        public GenWordPolynomial<C> multiply(C s,                            Word e,                            Word f)
        GenWordPolynomial left and right multiplication. Product with ring element and two words.
        Parameters:
        s - coefficient.
        e - left word.
        f - right word.
        Returns:
        e * this * s * f.
      • multiply

        public GenWordPolynomial<C> multiply(C s,                            Word e,                            C t,                            Word f)
        GenWordPolynomial left and right multiplication. Product with ring element and two words.
        Parameters:
        s - coefficient.
        e - left word.
        t - coefficient.
        f - right word.
        Returns:
        s * e * this * t * f.
      • multiply

        public GenWordPolynomial<C> multiply(Word e)
        GenWordPolynomial multiplication. Product with word.
        Parameters:
        e - word (!= null).
        Returns:
        this * e.
      • multiply

        public GenWordPolynomial<C> multiply(Map.Entry<Word,C> m)
        GenWordPolynomial multiplication. Product with 'monomial'.
        Parameters:
        m - 'monomial'.
        Returns:
        this * m.
      • divide

        public GenWordPolynomial<C> divide(C s)
        GenWordPolynomial division. Division by coefficient ring element. Fails, if exact division is not possible.
        Parameters:
        s - coefficient.
        Returns:
        this/s.
      • hegcd

        public GenWordPolynomial<C>[] hegcd(GenWordPolynomial<C> S)
        GenWordPolynomial half extended greatest comon divisor. Only for univariate polynomials over fields.
        Parameters:
        S - GenWordPolynomial.
        Returns:
        [ gcd(this,S), a ] with a*this + b*S = gcd(this,S).
      • modInverse

        public GenWordPolynomial<C> modInverse(GenWordPolynomial<C> m)
        GenWordPolynomial modular inverse. Only for univariate polynomials over fields.
        Parameters:
        m - GenWordPolynomial.
        Returns:
        a with with a*this = 1 mod m.
      • coefficientIterator

        public Iterator<C> coefficientIterator()
        Iterator over coefficients.
        Returns:
        val.values().iterator().
      • wordIterator

        public Iterator<Word> wordIterator()
        Iterator over words.
        Returns:
        val.keySet().iterator().
      • map

        public GenWordPolynomial<C> map(UnaryFunctor<? super C,C> f)
        Map a unary function to the coefficients.
        Parameters:
        f - evaluation functor.
        Returns:
        new polynomial with coefficients f(this(e)).

SCaVis 2.0 © jWork.ORG