Class SymbolicPolynomialRing

    • Field Detail

      • coFac

        public final ExprRingFactory coFac
        The factory for the coefficients.
      • nvar

        public final int nvar
        The number of variables.
      • partial

        protected boolean partial
        True for partially reversed variables.
      • vars

        protected IAST vars
        The names of the variables. This value can be modified.
      • evzero

        public final ExpVectorSymbolic evzero
        The constant exponent vector 0 for this ring.
      • random

        protected static final ThreadLocalRandom random
        A default random sequence generator.
      • isField

        protected int isField
        Indicator if this ring is a field.
    • Constructor Detail

      • SymbolicPolynomialRing

        public SymbolicPolynomialRing​(IAST listOfVariables)
        The constructor creates a polynomial factory object.
        Parameters:
        listOfVariables - names for the variables.
      • SymbolicPolynomialRing

        public SymbolicPolynomialRing​(IAST listOfVariables,
                                      SymbolicTermOrder t)
        The constructor creates a polynomial factory object.
        Parameters:
        listOfVariables - names for the variables.
        t - a term order.
      • SymbolicPolynomialRing

        public SymbolicPolynomialRing​(ISymbol symbol)
        The constructor creates a polynomial factory object.
        Parameters:
        symbol - name of a variable.
      • SymbolicPolynomialRing

        public SymbolicPolynomialRing​(ISymbol symbol,
                                      SymbolicTermOrder t)
        The constructor creates a polynomial factory object.
        Parameters:
        symbol - name of a variable.
        t - a term order.
      • SymbolicPolynomialRing

        public SymbolicPolynomialRing​(ExprRingFactory cf,
                                      IAST listOfVariables)
        The constructor creates a polynomial factory object.
        Parameters:
        cf - factory for coefficients of type C.
        listOfVariables - names for the variables.
      • SymbolicPolynomialRing

        public SymbolicPolynomialRing​(ExprRingFactory cf,
                                      IAST listOfVariables,
                                      SymbolicTermOrder t)
        The constructor creates a polynomial factory object.
        Parameters:
        cf - factory for coefficients of type C.
        listOfVariables - names for the variables.
        t - a term order.
      • SymbolicPolynomialRing

        public SymbolicPolynomialRing​(ExprRingFactory cf,
                                      IAST listOfVariables,
                                      int n,
                                      SymbolicTermOrder t,
                                      boolean numericFunction)
        The constructor creates a polynomial factory object.
        Parameters:
        cf - factory for coefficients of type C.
        listOfVariables - names for the variables.
        n - number of variables.
        t - a term order.
        numericFunction -
      • SymbolicPolynomialRing

        public SymbolicPolynomialRing​(ExprRingFactory cf,
                                      SymbolicPolynomialRing o)
        The constructor creates a polynomial factory object with the the same term order, number of variables and variable names as the given polynomial factory, only the coefficient factories differ.
        Parameters:
        cf - factory for coefficients of type C.
        o - other polynomial ring.
      • SymbolicPolynomialRing

        public SymbolicPolynomialRing​(SymbolicPolynomialRing o,
                                      SymbolicTermOrder to)
        The constructor creates a polynomial factory object with the the same coefficient factory, number of variables and variable names as the given polynomial factory, only the term order differs.
        Parameters:
        to - term order.
        o - other polynomial ring.
    • Method Detail

      • create

        public SymbolicPolynomial create​(IExpr exprPoly,
                                         boolean coefficient,
                                         boolean checkNegativeExponents,
                                         boolean coefficientListMode)
                                  throws ArithmeticException,
                                         ClassCastException
        Create a Polynomial from the given exprPoly.
        Parameters:
        exprPoly - the polynomial expression
        coefficient - set to true if called by the Coefficient() function
        checkNegativeExponents - if true don't allow negative exponents and throw an ArithmeticException
        coefficientListMode - if in coefficient list mode don't collect negative Power() exponents
        Returns:
        Throws:
        ArithmeticException
        ClassCastException
      • create

        public static Map<IExpr,​IExpr> create​(IExpr exprPoly,
                                                    IExpr x,
                                                    Map<IExpr,​IExpr> coefficientMap,
                                                    IASTAppendable restList)
                                             throws ArithmeticException
        Create the coefficients of the (univariate) polynomial in coefficientMap and append non-polynomial terms to restList
        Parameters:
        exprPoly - the polynomial expression
        x - the variable x
        coefficientMap - the map of exponents to the associated coefficients
        restList - the terms which are non-polynomial
        Returns:
        Throws:
        ArithmeticException
      • isPolynomial

        public boolean isPolynomial​(IExpr expression,
                                    boolean coefficient)
                             throws ArithmeticException,
                                    ClassCastException
        Create a Polynomial from the given exprPoly.
        Parameters:
        expression - the expression which should be checked if it's a polynomial
        coefficient - set to true if called by the Coefficient() function
        Returns:
        true if the given expression is a polynomial
        Throws:
        ArithmeticException
        ClassCastException
      • toScript

        public String toScript()
        Get a scripting compatible string representation.
        Specified by:
        toScript in interface edu.jas.structure.ElemFactory<SymbolicPolynomial>
        Returns:
        script compatible representation for this Element.
        See Also:
        Element.toScript()
      • toScript

        public String toScript​(ExpVectorSymbolic e)
        Get a scripting compatible string representation of an ExpVectorLong of this ring.
        Parameters:
        e - exponent vector
        Returns:
        script compatible representation for the ExpVectorLong.
      • getVars

        public IAST getVars()
        Get the variable names.
        Returns:
        vars.
      • setVars

        public IAST setVars​(IAST v)
        Set the variable names.
        Returns:
        old vars.
      • varsToString

        public String varsToString()
        Get a String representation of the variable names.
        Returns:
        names seperated by commas.
      • getZEROCoefficient

        public IExpr getZEROCoefficient()
        Get the zero element from the coefficients.
        Returns:
        0 as C.
      • getONECoefficient

        public IExpr getONECoefficient()
        Get the one element from the coefficients.
        Returns:
        1 as C.
      • getZero

        public SymbolicPolynomial getZero()
        Get the zero element.
        Returns:
        0 as GenPolynomial.
      • getOne

        public SymbolicPolynomial getOne()
        Get the one element.
        Returns:
        1 as GenPolynomial.
      • isCommutative

        public boolean isCommutative()
        Query if this ring is commutative.
        Specified by:
        isCommutative in interface edu.jas.structure.MonoidFactory<SymbolicPolynomial>
        Returns:
        true if this ring is commutative, else false.
      • isAssociative

        public boolean isAssociative()
        Query if this ring is associative.
        Specified by:
        isAssociative in interface edu.jas.structure.MonoidFactory<SymbolicPolynomial>
        Returns:
        true if this ring is associative, else false.
      • isField

        public boolean isField()
        Query if this ring is a field.
        Specified by:
        isField in interface edu.jas.structure.RingFactory<SymbolicPolynomial>
        Returns:
        false.
      • characteristic

        public BigInteger characteristic()
        Characteristic of this ring.
        Specified by:
        characteristic in interface edu.jas.structure.RingFactory<SymbolicPolynomial>
        Returns:
        characteristic of this ring.
      • valueOf

        public SymbolicPolynomial valueOf​(IExpr a)
        Get a (constant) GenPolynomial<C> element from a coefficient value.
        Parameters:
        a - coefficient.
        Returns:
        a GenPolynomial<C>.
      • valueOf

        public SymbolicPolynomial valueOf​(ExpVectorSymbolic e)
        Get a GenPolynomial<C> element from an exponent vector.
        Parameters:
        e - exponent vector.
        Returns:
        a GenPolynomial<C>.
      • valueOf

        public SymbolicPolynomial valueOf​(IExpr a,
                                          ExpVectorSymbolic e)
        Get a GenPolynomial<C> element from a coeffcient and an exponent vector.
        Parameters:
        a - coefficient.
        e - exponent vector.
        Returns:
        a GenPolynomial<C>.
      • fromInteger

        public SymbolicPolynomial fromInteger​(long a)
        Get a (constant) GenPolynomial<C> element from a long value.
        Specified by:
        fromInteger in interface edu.jas.structure.ElemFactory<SymbolicPolynomial>
        Parameters:
        a - long.
        Returns:
        a GenPolynomial<C>.
      • fromInteger

        public SymbolicPolynomial fromInteger​(BigInteger a)
        Get a (constant) GenPolynomial<C> element from a BigInteger value.
        Specified by:
        fromInteger in interface edu.jas.structure.ElemFactory<SymbolicPolynomial>
        Parameters:
        a - BigInteger.
        Returns:
        a GenPolynomial<C>.
      • univariate

        public SymbolicPolynomial univariate​(int i)
        Generate univariate polynomial in a given variable.
        Parameters:
        i - the index of the variable.
        Returns:
        X_i as univariate polynomial.
      • univariate

        public SymbolicPolynomial univariate​(int i,
                                             IExpr e)
        Generate univariate polynomial in a given variable with given exponent.
        Parameters:
        i - the index of the variable.
        e - the exponent of the variable.
        Returns:
        X_i^e as univariate polynomial.
      • univariate

        public SymbolicPolynomial univariate​(int modv,
                                             int i,
                                             IExpr e)
        Generate univariate polynomial in a given variable with given exponent.
        Parameters:
        modv - number of module variables.
        i - the index of the variable.
        e - the exponent of the variable.
        Returns:
        X_i^e as univariate polynomial.
      • getGenerators

        public List<SymbolicPolynomial> getGenerators()
        Get the generating elements excluding the generators for the coefficient ring.
        Returns:
        a list of generating elements for this ring.
      • generators

        public List<SymbolicPolynomial> generators()
        Get a list of the generating elements.
        Specified by:
        generators in interface edu.jas.structure.ElemFactory<SymbolicPolynomial>
        Returns:
        list of generators for the algebraic structure.
        See Also:
        ElemFactory.generators()
      • generators

        public List<SymbolicPolynomial> generators​(int modv)
        Get a list of the generating elements excluding the module variables.
        Parameters:
        modv - number of module variables
        Returns:
        list of generators for the polynomial ring.
      • isFinite

        public boolean isFinite()
        Is this structure finite or infinite.
        Specified by:
        isFinite in interface edu.jas.structure.ElemFactory<SymbolicPolynomial>
        Returns:
        true if this structure is finite, else false.
        See Also:
        ElemFactory.isFinite()
      • univariateList

        public List<? extends SymbolicPolynomial> univariateList()
        Generate list of univariate polynomials in all variables.
        Returns:
        List(X_1,...,X_n) a list of univariate polynomials.
      • univariateList

        public List<? extends SymbolicPolynomial> univariateList​(int modv)
        Generate list of univariate polynomials in all variables.
        Parameters:
        modv - number of module variables.
        Returns:
        List(X_1,...,X_n) a list of univariate polynomials.
      • univariateList

        public List<? extends SymbolicPolynomial> univariateList​(int modv,
                                                                 IExpr e)
        Generate list of univariate polynomials in all variables with given exponent.
        Parameters:
        modv - number of module variables.
        e - the exponent of the variables.
        Returns:
        List(X_1^e,...,X_n^e) a list of univariate polynomials.
      • extend

        public SymbolicPolynomialRing extend​(IAST vn)
        Extend variables. Used e.g. in module embedding. Extend number of variables by length(vn).
        Parameters:
        vn - names for extended variables.
        Returns:
        extended polynomial ring factory.
      • getComparator

        public org.matheclipse.core.polynomials.symbolicexponent.SymbolicPolynomialRing.SymbolicPolynomialComparator getComparator()
        Get PolynomialComparator.
        Returns:
        polynomial comparator.
      • getComparator

        public org.matheclipse.core.polynomials.symbolicexponent.SymbolicPolynomialRing.SymbolicPolynomialComparator getComparator​(boolean rev)
        Get PolynomialComparator.
        Parameters:
        rev - for reverse comparator.
        Returns:
        polynomial comparator.
      • permuteVars

        public static String[] permuteVars​(List<Integer> P,
                                           String[] vars)
        Permute variable names.
        Parameters:
        vars - variable names.
        P - permutation.
        Returns:
        P(vars).
      • iterator

        public Iterator<SymbolicPolynomial> iterator()
        Get a GenPolynomial iterator.
        Returns:
        an iterator over all polynomials.