Package edu.jas.poly

Class GenExteriorPolynomial<C extends RingElem<C>>

    • Method Detail

      • length

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

        public java.util.SortedMap<IndexList,​CgetMap()
        IndexList to coefficient map of GenExteriorPolynomial.
        Returns:
        val as unmodifiable SortedMap.
      • doPutToMap

        public void doPutToMap​(IndexList e,
                               C c)
        Put a IndexList to coefficient entry into the internal map of this GenExteriorPolynomial. 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 - index list.
      • doRemoveFromMap

        public void doRemoveFromMap​(IndexList e,
                                    C c)
        Remove a IndexList to coefficient entry from the internal map of this GenExteriorPolynomial. 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:
        e - IndexList.
        c - expected coefficient, null for ignore.
      • doPutToMap

        public void doPutToMap​(java.util.SortedMap<IndexList,​C> vals)
        Put an a sorted map of index list to coefficients into the internal map of this GenExteriorPolynomial. 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 index list and coefficients.
      • toString

        public java.lang.String toString()
        String representation of GenExteriorPolynomial.
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • toScript

        public java.lang.String toScript()
        Get a scripting compatible string representation.
        Specified by:
        toScript in interface Element<C extends RingElem<C>>
        Returns:
        script compatible representation for this Element.
        See Also:
        Element.toScript()
      • isConstant

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

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

        public GenExteriorPolynomial<Cform​(long k)
        k-form part.
        Parameters:
        k - requested k-form part.
        Returns:
        k-form part of given degree of this.
      • homogeneousPart

        public GenExteriorPolynomial<ChomogeneousPart​(long tdeg)
        Homogeneous part.
        Parameters:
        tdeg - requested degree of part.
        Returns:
        polynomial part of given degree.
      • equals

        public boolean equals​(java.lang.Object B)
        Comparison with any other object.
        Specified by:
        equals in interface Element<C extends RingElem<C>>
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to b, else false.
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Hash code for this polynomial.
        Specified by:
        hashCode in interface Element<C extends RingElem<C>>
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hashCode.
        See Also:
        Object.hashCode()
      • numberOfVariables

        public int numberOfVariables()
        Number of variables.
        Returns:
        ring.ixfac.length().
      • trailingBaseCoefficient

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

        public C coefficient​(IndexList e)
        Coefficient.
        Parameters:
        e - index list.
        Returns:
        coefficient for given index list.
      • degree

        public long degree()
        Index degree.
        Returns:
        maximal length of indexes.
      • maxDegree

        public long maxDegree()
        Index maximal degree.
        Returns:
        maximal degree of indexes.
      • maxNorm

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

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

        public GenExteriorPolynomial<Csum​(C a,
                                            IndexList e)
        GenExteriorPolynomial addition. This method is not very efficient, since this is copied.
        Parameters:
        a - coefficient.
        e - index list.
        Returns:
        this + a e.
      • sum

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

        public GenExteriorPolynomial<Csubtract​(C a,
                                                 IndexList e)
        GenExteriorPolynomial subtraction. This method is not very efficient, since this is copied.
        Parameters:
        a - coefficient.
        e - index list.
        Returns:
        this - a e.
      • subtract

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

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

        public GenExteriorPolynomial<Cmultiply​(C s,
                                                 C t)
        GenExteriorPolynomial multiplication. Product with coefficient ring element.
        Parameters:
        s - coefficient.
        t - coefficient.
        Returns:
        s*this*t.
      • monic

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

        public GenExteriorPolynomial<Cmultiply​(C s,
                                                 IndexList e)
        GenExteriorPolynomial multiplication. Product with ring element and index list.
        Parameters:
        s - coefficient.
        e - left index list.
        Returns:
        this * s e.
      • multiply

        public GenExteriorPolynomial<Cmultiply​(IndexList e,
                                                 IndexList f)
        GenExteriorPolynomial left and right multiplication. Product with ring element and two index lists.
        Parameters:
        e - left index list.
        f - right index list.
        Returns:
        e * this * f.
      • multiply

        public GenExteriorPolynomial<Cmultiply​(C s,
                                                 IndexList e,
                                                 IndexList f)
        GenExteriorPolynomial left and right multiplication. Product with ring element and two index lists.
        Parameters:
        s - coefficient.
        e - left index list.
        f - right index list.
        Returns:
        e * this * s * f.
      • multiply

        public GenExteriorPolynomial<Cmultiply​(C s,
                                                 IndexList e,
                                                 C t,
                                                 IndexList f)
        GenExteriorPolynomial left and right multiplication. Product with ring element and two index lists.
        Parameters:
        s - coefficient.
        e - left index list.
        t - coefficient.
        f - right index list.
        Returns:
        s * e * this * t * f.
      • multiply

        public GenExteriorPolynomial<Cmultiply​(java.util.Map.Entry<IndexList,​C> m)
        GenExteriorPolynomial multiplication. Product with 'monomial'.
        Parameters:
        m - 'monomial'.
        Returns:
        this * m.
      • divide

        public GenExteriorPolynomial<Cdivide​(C s)
        GenExteriorPolynomial division. Division by coefficient ring element. Fails, if exact division is not possible.
        Parameters:
        s - coefficient.
        Returns:
        this/s.
      • quotientRemainder

        public GenExteriorPolynomial<C>[] quotientRemainder​(GenExteriorPolynomial<C> S)
        GenExteriorPolynomial division with remainder. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.
        Specified by:
        quotientRemainder in interface MonoidElem<C extends RingElem<C>>
        Parameters:
        S - nonzero GenExteriorPolynomial with invertible leading coefficient.
        Returns:
        [ quotient , remainder ] with this = quotient * S + remainder and deg(remainder) < deg(S) or remainder = 0.
        See Also:
        .
      • divide

        public GenExteriorPolynomial<Cdivide​(GenExteriorPolynomial<C> S)
        GenExteriorPolynomial division. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.
        Specified by:
        divide in interface MonoidElem<C extends RingElem<C>>
        Parameters:
        S - nonzero GenExteriorPolynomial with invertible leading coefficient.
        Returns:
        quotient with this = quotient * S + remainder.
        See Also:
        .
      • remainder

        public GenExteriorPolynomial<Cremainder​(GenExteriorPolynomial<C> S)
        GenExteriorPolynomial remainder. Fails, if exact division by leading base coefficient is not possible. Meaningful only for univariate polynomials over fields, but works in any case.
        Specified by:
        remainder in interface MonoidElem<C extends RingElem<C>>
        Parameters:
        S - nonzero GenExteriorPolynomial with invertible leading coefficient.
        Returns:
        remainder with this = quotient * S + remainder.
        See Also:
        .
      • shiftIndex

        public GenExteriorPolynomial<CshiftIndex​(int s)
        GenExteriorPolynomial shift index. Add number to each index.
        Parameters:
        s - shift index by this number.
        Returns:
        this.shift(s).
      • coefficientIterator

        public java.util.Iterator<CcoefficientIterator()
        Iterator over coefficients.
        Returns:
        val.values().iterator().
      • indexListIterator

        public java.util.Iterator<IndexListindexListIterator()
        Iterator over index lists.
        Returns:
        val.keySet().iterator().
      • iterator

        public java.util.Iterator<IndexListMonomial<C>> iterator()
        Iterator over monomials.
        Specified by:
        iterator in interface java.lang.Iterable<C extends RingElem<C>>
        Returns:
        a PolyIterator.
      • map

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