Class PolyUtilApp<C extends RingElem<C>>

  • Type Parameters:
    C - coefficient type

    public class PolyUtilApp<C extends RingElem<C>>
    extends java.lang.Object
    Polynomial utilities for applications, for example conversion ExpVector to Product or zero dimensional ideal root computation.
    • Field Detail

      • logger

        private static final org.apache.logging.log4j.Logger logger
      • debug

        private static final boolean debug
    • Constructor Detail

      • PolyUtilApp

        public PolyUtilApp()
    • Method Detail

      • toProductRes

        public static <C extends GcdRingElem<C>> Product<Residue<C>> toProductRes​(ProductRing<Residue<C>> pfac,
                                                                                  GenPolynomial<C> c)
        Product representation.
        Type Parameters:
        C - coefficient type.
        Parameters:
        pfac - product ring factory.
        c - coefficient to be represented.
        Returns:
        Product representation of c in the ring pfac.
      • toProductRes

        public static <C extends GcdRingElem<C>> java.util.List<GenPolynomial<Product<Residue<C>>>> toProductRes​(java.util.List<ColoredSystem<C>> CS)
        Product residue representation.
        Type Parameters:
        C - coefficient type.
        Parameters:
        CS - list of ColoredSystems from comprehensive GB system.
        Returns:
        Product residue representation of CS.
      • fromProduct

        public static <C extends GcdRingElem<C>> java.util.List<GenPolynomial<GenPolynomial<C>>> fromProduct​(GenPolynomialRing<GenPolynomial<C>> pfac,
                                                                                                             java.util.List<GenPolynomial<Product<Residue<C>>>> L,
                                                                                                             int i)
        From product representation.
        Type Parameters:
        C - coefficient type.
        Parameters:
        pfac - polynomial ring factory.
        L - list of polynomials to be converted from product representation.
        i - index of product representation to be taken.
        Returns:
        Representation of i-slice of L in the polynomial ring pfac.
      • fromProduct

        public static <C extends GcdRingElem<C>> GenPolynomial<GenPolynomial<C>> fromProduct​(GenPolynomialRing<GenPolynomial<C>> pfac,
                                                                                             GenPolynomial<Product<Residue<C>>> P,
                                                                                             int i)
        From product representation.
        Type Parameters:
        C - coefficient type.
        Parameters:
        pfac - polynomial ring factory.
        P - polynomial to be converted from product representation.
        i - index of product representation to be taken.
        Returns:
        Representation of i-slice of P in the polynomial ring pfac.
      • productSliceToString

        public static <C extends GcdRingElem<C>> java.lang.String productSliceToString​(java.util.Map<Ideal<C>,​PolynomialList<GenPolynomial<C>>> L)
        Product slice to String.
        Type Parameters:
        C - coefficient type.
        Parameters:
        L - list of polynomials with to be represented.
        Returns:
        Product representation of L in the polynomial ring pfac.
      • productToString

        public static <C extends GcdRingElem<C>> java.lang.String productToString​(PolynomialList<Product<Residue<C>>> L)
        Product slice to String.
        Type Parameters:
        C - coefficient type.
        Parameters:
        L - list of polynomials with product coefficients.
        Returns:
        string representation of slices of L.
      • complexRootTuples

        public static <D extends GcdRingElem<D> & Rational> java.util.List<java.util.List<Complex<BigDecimal>>> complexRootTuples​(Ideal<D> I,
                                                                                                                                  BigRational eps)
        Construct superset of complex roots for zero dimensional ideal(G).
        Parameters:
        I - zero dimensional ideal.
        eps - desired precision.
        Returns:
        list of coordinates of complex roots for ideal(G)
      • complexRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<java.util.List<Complex<BigDecimal>>> complexRoots​(Ideal<D> I,
                                                                                                                             java.util.List<GenPolynomial<D>> univs,
                                                                                                                             BigRational eps)
        Construct superset of complex roots for zero dimensional ideal(G).
        Parameters:
        I - zero dimensional ideal.
        univs - list of univariate polynomials.
        eps - desired precision.
        Returns:
        list of coordinates of complex roots for ideal(G)
      • complexRootTuples

        public static <D extends GcdRingElem<D> & Rational> java.util.List<java.util.List<Complex<BigDecimal>>> complexRootTuples​(java.util.List<IdealWithUniv<D>> Il,
                                                                                                                                  BigRational eps)
        Construct superset of complex roots for zero dimensional ideal(G).
        Parameters:
        Il - list of zero dimensional ideals with univariate polynomials.
        eps - desired precision.
        Returns:
        list of coordinates of complex roots for ideal(cap_i(G_i))
      • complexRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<IdealWithComplexRoots<D>> complexRoots​(java.util.List<IdealWithUniv<D>> Il,
                                                                                                                  BigRational eps)
        Construct superset of complex roots for zero dimensional ideal(G).
        Parameters:
        Il - list of zero dimensional ideals with univariate polynomials.
        eps - desired precision.
        Returns:
        list of ideals with coordinates of complex roots for ideal(cap_i(G_i))
      • complexRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<IdealWithComplexRoots<D>> complexRoots​(Ideal<D> G,
                                                                                                                  BigRational eps)
        Construct superset of complex roots for zero dimensional ideal(G).
        Parameters:
        G - list of polynomials of a of zero dimensional ideal.
        eps - desired precision.
        Returns:
        list of ideals with coordinates of complex roots for ideal(G)
      • realRootTuples

        public static <D extends GcdRingElem<D> & Rational> java.util.List<java.util.List<BigDecimal>> realRootTuples​(Ideal<D> I,
                                                                                                                      BigRational eps)
        Construct superset of real roots for zero dimensional ideal(G).
        Parameters:
        I - zero dimensional ideal.
        eps - desired precision.
        Returns:
        list of coordinates of real roots for ideal(G)
      • realRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<java.util.List<BigDecimal>> realRoots​(Ideal<D> I,
                                                                                                                 java.util.List<GenPolynomial<D>> univs,
                                                                                                                 BigRational eps)
        Construct superset of real roots for zero dimensional ideal(G).
        Parameters:
        I - zero dimensional ideal.
        univs - list of univariate polynomials.
        eps - desired precision.
        Returns:
        list of coordinates of real roots for ideal(G)
      • realRootTuples

        public static <D extends GcdRingElem<D> & Rational> java.util.List<java.util.List<BigDecimal>> realRootTuples​(java.util.List<IdealWithUniv<D>> Il,
                                                                                                                      BigRational eps)
        Construct superset of real roots for zero dimensional ideal(G).
        Parameters:
        Il - list of zero dimensional ideals with univariate polynomials.
        eps - desired precision.
        Returns:
        list of coordinates of real roots for ideal(cap_i(G_i))
      • realRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<IdealWithRealRoots<D>> realRoots​(java.util.List<IdealWithUniv<D>> Il,
                                                                                                            BigRational eps)
        Construct superset of real roots for zero dimensional ideal(G).
        Parameters:
        Il - list of zero dimensional ideals with univariate polynomials.
        eps - desired precision.
        Returns:
        list of ideals with coordinates of real roots for ideal(cap_i(G_i))
      • realRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<IdealWithRealRoots<D>> realRoots​(Ideal<D> G,
                                                                                                            BigRational eps)
        Construct superset of real roots for zero dimensional ideal(G).
        Parameters:
        G - list of polynomials of a of zero dimensional ideal.
        eps - desired precision.
        Returns:
        list of ideals with coordinates of real roots for ideal(G)
      • isRealRoots

        public static boolean isRealRoots​(java.util.List<GenPolynomial<BigDecimal>> L,
                                          java.util.List<java.util.List<BigDecimal>> roots,
                                          BigDecimal eps)
        Test for real roots of zero dimensional ideal(L).
        Parameters:
        L - list of polynomials.
        roots - list of real roots for ideal(G).
        eps - desired precision.
        Returns:
        true if root is a list of coordinates of real roots for ideal(L)
      • isComplexRoots

        public static boolean isComplexRoots​(java.util.List<GenPolynomial<Complex<BigDecimal>>> L,
                                             java.util.List<java.util.List<Complex<BigDecimal>>> roots,
                                             BigDecimal eps)
        Test for complex roots of zero dimensional ideal(L).
        Parameters:
        L - list of polynomials.
        roots - list of complex roots for ideal(L).
        eps - desired precision.
        Returns:
        true if root is a list of coordinates of complex roots for ideal(L)
      • realAlgebraicRoots

        public static <D extends GcdRingElem<D> & RationalIdealWithRealAlgebraicRoots<D> realAlgebraicRoots​(IdealWithUniv<D> I)
        Construct real roots for zero dimensional ideal(G).
        Parameters:
        I - zero dimensional ideal with univariate irreducible polynomials and bi-variate polynomials.
        Returns:
        real algebraic roots for ideal(G)
      • realAlgebraicRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<IdealWithRealAlgebraicRoots<D>> realAlgebraicRoots​(java.util.List<IdealWithUniv<D>> I)
        Construct real roots for zero dimensional ideal(G).
        Parameters:
        I - list of zero dimensional ideal with univariate irreducible polynomials and bi-variate polynomials.
        Returns:
        list of real algebraic roots for all ideal(I_i)
      • complexAlgebraicRoots

        public static <D extends GcdRingElem<D> & RationalIdealWithComplexAlgebraicRoots<D> complexAlgebraicRoots​(IdealWithUniv<D> I)
        Construct complex roots for zero dimensional ideal(G).
        Parameters:
        I - zero dimensional ideal with univariate irreducible polynomials and bi-variate polynomials.
        Returns:
        complex algebraic roots for ideal(G) Note: not jet completed in all cases.
      • toString

        public static <D extends GcdRingElem<D> & Rational> java.lang.String toString​(Complex<RealAlgebraicNumber<D>> c)
        String representation of a deximal approximation of a complex number.
        Parameters:
        c - compelx number.
        Returns:
        String representation of c
      • toString1

        public static <D extends GcdRingElem<D> & Rational> java.lang.String toString1​(Complex<D> c)
        String representation of a deximal approximation of a complex number.
        Parameters:
        c - compelx number.
        Returns:
        String representation of c
      • complexAlgebraicRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<IdealWithComplexAlgebraicRoots<D>> complexAlgebraicRoots​(java.util.List<IdealWithUniv<D>> I)
        Construct complex roots for zero dimensional ideal(G).
        Parameters:
        I - list of zero dimensional ideal with univariate irreducible polynomials and bi-variate polynomials.
        Returns:
        list of complex algebraic roots for ideal(G)
      • complexAlgebraicRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<IdealWithComplexAlgebraicRoots<D>> complexAlgebraicRoots​(Ideal<D> I)
        Construct exact set of complex roots for zero dimensional ideal(G).
        Parameters:
        I - zero dimensional ideal.
        Returns:
        list of coordinates of complex roots for ideal(G)
      • realAlgebraicRoots

        public static <D extends GcdRingElem<D> & Rational> java.util.List<IdealWithRealAlgebraicRoots<D>> realAlgebraicRoots​(Ideal<D> I)
        Construct exact set of real roots for zero dimensional ideal(G).
        Parameters:
        I - zero dimensional ideal.
        Returns:
        list of coordinates of real roots for ideal(G)
      • primitiveElement

        public static <C extends GcdRingElem<C>> PrimitiveElement<C> primitiveElement​(AlgebraicNumberRing<C> a,
                                                                                      AlgebraicNumberRing<C> b)
        Construct primitive element for double field extension.
        Parameters:
        a - algebraic number ring with squarefree monic minimal polynomial
        b - algebraic number ring with squarefree monic minimal polynomial
        Returns:
        primitive element container with algebraic number ring c, with Q(c) = Q(a,b)
      • convertToPrimitiveElem

        public static <C extends GcdRingElem<C>> AlgebraicNumber<C> convertToPrimitiveElem​(AlgebraicNumberRing<C> cfac,
                                                                                           AlgebraicNumber<C> A,
                                                                                           AlgebraicNumber<C> a)
        Convert to primitive element ring.
        Parameters:
        cfac - primitive element ring.
        A - algebraic number representing the generating element of a in the new ring.
        a - algebraic number to convert.
        Returns:
        a converted to the primitive element ring
      • convertToPrimitiveElem

        public static <C extends GcdRingElem<C>> GenPolynomial<AlgebraicNumber<C>> convertToPrimitiveElem​(AlgebraicNumberRing<C> cfac,
                                                                                                          AlgebraicNumber<C> A,
                                                                                                          GenPolynomial<AlgebraicNumber<C>> a)
        Convert coefficients to primitive element ring.
        Parameters:
        cfac - primitive element ring.
        A - algebraic number representing the generating element of a in the new ring.
        a - polynomial with coefficients algebraic number to convert.
        Returns:
        a with coefficients converted to the primitive element ring
      • primitiveElement

        public static <C extends GcdRingElem<C>> PrimitiveElement<C> primitiveElement​(AlgebraicNumberRing<AlgebraicNumber<C>> b)
        Construct primitive element for double field extension.
        Parameters:
        b - algebraic number ring with squarefree monic minimal polynomial over Q(a)
        Returns:
        primitive element container with algebraic number ring c, with Q(c) = Q(a)(b)