edu.jas.poly
Class PolyUtil

java.lang.Object
  extended by edu.jas.poly.PolyUtil

public class PolyUtil
extends java.lang.Object

Polynomial utilities, for example conversion between different representations, evaluation and interpolation.

Author:
Heinz Kredel

Constructor Summary
PolyUtil()
           
 
Method Summary
static
<C extends GcdRingElem<C>>
GenPolynomial<AlgebraicNumber<C>>
algebraicFromComplex(GenPolynomialRing<AlgebraicNumber<C>> fac, GenPolynomial<Complex<C>> A)
          AlgebraicNumber from complex coefficients.
static
<C extends RingElem<C>>
GenPolynomial<C>
baseDeriviative(GenPolynomial<C> P)
          GenPolynomial polynomial derivative main variable.
static
<C extends RingElem<C>>
GenPolynomial<C>
baseDeriviative(GenPolynomial<C> P, int r)
          GenPolynomial polynomial partial derivative variable r.
static
<C extends RingElem<C>>
GenPolynomial<C>
baseIntegral(GenPolynomial<C> P)
          GenPolynomial polynomial integral main variable.
static
<C extends RingElem<C>>
GenPolynomial<C>
basePseudoDivide(GenPolynomial<C> P, GenPolynomial<C> S)
          GenPolynomial pseudo divide.
static
<C extends RingElem<C>>
GenPolynomial<C>[]
basePseudoQuotientRemainder(GenPolynomial<C> P, GenPolynomial<C> S)
          GenPolynomial pseudo quotient and remainder.
static
<C extends RingElem<C>>
GenPolynomial<C>
basePseudoRemainder(GenPolynomial<C> P, GenPolynomial<C> S)
          GenPolynomial sparse pseudo remainder.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
baseRecursiveDivide(GenPolynomial<GenPolynomial<C>> P, C s)
          GenPolynomial base divide.
static
<C extends RingElem<C>>
GenPolynomial<C>
baseRemainderPoly(GenPolynomial<C> P, C s)
          GenPolynomial coefficient wise remainder.
static
<C extends RingElem<C> & Modular>
GenPolynomial<C>
chineseRemainder(GenPolynomialRing<C> fac, GenPolynomial<C> A, C mi, GenPolynomial<C> B)
          ModInteger chinese remainder algorithm on coefficients.
static
<C extends RingElem<C>>
GenPolynomial<C>
coefficientBasePseudoDivide(GenPolynomial<C> P, C s)
          GenPolynomial pseudo divide.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
coefficientPseudoDivide(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<C> s)
          GenPolynomial pseudo divide.
static
<C extends RingElem<C>>
long
coeffMaxDegree(GenPolynomial<GenPolynomial<C>> A)
          Maximal degree in the coefficient polynomials.
static
<C extends RingElem<C> & Rational>
GenPolynomial<Complex<BigDecimal>>
complexDecimalFromRational(GenPolynomialRing<Complex<BigDecimal>> fac, GenPolynomial<Complex<C>> A)
          Convert to complex decimal coefficients.
static
<C extends GcdRingElem<C>>
GenPolynomial<Complex<C>>
complexFromAlgebraic(GenPolynomialRing<Complex<C>> fac, GenPolynomial<AlgebraicNumber<C>> A)
          Complex from algebraic coefficients.
static
<C extends GcdRingElem<C>>
GenPolynomial<Complex<C>>
complexFromAny(GenPolynomialRing<Complex<C>> fac, GenPolynomial<C> A)
          Complex from ring element coefficients.
static GenPolynomial<BigComplex> complexFromRational(GenPolynomialRing<BigComplex> fac, GenPolynomial<BigRational> A)
          Complex from rational coefficients.
static
<C extends GcdRingElem<C>>
GenPolynomial<AlgebraicNumber<C>>
convertRecursiveToAlgebraicCoefficients(GenPolynomialRing<AlgebraicNumber<C>> pfac, GenPolynomial<GenPolynomial<C>> A)
          Convert to AlgebraicNumber coefficients.
static
<C extends GcdRingElem<C>>
GenPolynomial<AlgebraicNumber<C>>
convertToAlgebraicCoefficients(GenPolynomialRing<AlgebraicNumber<C>> pfac, GenPolynomial<C> A)
          Convert to AlgebraicNumber coefficients.
static
<C extends GcdRingElem<C>>
GenPolynomial<AlgebraicNumber<C>>
convertToRecAlgebraicCoefficients(int depth, GenPolynomialRing<AlgebraicNumber<C>> pfac, GenPolynomial<C> A)
          Convert to recursive AlgebraicNumber coefficients.
static
<C extends RingElem<C> & Rational>
GenPolynomial<BigDecimal>
decimalFromRational(GenPolynomialRing<BigDecimal> fac, GenPolynomial<C> A)
          Convert to decimal coefficients.
static
<C extends RingElem<C>>
GenPolynomial<C>
distribute(GenPolynomialRing<C> dfac, GenPolynomial<GenPolynomial<C>> B)
          Distribute a recursive polynomial to a generic polynomial.
static
<C extends RingElem<C>>
java.util.List<GenPolynomial<C>>
distribute(GenPolynomialRing<C> dfac, java.util.List<GenPolynomial<GenPolynomial<C>>> L)
          Distribute a recursive polynomial list to a generic polynomial list.
static
<C extends RingElem<C>>
GenPolynomial<C>
evaluate(GenPolynomialRing<C> cfac, GenPolynomialRing<GenPolynomial<C>> rfac, GenPolynomialRing<GenPolynomial<C>> nfac, GenPolynomialRing<C> dfac, GenPolynomial<C> A, C a)
          Evaluate at k-th variable.
static
<C extends RingElem<C>>
C
evaluateAll(RingFactory<C> cfac, GenPolynomialRing<C> dfac, GenPolynomial<C> A, java.util.List<C> a)
          Evaluate all variables.
static
<C extends RingElem<C>>
GenPolynomial<C>
evaluateFirst(GenPolynomialRing<C> cfac, GenPolynomialRing<C> dfac, GenPolynomial<C> A, C a)
          Evaluate at first (lowest) variable.
static
<C extends RingElem<C>>
GenPolynomial<C>
evaluateFirstRec(GenPolynomialRing<C> cfac, GenPolynomialRing<C> dfac, GenPolynomial<GenPolynomial<C>> A, C a)
          Evaluate at first (lowest) variable.
static
<C extends RingElem<C>>
GenPolynomial<C>
evaluateMain(GenPolynomialRing<C> cfac, GenPolynomial<C> A, C a)
          Evaluate at main variable.
static
<C extends RingElem<C>>
java.util.List<GenPolynomial<C>>
evaluateMain(GenPolynomialRing<C> cfac, java.util.List<GenPolynomial<C>> L, C a)
          Evaluate at main variable.
static
<C extends RingElem<C>>
C
evaluateMain(RingFactory<C> cfac, GenPolynomial<C> A, C a)
          Evaluate at main variable.
static
<C extends RingElem<C>>
java.util.List<C>
evaluateMain(RingFactory<C> cfac, java.util.List<GenPolynomial<C>> L, C a)
          Evaluate at main variable.
static
<C extends RingElem<C>>
GenPolynomial<C>
evaluateMainRecursive(GenPolynomialRing<C> cfac, GenPolynomial<GenPolynomial<C>> A, C a)
          Evaluate at main variable.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
extendCoefficients(GenPolynomialRing<GenPolynomial<C>> pfac, GenPolynomial<GenPolynomial<C>> A, int j, long k)
          Extend coefficient variables.
static BigInteger factorBound(ExpVector e)
          Factor coefficient bound.
static
<C extends GcdRingElem<C>>
GenPolynomial<GenPolynomial<C>>
fromAlgebraicCoefficients(GenPolynomialRing<GenPolynomial<C>> rfac, GenPolynomial<AlgebraicNumber<C>> A)
          From AlgebraicNumber coefficients.
static
<C extends RingElem<C>>
GenPolynomial<C>
fromIntegerCoefficients(GenPolynomialRing<C> fac, GenPolynomial<BigInteger> A)
          From BigInteger coefficients.
static
<C extends RingElem<C>>
java.util.List<GenPolynomial<C>>
fromIntegerCoefficients(GenPolynomialRing<C> fac, java.util.List<GenPolynomial<BigInteger>> L)
          From BigInteger coefficients.
static GenPolynomial<BigRational> imaginaryPart(GenPolynomialRing<BigRational> fac, GenPolynomial<BigComplex> A)
          Imaginary part.
static
<C extends RingElem<C>>
GenPolynomial<C>
imaginaryPartFromComplex(GenPolynomialRing<C> fac, GenPolynomial<Complex<C>> A)
          Imaginary part.
static
<C extends RingElem<C> & Modular>
GenPolynomial<BigInteger>
integerFromModularCoefficients(GenPolynomialRing<BigInteger> fac, GenPolynomial<C> A)
          BigInteger from ModInteger coefficients, symmetric.
static
<C extends RingElem<C> & Modular>
java.util.List<GenPolynomial<BigInteger>>
integerFromModularCoefficients(GenPolynomialRing<BigInteger> fac, java.util.List<GenPolynomial<C>> L)
          BigInteger from ModInteger coefficients, symmetric.
static
<C extends RingElem<C> & Modular>
GenPolynomial<BigInteger>
integerFromModularCoefficientsPositive(GenPolynomialRing<BigInteger> fac, GenPolynomial<C> A)
          BigInteger from ModInteger coefficients, positive.
static GenPolynomial<BigInteger> integerFromRationalCoefficients(GenPolynomialRing<BigInteger> fac, GenPolynomial<BigRational> A)
          BigInteger from BigRational coefficients.
static java.util.List<GenPolynomial<BigInteger>> integerFromRationalCoefficients(GenPolynomialRing<BigInteger> fac, java.util.List<GenPolynomial<BigRational>> L)
          BigInteger from BigRational coefficients.
static java.lang.Object[] integerFromRationalCoefficientsFactor(GenPolynomialRing<BigInteger> fac, GenPolynomial<BigRational> A)
          BigInteger from BigRational coefficients.
static
<C extends RingElem<C>>
GenPolynomial<C>
interpolate(GenPolynomialRing<C> fac, GenPolynomial<C> A, GenPolynomial<C> M, C mi, C a, C am)
          Univariate polynomial interpolation.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
interpolate(GenPolynomialRing<GenPolynomial<C>> fac, GenPolynomial<GenPolynomial<C>> A, GenPolynomial<C> M, C mi, GenPolynomial<C> B, C am)
          ModInteger interpolate on first variable.
static
<C extends RingElem<C>>
java.util.List<ExpVector>
leadingExpVector(java.util.List<GenPolynomial<C>> L)
          Polynomial list leading exponent vectors.
static
<C extends RingElem<C>,D extends RingElem<D>>
GenPolynomial<D>
map(GenPolynomialRing<D> ring, GenPolynomial<C> p, UnaryFunctor<C,D> f)
          Map a unary function to the coefficients.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
monic(GenPolynomial<GenPolynomial<C>> p)
          GenPolynomial monic, i.e. leadingBaseCoefficient == 1.
static
<C extends RingElem<C>>
java.util.List<GenPolynomial<C>>
monic(java.util.List<GenPolynomial<C>> L)
          Polynomial list monic.
static GenPolynomial<BigRational> realPart(GenPolynomialRing<BigRational> fac, GenPolynomial<BigComplex> A)
          Real part.
static
<C extends RingElem<C>>
GenPolynomial<C>
realPartFromComplex(GenPolynomialRing<C> fac, GenPolynomial<Complex<C>> A)
          Real part.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
recursive(GenPolynomialRing<GenPolynomial<C>> rfac, GenPolynomial<C> A)
          Recursive representation.
static
<C extends RingElem<C>>
java.util.List<GenPolynomial<GenPolynomial<C>>>
recursive(GenPolynomialRing<GenPolynomial<C>> rfac, java.util.List<GenPolynomial<C>> L)
          Recursive representation.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
recursiveDeriviative(GenPolynomial<GenPolynomial<C>> P)
          GenPolynomial recursive polynomial derivative main variable.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
recursiveDivide(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<C> s)
          GenPolynomial pseudo divide.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
recursivePseudoDivide(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S)
          GenPolynomial pseudo divide.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
recursivePseudoRemainder(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S)
          GenPolynomial sparse pseudo remainder.
static
<C extends RingElem<C>>
GenPolynomial<C>
removeUnusedLowerVariables(GenPolynomial<C> p)
          Remove all lower variables, which do not occur in polynomial.
static
<C extends RingElem<C>>
GenPolynomial<C>
removeUnusedUpperVariables(GenPolynomial<C> p)
          Remove all upper variables, which do not occur in polynomial.
static
<C extends RingElem<C>>
GenPolynomial<C>
selectWithVariable(java.util.List<GenPolynomial<C>> P, int i)
          Select polynomial with univariate leading term in variable i.
static
<C extends RingElem<C>>
GenPolynomial<C>
seriesOfTaylor(GenPolynomial<C> f, C a)
          Taylor series for polynomial.
static
<C extends RingElem<C>>
GenPolynomial<C>
substituteMain(GenPolynomial<C> A, GenPolynomial<C> s)
          Substitute main variable.
static
<C extends RingElem<C>>
GenPolynomial<C>
substituteUnivariate(GenPolynomial<C> f, GenPolynomial<C> t)
          Substitute univariate polynomial.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
switchVariables(GenPolynomial<GenPolynomial<C>> P)
          Recursive GenPolynomial switch varaible blocks.
static
<C extends RingElem<C>>
GenPolynomial<Complex<C>>
toComplex(GenPolynomialRing<Complex<C>> fac, GenPolynomial<C> A)
          Complex from real polynomial.
static GenPolynomial<Product<ModInteger>> toProduct(GenPolynomialRing<Product<ModInteger>> pfac, GenPolynomial<BigInteger> A)
          Product representation.
static java.util.List<GenPolynomial<Product<ModInteger>>> toProduct(GenPolynomialRing<Product<ModInteger>> pfac, java.util.List<GenPolynomial<BigInteger>> L)
          Product representation.
static
<C extends RingElem<C>>
Product<GenPolynomial<C>>
toProduct(ProductRing<GenPolynomial<C>> pfac, C c, ExpVector e)
          Product representation.
static
<C extends RingElem<C>>
Product<GenPolynomial<C>>
toProduct(ProductRing<GenPolynomial<C>> pfac, GenPolynomial<C> A)
          Product representation.
static Product<ModInteger> toProduct(ProductRing<ModInteger> pfac, BigInteger c)
          Product representation.
static
<C extends GcdRingElem<C>>
GenPolynomial<Product<C>>
toProductGen(GenPolynomialRing<Product<C>> pfac, GenPolynomial<C> A)
          Product representation.
static
<C extends GcdRingElem<C>>
java.util.List<GenPolynomial<Product<C>>>
toProductGen(GenPolynomialRing<Product<C>> pfac, java.util.List<GenPolynomial<C>> L)
          Product representation.
static
<C extends GcdRingElem<C>>
Product<C>
toProductGen(ProductRing<C> pfac, C c)
          Product representation.
static
<C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>
toRecursive(GenPolynomialRing<GenPolynomial<C>> rfac, GenPolynomial<C> A)
          To recursive representation.
static
<C extends RingElem<C>>
long
totalDegree(java.util.List<GenPolynomial<C>> P)
          Maximal degree of polynomial list.
static
<C extends RingElem<C>>
long
totalDegreeLeadingTerm(java.util.List<GenPolynomial<C>> P)
          Maximal degree of leading terms of a polynomial list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolyUtil

public PolyUtil()
Method Detail

recursive

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursive(GenPolynomialRing<GenPolynomial<C>> rfac,
                                                                                GenPolynomial<C> A)
Recursive representation. Represent as polynomial in i variables with coefficients in n-i variables. Works for arbitrary term orders.

Type Parameters:
C - coefficient type.
Parameters:
rfac - recursive polynomial ring factory.
A - polynomial to be converted.
Returns:
Recursive represenations of this in the ring rfac.

distribute

public static <C extends RingElem<C>> GenPolynomial<C> distribute(GenPolynomialRing<C> dfac,
                                                                  GenPolynomial<GenPolynomial<C>> B)
Distribute a recursive polynomial to a generic polynomial. Works for arbitrary term orders.

Type Parameters:
C - coefficient type.
Parameters:
dfac - combined polynomial ring factory of coefficients and this.
B - polynomial to be converted.
Returns:
distributed polynomial.

recursive

public static <C extends RingElem<C>> java.util.List<GenPolynomial<GenPolynomial<C>>> recursive(GenPolynomialRing<GenPolynomial<C>> rfac,
                                                                                                java.util.List<GenPolynomial<C>> L)
Recursive representation. Represent as polynomials in i variables with coefficients in n-i variables. Works for arbitrary term orders.

Type Parameters:
C - coefficient type.
Parameters:
rfac - recursive polynomial ring factory.
L - list of polynomials to be converted.
Returns:
Recursive represenations of the list in the ring rfac.

distribute

public static <C extends RingElem<C>> java.util.List<GenPolynomial<C>> distribute(GenPolynomialRing<C> dfac,
                                                                                  java.util.List<GenPolynomial<GenPolynomial<C>>> L)
Distribute a recursive polynomial list to a generic polynomial list. Works for arbitrary term orders.

Type Parameters:
C - coefficient type.
Parameters:
dfac - combined polynomial ring factory of coefficients and this.
L - list of polynomials to be converted.
Returns:
distributed polynomial list.

integerFromModularCoefficients

public static <C extends RingElem<C> & Modular> GenPolynomial<BigInteger> integerFromModularCoefficients(GenPolynomialRing<BigInteger> fac,
                                                                                                        GenPolynomial<C> A)
BigInteger from ModInteger coefficients, symmetric. Represent as polynomial with BigInteger coefficients by removing the modules and making coefficients symmetric to 0.

Parameters:
fac - result polynomial factory.
A - polynomial with ModInteger coefficients to be converted.
Returns:
polynomial with BigInteger coefficients.

integerFromModularCoefficients

public static <C extends RingElem<C> & Modular> java.util.List<GenPolynomial<BigInteger>> integerFromModularCoefficients(GenPolynomialRing<BigInteger> fac,
                                                                                                                        java.util.List<GenPolynomial<C>> L)
BigInteger from ModInteger coefficients, symmetric. Represent as polynomial with BigInteger coefficients by removing the modules and making coefficients symmetric to 0.

Parameters:
fac - result polynomial factory.
L - list of polynomials with ModInteger coefficients to be converted.
Returns:
list of polynomials with BigInteger coefficients.

integerFromModularCoefficientsPositive

public static <C extends RingElem<C> & Modular> GenPolynomial<BigInteger> integerFromModularCoefficientsPositive(GenPolynomialRing<BigInteger> fac,
                                                                                                                GenPolynomial<C> A)
BigInteger from ModInteger coefficients, positive. Represent as polynomial with BigInteger coefficients by removing the modules.

Parameters:
fac - result polynomial factory.
A - polynomial with ModInteger coefficients to be converted.
Returns:
polynomial with BigInteger coefficients.

integerFromRationalCoefficients

public static GenPolynomial<BigInteger> integerFromRationalCoefficients(GenPolynomialRing<BigInteger> fac,
                                                                        GenPolynomial<BigRational> A)
BigInteger from BigRational coefficients. Represent as polynomial with BigInteger coefficients by multiplication with the lcm of the numerators of the BigRational coefficients.

Parameters:
fac - result polynomial factory.
A - polynomial with BigRational coefficients to be converted.
Returns:
polynomial with BigInteger coefficients.

integerFromRationalCoefficientsFactor

public static java.lang.Object[] integerFromRationalCoefficientsFactor(GenPolynomialRing<BigInteger> fac,
                                                                       GenPolynomial<BigRational> A)
BigInteger from BigRational coefficients. Represent as polynomial with BigInteger coefficients by multiplication with the gcd of the numerators and the lcm of the denominators of the BigRational coefficients.
Author: Axel Kramer

Parameters:
fac - result polynomial factory.
A - polynomial with BigRational coefficients to be converted.
Returns:
Object[] with 3 entries: [0]->gcd [1]->lcm and [2]->polynomial with BigInteger coefficients.

integerFromRationalCoefficients

public static java.util.List<GenPolynomial<BigInteger>> integerFromRationalCoefficients(GenPolynomialRing<BigInteger> fac,
                                                                                        java.util.List<GenPolynomial<BigRational>> L)
BigInteger from BigRational coefficients. Represent as list of polynomials with BigInteger coefficients by multiplication with the lcm of the numerators of the BigRational coefficients of each polynomial.

Parameters:
fac - result polynomial factory.
L - list of polynomials with BigRational coefficients to be converted.
Returns:
polynomial list with BigInteger coefficients.

fromIntegerCoefficients

public static <C extends RingElem<C>> GenPolynomial<C> fromIntegerCoefficients(GenPolynomialRing<C> fac,
                                                                               GenPolynomial<BigInteger> A)
From BigInteger coefficients. Represent as polynomial with type C coefficients, e.g. ModInteger or BigRational.

Type Parameters:
C - coefficient type.
Parameters:
fac - result polynomial factory.
A - polynomial with BigInteger coefficients to be converted.
Returns:
polynomial with type C coefficients.

fromIntegerCoefficients

public static <C extends RingElem<C>> java.util.List<GenPolynomial<C>> fromIntegerCoefficients(GenPolynomialRing<C> fac,
                                                                                               java.util.List<GenPolynomial<BigInteger>> L)
From BigInteger coefficients. Represent as list of polynomials with type C coefficients, e.g. ModInteger or BigRational.

Type Parameters:
C - coefficient type.
Parameters:
fac - result polynomial factory.
L - list of polynomials with BigInteger coefficients to be converted.
Returns:
list of polynomials with type C coefficients.

decimalFromRational

public static <C extends RingElem<C> & Rational> GenPolynomial<BigDecimal> decimalFromRational(GenPolynomialRing<BigDecimal> fac,
                                                                                              GenPolynomial<C> A)
Convert to decimal coefficients.

Parameters:
fac - result polynomial factory.
A - polynomial with Rational coefficients to be converted.
Returns:
polynomial with BigDecimal coefficients.

complexDecimalFromRational

public static <C extends RingElem<C> & Rational> GenPolynomial<Complex<BigDecimal>> complexDecimalFromRational(GenPolynomialRing<Complex<BigDecimal>> fac,
                                                                                                              GenPolynomial<Complex<C>> A)
Convert to complex decimal coefficients.

Parameters:
fac - result polynomial factory.
A - polynomial with complex Rational coefficients to be converted.
Returns:
polynomial with Complex BigDecimal coefficients.

realPart

public static GenPolynomial<BigRational> realPart(GenPolynomialRing<BigRational> fac,
                                                  GenPolynomial<BigComplex> A)
Real part.

Parameters:
fac - result polynomial factory.
A - polynomial with BigComplex coefficients to be converted.
Returns:
polynomial with real part of the coefficients.

imaginaryPart

public static GenPolynomial<BigRational> imaginaryPart(GenPolynomialRing<BigRational> fac,
                                                       GenPolynomial<BigComplex> A)
Imaginary part.

Parameters:
fac - result polynomial factory.
A - polynomial with BigComplex coefficients to be converted.
Returns:
polynomial with imaginary part of coefficients.

realPartFromComplex

public static <C extends RingElem<C>> GenPolynomial<C> realPartFromComplex(GenPolynomialRing<C> fac,
                                                                           GenPolynomial<Complex<C>> A)
Real part.

Parameters:
fac - result polynomial factory.
A - polynomial with BigComplex coefficients to be converted.
Returns:
polynomial with real part of the coefficients.

imaginaryPartFromComplex

public static <C extends RingElem<C>> GenPolynomial<C> imaginaryPartFromComplex(GenPolynomialRing<C> fac,
                                                                                GenPolynomial<Complex<C>> A)
Imaginary part.

Parameters:
fac - result polynomial factory.
A - polynomial with BigComplex coefficients to be converted.
Returns:
polynomial with imaginary part of coefficients.

toComplex

public static <C extends RingElem<C>> GenPolynomial<Complex<C>> toComplex(GenPolynomialRing<Complex<C>> fac,
                                                                          GenPolynomial<C> A)
Complex from real polynomial.

Parameters:
fac - result polynomial factory.
A - polynomial with C coefficients to be converted.
Returns:
polynomial with Complex coefficients.

complexFromRational

public static GenPolynomial<BigComplex> complexFromRational(GenPolynomialRing<BigComplex> fac,
                                                            GenPolynomial<BigRational> A)
Complex from rational coefficients.

Parameters:
fac - result polynomial factory.
A - polynomial with BigRational coefficients to be converted.
Returns:
polynomial with BigComplex coefficients.

complexFromAny

public static <C extends GcdRingElem<C>> GenPolynomial<Complex<C>> complexFromAny(GenPolynomialRing<Complex<C>> fac,
                                                                                  GenPolynomial<C> A)
Complex from ring element coefficients.

Parameters:
fac - result polynomial factory.
A - polynomial with RingElem coefficients to be converted.
Returns:
polynomial with Complex coefficients.

fromAlgebraicCoefficients

public static <C extends GcdRingElem<C>> GenPolynomial<GenPolynomial<C>> fromAlgebraicCoefficients(GenPolynomialRing<GenPolynomial<C>> rfac,
                                                                                                   GenPolynomial<AlgebraicNumber<C>> A)
From AlgebraicNumber coefficients. Represent as polynomial with type GenPolynomial<C> coefficients, e.g. ModInteger or BigRational.

Parameters:
rfac - result polynomial factory.
A - polynomial with AlgebraicNumber coefficients to be converted.
Returns:
polynomial with type GenPolynomial<C> coefficients.

convertToAlgebraicCoefficients

public static <C extends GcdRingElem<C>> GenPolynomial<AlgebraicNumber<C>> convertToAlgebraicCoefficients(GenPolynomialRing<AlgebraicNumber<C>> pfac,
                                                                                                          GenPolynomial<C> A)
Convert to AlgebraicNumber coefficients. Represent as polynomial with AlgebraicNumber coefficients, C is e.g. ModInteger or BigRational.

Parameters:
pfac - result polynomial factory.
A - polynomial with C coefficients to be converted.
Returns:
polynomial with AlgebraicNumber<C> coefficients.

convertToRecAlgebraicCoefficients

public static <C extends GcdRingElem<C>> GenPolynomial<AlgebraicNumber<C>> convertToRecAlgebraicCoefficients(int depth,
                                                                                                             GenPolynomialRing<AlgebraicNumber<C>> pfac,
                                                                                                             GenPolynomial<C> A)
Convert to recursive AlgebraicNumber coefficients. Represent as polynomial with recursive AlgebraicNumber coefficients, C is e.g. ModInteger or BigRational.

Parameters:
depth - recursion depth of AlgebraicNumber coefficients.
pfac - result polynomial factory.
A - polynomial with C coefficients to be converted.
Returns:
polynomial with AlgebraicNumber<C> coefficients.

convertRecursiveToAlgebraicCoefficients

public static <C extends GcdRingElem<C>> GenPolynomial<AlgebraicNumber<C>> convertRecursiveToAlgebraicCoefficients(GenPolynomialRing<AlgebraicNumber<C>> pfac,
                                                                                                                   GenPolynomial<GenPolynomial<C>> A)
Convert to AlgebraicNumber coefficients. Represent as polynomial with AlgebraicNumber coefficients, C is e.g. ModInteger or BigRational.

Parameters:
pfac - result polynomial factory.
A - recursive polynomial with GenPolynomial<BigInteger> coefficients to be converted.
Returns:
polynomial with AlgebraicNumber<C> coefficients.

complexFromAlgebraic

public static <C extends GcdRingElem<C>> GenPolynomial<Complex<C>> complexFromAlgebraic(GenPolynomialRing<Complex<C>> fac,
                                                                                        GenPolynomial<AlgebraicNumber<C>> A)
Complex from algebraic coefficients.

Parameters:
fac - result polynomial factory.
A - polynomial with AlgebraicNumber coefficients Q(i) to be converted.
Returns:
polynomial with Complex coefficients.

algebraicFromComplex

public static <C extends GcdRingElem<C>> GenPolynomial<AlgebraicNumber<C>> algebraicFromComplex(GenPolynomialRing<AlgebraicNumber<C>> fac,
                                                                                                GenPolynomial<Complex<C>> A)
AlgebraicNumber from complex coefficients.

Parameters:
fac - result polynomial factory over Q(i).
A - polynomial with Complex coefficients to be converted.
Returns:
polynomial with AlgebraicNumber coefficients.

chineseRemainder

public static <C extends RingElem<C> & Modular> GenPolynomial<C> chineseRemainder(GenPolynomialRing<C> fac,
                                                                                 GenPolynomial<C> A,
                                                                                 C mi,
                                                                                 GenPolynomial<C> B)
ModInteger chinese remainder algorithm on coefficients.

Parameters:
fac - GenPolynomial<ModInteger> result factory with A.coFac.modul*B.coFac.modul = C.coFac.modul.
A - GenPolynomial<ModInteger>.
B - other GenPolynomial<ModInteger>.
mi - inverse of A.coFac.modul in ring B.coFac.
Returns:
S = cra(A,B), with S mod A.coFac.modul == A and S mod B.coFac.modul == B.

monic

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> monic(GenPolynomial<GenPolynomial<C>> p)
GenPolynomial monic, i.e. leadingBaseCoefficient == 1. If leadingBaseCoefficient is not invertible returns this unmodified.

Type Parameters:
C - coefficient type.
Parameters:
p - recursive GenPolynomial>.
Returns:
monic(p).

monic

public static <C extends RingElem<C>> java.util.List<GenPolynomial<C>> monic(java.util.List<GenPolynomial<C>> L)
Polynomial list monic.

Type Parameters:
C - coefficient type.
Parameters:
L - list of polynomials with field coefficients.
Returns:
list of polynomials with leading coefficient 1.

leadingExpVector

public static <C extends RingElem<C>> java.util.List<ExpVector> leadingExpVector(java.util.List<GenPolynomial<C>> L)
Polynomial list leading exponent vectors.

Type Parameters:
C - coefficient type.
Parameters:
L - list of polynomials.
Returns:
list of leading exponent vectors.

extendCoefficients

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> extendCoefficients(GenPolynomialRing<GenPolynomial<C>> pfac,
                                                                                         GenPolynomial<GenPolynomial<C>> A,
                                                                                         int j,
                                                                                         long k)
Extend coefficient variables. Extend all coefficient ExpVectors by i elements and multiply by x_j^k.

Parameters:
pfac - extended polynomial ring factory (by i variables in the coefficients).
j - index of variable to be used for multiplication.
k - exponent for x_j.
Returns:
extended polynomial.

toRecursive

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> toRecursive(GenPolynomialRing<GenPolynomial<C>> rfac,
                                                                                  GenPolynomial<C> A)
To recursive representation. Represent as polynomial in i+r variables with coefficients in i variables. Works for arbitrary term orders.

Type Parameters:
C - coefficient type.
Parameters:
rfac - recursive polynomial ring factory.
A - polynomial to be converted.
Returns:
Recursive represenations of this in the ring rfac.

baseRemainderPoly

public static <C extends RingElem<C>> GenPolynomial<C> baseRemainderPoly(GenPolynomial<C> P,
                                                                         C s)
GenPolynomial coefficient wise remainder.

Type Parameters:
C - coefficient type.
Parameters:
P - GenPolynomial.
s - nonzero coefficient.
Returns:
coefficient wise remainder.
See Also:
GenPolynomial.remainder(edu.jas.poly.GenPolynomial).

basePseudoRemainder

public static <C extends RingElem<C>> GenPolynomial<C> basePseudoRemainder(GenPolynomial<C> P,
                                                                           GenPolynomial<C> S)
GenPolynomial sparse pseudo remainder. For univariate polynomials.

Type Parameters:
C - coefficient type.
Parameters:
P - GenPolynomial.
S - nonzero GenPolynomial.
Returns:
remainder with ldcf(S)m' P = quotient * S + remainder.
See Also:
GenPolynomial.remainder(edu.jas.poly.GenPolynomial).

basePseudoDivide

public static <C extends RingElem<C>> GenPolynomial<C> basePseudoDivide(GenPolynomial<C> P,
                                                                        GenPolynomial<C> S)
GenPolynomial pseudo divide. For univariate polynomials or exact division.

Type Parameters:
C - coefficient type.
Parameters:
P - GenPolynomial.
S - nonzero GenPolynomial.
Returns:
quotient with ldcf(S)m' P = quotient * S + remainder.
See Also:
GenPolynomial.divide(edu.jas.poly.GenPolynomial).

basePseudoQuotientRemainder

public static <C extends RingElem<C>> GenPolynomial<C>[] basePseudoQuotientRemainder(GenPolynomial<C> P,
                                                                                     GenPolynomial<C> S)
GenPolynomial pseudo quotient and remainder. For univariate polynomials or exact division.

Type Parameters:
C - coefficient type.
Parameters:
P - GenPolynomial.
S - nonzero GenPolynomial.
Returns:
[ quotient, remainder ] with ldcf(S)m' P = quotient * S + remainder.
See Also:
GenPolynomial.divide(edu.jas.poly.GenPolynomial).

recursiveDivide

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursiveDivide(GenPolynomial<GenPolynomial<C>> P,
                                                                                      GenPolynomial<C> s)
GenPolynomial pseudo divide. For recursive polynomials. Division by coefficient ring element.

Type Parameters:
C - coefficient type.
Parameters:
P - recursive GenPolynomial.
s - GenPolynomial.
Returns:
this/s.

baseRecursiveDivide

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> baseRecursiveDivide(GenPolynomial<GenPolynomial<C>> P,
                                                                                          C s)
GenPolynomial base divide. For recursive polynomials. Division by coefficient ring element.

Type Parameters:
C - coefficient type.
Parameters:
P - recursive GenPolynomial.
s - coefficient.
Returns:
this/s.

recursivePseudoRemainder

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursivePseudoRemainder(GenPolynomial<GenPolynomial<C>> P,
                                                                                               GenPolynomial<GenPolynomial<C>> S)
GenPolynomial sparse pseudo remainder. For recursive polynomials.

Type Parameters:
C - coefficient type.
Parameters:
P - recursive GenPolynomial.
S - nonzero recursive GenPolynomial.
Returns:
remainder with ldcf(S)m' P = quotient * S + remainder.
See Also:
GenPolynomial.remainder(edu.jas.poly.GenPolynomial).

recursivePseudoDivide

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursivePseudoDivide(GenPolynomial<GenPolynomial<C>> P,
                                                                                            GenPolynomial<GenPolynomial<C>> S)
GenPolynomial pseudo divide. For recursive polynomials.

Type Parameters:
C - coefficient type.
Parameters:
P - recursive GenPolynomial.
S - nonzero recursive GenPolynomial.
Returns:
quotient with ldcf(S)m P = quotient * S + remainder.
See Also:
GenPolynomial.remainder(edu.jas.poly.GenPolynomial).

coefficientPseudoDivide

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> coefficientPseudoDivide(GenPolynomial<GenPolynomial<C>> P,
                                                                                              GenPolynomial<C> s)
GenPolynomial pseudo divide. For recursive polynomials.

Type Parameters:
C - coefficient type.
Parameters:
P - recursive GenPolynomial.
s - nonzero GenPolynomial.
Returns:
quotient with ldcf(s)m P = quotient * s + remainder.
See Also:
GenPolynomial.remainder(edu.jas.poly.GenPolynomial).

coefficientBasePseudoDivide

public static <C extends RingElem<C>> GenPolynomial<C> coefficientBasePseudoDivide(GenPolynomial<C> P,
                                                                                   C s)
GenPolynomial pseudo divide. For polynomials.

Type Parameters:
C - coefficient type.
Parameters:
P - GenPolynomial.
s - nonzero coefficient.
Returns:
quotient with ldcf(s)m P = quotient * s + remainder.
See Also:
GenPolynomial.remainder(edu.jas.poly.GenPolynomial).

baseDeriviative

public static <C extends RingElem<C>> GenPolynomial<C> baseDeriviative(GenPolynomial<C> P)
GenPolynomial polynomial derivative main variable.

Type Parameters:
C - coefficient type.
Parameters:
P - GenPolynomial.
Returns:
deriviative(P).

baseDeriviative

public static <C extends RingElem<C>> GenPolynomial<C> baseDeriviative(GenPolynomial<C> P,
                                                                       int r)
GenPolynomial polynomial partial derivative variable r.

Type Parameters:
C - coefficient type.
Parameters:
P - GenPolynomial.
r - variable for partial deriviate.
Returns:
deriviative(P,r).

baseIntegral

public static <C extends RingElem<C>> GenPolynomial<C> baseIntegral(GenPolynomial<C> P)
GenPolynomial polynomial integral main variable.

Type Parameters:
C - coefficient type.
Parameters:
P - GenPolynomial.
Returns:
integral(P).

recursiveDeriviative

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursiveDeriviative(GenPolynomial<GenPolynomial<C>> P)
GenPolynomial recursive polynomial derivative main variable.

Type Parameters:
C - coefficient type.
Parameters:
P - recursive GenPolynomial.
Returns:
deriviative(P).

factorBound

public static BigInteger factorBound(ExpVector e)
Factor coefficient bound. See SACIPOL.IPFCB: the product of all maxNorms of potential factors is less than or equal to 2**b times the maxNorm of A.

Parameters:
e - degree vector of a GenPolynomial A.
Returns:
2**b.

evaluateMainRecursive

public static <C extends RingElem<C>> GenPolynomial<C> evaluateMainRecursive(GenPolynomialRing<C> cfac,
                                                                             GenPolynomial<GenPolynomial<C>> A,
                                                                             C a)
Evaluate at main variable.

Type Parameters:
C - coefficient type.
Parameters:
cfac - coefficent polynomial ring factory.
A - recursive polynomial to be evaluated.
a - value to evaluate at.
Returns:
A( x_1, ..., x_{n-1}, a ).

evaluateMain

public static <C extends RingElem<C>> GenPolynomial<C> evaluateMain(GenPolynomialRing<C> cfac,
                                                                    GenPolynomial<C> A,
                                                                    C a)
Evaluate at main variable.

Type Parameters:
C - coefficient type.
Parameters:
cfac - coefficent polynomial ring factory.
A - distributed polynomial to be evaluated.
a - value to evaluate at.
Returns:
A( x_1, ..., x_{n-1}, a ).

evaluateMain

public static <C extends RingElem<C>> java.util.List<GenPolynomial<C>> evaluateMain(GenPolynomialRing<C> cfac,
                                                                                    java.util.List<GenPolynomial<C>> L,
                                                                                    C a)
Evaluate at main variable.

Type Parameters:
C - coefficient type.
Parameters:
cfac - coefficent ring factory.
L - list of univariate polynomials to be evaluated.
a - value to evaluate at.
Returns:
list( A( x_1, ..., x_{n-1}, a ) ) for A in L.

evaluateMain

public static <C extends RingElem<C>> C evaluateMain(RingFactory<C> cfac,
                                                     GenPolynomial<C> A,
                                                     C a)
Evaluate at main variable.

Type Parameters:
C - coefficient type.
Parameters:
cfac - coefficent ring factory.
A - univariate polynomial to be evaluated.
a - value to evaluate at.
Returns:
A( a ).

evaluateMain

public static <C extends RingElem<C>> java.util.List<C> evaluateMain(RingFactory<C> cfac,
                                                                     java.util.List<GenPolynomial<C>> L,
                                                                     C a)
Evaluate at main variable.

Type Parameters:
C - coefficient type.
Parameters:
cfac - coefficent ring factory.
L - list of univariate polynomial to be evaluated.
a - value to evaluate at.
Returns:
list( A( a ) ) for A in L.

evaluate

public static <C extends RingElem<C>> GenPolynomial<C> evaluate(GenPolynomialRing<C> cfac,
                                                                GenPolynomialRing<GenPolynomial<C>> rfac,
                                                                GenPolynomialRing<GenPolynomial<C>> nfac,
                                                                GenPolynomialRing<C> dfac,
                                                                GenPolynomial<C> A,
                                                                C a)
Evaluate at k-th variable.

Type Parameters:
C - coefficient type.
Parameters:
cfac - coefficient polynomial ring in k variables C[x_1, ..., x_k] factory.
rfac - coefficient polynomial ring C[x_1, ..., x_{k-1}] [x_k] factory, a recursive polynomial ring in 1 variable with coefficients in k-1 variables.
nfac - polynomial ring in n-1 varaibles C[x_1, ..., x_{k-1}] [x_{k+1}, ..., x_n] factory, a recursive polynomial ring in n-k+1 variables with coefficients in k-1 variables.
dfac - polynomial ring in n-1 variables. C[x_1, ..., x_{k-1}, x_{k+1}, ..., x_n] factory.
A - polynomial to be evaluated.
a - value to evaluate at.
Returns:
A( x_1, ..., x_{k-1}, a, x_{k+1}, ..., x_n).

evaluateFirst

public static <C extends RingElem<C>> GenPolynomial<C> evaluateFirst(GenPolynomialRing<C> cfac,
                                                                     GenPolynomialRing<C> dfac,
                                                                     GenPolynomial<C> A,
                                                                     C a)
Evaluate at first (lowest) variable.

Type Parameters:
C - coefficient type.
Parameters:
cfac - coefficient polynomial ring in first variable C[x_1] factory.
dfac - polynomial ring in n-1 variables. C[x_2, ..., x_n] factory.
A - polynomial to be evaluated.
a - value to evaluate at.
Returns:
A( a, x_2, ..., x_n).

evaluateFirstRec

public static <C extends RingElem<C>> GenPolynomial<C> evaluateFirstRec(GenPolynomialRing<C> cfac,
                                                                        GenPolynomialRing<C> dfac,
                                                                        GenPolynomial<GenPolynomial<C>> A,
                                                                        C a)
Evaluate at first (lowest) variable.

Type Parameters:
C - coefficient type. Could also be called evaluateFirst(), but type erasure of A parameter does not allow same name.
Parameters:
cfac - coefficient polynomial ring in first variable C[x_1] factory.
dfac - polynomial ring in n-1 variables. C[x_2, ..., x_n] factory.
A - recursive polynomial to be evaluated.
a - value to evaluate at.
Returns:
A( a, x_2, ..., x_n).

evaluateAll

public static <C extends RingElem<C>> C evaluateAll(RingFactory<C> cfac,
                                                    GenPolynomialRing<C> dfac,
                                                    GenPolynomial<C> A,
                                                    java.util.List<C> a)
Evaluate all variables.

Type Parameters:
C - coefficient type.
Parameters:
cfac - coefficient ring factory.
dfac - polynomial ring in n variables. C[x_1, x_2, ..., x_n] factory.
A - polynomial to be evaluated.
a - = ( a_1, a_2, ..., a_n) a tuple of values to evaluate at.
Returns:
A( a_1, a_2, ..., a_n).

substituteMain

public static <C extends RingElem<C>> GenPolynomial<C> substituteMain(GenPolynomial<C> A,
                                                                      GenPolynomial<C> s)
Substitute main variable.

Parameters:
A - univariate polynomial.
s - polynomial for substitution.
Returns:
polynomial A(x <- s).

substituteUnivariate

public static <C extends RingElem<C>> GenPolynomial<C> substituteUnivariate(GenPolynomial<C> f,
                                                                            GenPolynomial<C> t)
Substitute univariate polynomial.

Parameters:
f - univariate polynomial.
t - polynomial for substitution.
Returns:
polynomial A(x <- t).

seriesOfTaylor

public static <C extends RingElem<C>> GenPolynomial<C> seriesOfTaylor(GenPolynomial<C> f,
                                                                      C a)
Taylor series for polynomial.

Parameters:
f - univariate polynomial.
a - expansion point.
Returns:
Taylor series (a polynomial) of f at a.

interpolate

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> interpolate(GenPolynomialRing<GenPolynomial<C>> fac,
                                                                                  GenPolynomial<GenPolynomial<C>> A,
                                                                                  GenPolynomial<C> M,
                                                                                  C mi,
                                                                                  GenPolynomial<C> B,
                                                                                  C am)
ModInteger interpolate on first variable.

Type Parameters:
C - coefficient type.
Parameters:
fac - GenPolynomial result factory.
A - GenPolynomial.
M - GenPolynomial interpolation modul of A.
mi - inverse of M(am) in ring fac.coFac.
B - evaluation of other GenPolynomial.
am - evaluation point (interpolation modul) of B, i.e. P(am) = B.
Returns:
S, with S mod M == A and S(am) == B.

interpolate

public static <C extends RingElem<C>> GenPolynomial<C> interpolate(GenPolynomialRing<C> fac,
                                                                   GenPolynomial<C> A,
                                                                   GenPolynomial<C> M,
                                                                   C mi,
                                                                   C a,
                                                                   C am)
Univariate polynomial interpolation.

Type Parameters:
C - coefficient type.
Parameters:
fac - GenPolynomial result factory.
A - GenPolynomial.
M - GenPolynomial interpolation modul of A.
mi - inverse of M(am) in ring fac.coFac.
a - evaluation of other GenPolynomial.
am - evaluation point (interpolation modul) of a, i.e. P(am) = a.
Returns:
S, with S mod M == A and S(am) == a.

switchVariables

public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> switchVariables(GenPolynomial<GenPolynomial<C>> P)
Recursive GenPolynomial switch varaible blocks.

Type Parameters:
C - coefficient type.
Parameters:
P - recursive GenPolynomial in R[X,Y].
Returns:
this in R[Y,X].

totalDegreeLeadingTerm

public static <C extends RingElem<C>> long totalDegreeLeadingTerm(java.util.List<GenPolynomial<C>> P)
Maximal degree of leading terms of a polynomial list.

Returns:
maximum degree of the leading terms of a polynomial list.

totalDegree

public static <C extends RingElem<C>> long totalDegree(java.util.List<GenPolynomial<C>> P)
Maximal degree of polynomial list.

Returns:
maximum degree of the polynomial list.

coeffMaxDegree

public static <C extends RingElem<C>> long coeffMaxDegree(GenPolynomial<GenPolynomial<C>> A)
Maximal degree in the coefficient polynomials.

Type Parameters:
C - coefficient type.
Returns:
maximal degree in the coefficients.

map

public static <C extends RingElem<C>,D extends RingElem<D>> GenPolynomial<D> map(GenPolynomialRing<D> ring,
                                                                                 GenPolynomial<C> p,
                                                                                 UnaryFunctor<C,D> f)
Map a unary function to the coefficients.

Parameters:
ring - result polynomial ring factory.
p - polynomial.
f - evaluation functor.
Returns:
new polynomial with coefficients f(p(e)).

toProductGen

public static <C extends GcdRingElem<C>> java.util.List<GenPolynomial<Product<C>>> toProductGen(GenPolynomialRing<Product<C>> pfac,
                                                                                                java.util.List<GenPolynomial<C>> L)
Product representation.

Type Parameters:
C - coefficient type.
Parameters:
pfac - polynomial ring factory.
L - list of polynomials to be represented.
Returns:
Product represenation of L in the polynomial ring pfac.

toProductGen

public static <C extends GcdRingElem<C>> GenPolynomial<Product<C>> toProductGen(GenPolynomialRing<Product<C>> pfac,
                                                                                GenPolynomial<C> A)
Product representation.

Type Parameters:
C - coefficient type.
Parameters:
pfac - polynomial ring factory.
A - polynomial to be represented.
Returns:
Product represenation of A in the polynomial ring pfac.

toProductGen

public static <C extends GcdRingElem<C>> Product<C> toProductGen(ProductRing<C> pfac,
                                                                 C c)
Product representation.

Type Parameters:
C - coefficient type.
Parameters:
pfac - product ring factory.
c - coefficient to be represented.
Returns:
Product represenation of c in the ring pfac.

toProduct

public static <C extends RingElem<C>> Product<GenPolynomial<C>> toProduct(ProductRing<GenPolynomial<C>> pfac,
                                                                          C c,
                                                                          ExpVector e)
Product representation.

Type Parameters:
C - coefficient type.
Parameters:
pfac - product polynomial ring factory.
c - coefficient to be used.
e - exponent vector.
Returns:
Product represenation of c X^e in the ring pfac.

toProduct

public static <C extends RingElem<C>> Product<GenPolynomial<C>> toProduct(ProductRing<GenPolynomial<C>> pfac,
                                                                          GenPolynomial<C> A)
Product representation.

Type Parameters:
C - coefficient type.
Parameters:
pfac - product polynomial ring factory.
A - polynomial.
Returns:
Product represenation of the terms of A in the ring pfac.

toProduct

public static Product<ModInteger> toProduct(ProductRing<ModInteger> pfac,
                                            BigInteger c)
Product representation.

Parameters:
pfac - product ring factory.
c - coefficient to be represented.
Returns:
Product represenation of c in the ring pfac.

toProduct

public static GenPolynomial<Product<ModInteger>> toProduct(GenPolynomialRing<Product<ModInteger>> pfac,
                                                           GenPolynomial<BigInteger> A)
Product representation.

Parameters:
pfac - polynomial ring factory.
A - polynomial to be represented.
Returns:
Product represenation of A in the polynomial ring pfac.

toProduct

public static java.util.List<GenPolynomial<Product<ModInteger>>> toProduct(GenPolynomialRing<Product<ModInteger>> pfac,
                                                                           java.util.List<GenPolynomial<BigInteger>> L)
Product representation.

Parameters:
pfac - polynomial ring factory.
L - list of polynomials to be represented.
Returns:
Product represenation of L in the polynomial ring pfac.

removeUnusedUpperVariables

public static <C extends RingElem<C>> GenPolynomial<C> removeUnusedUpperVariables(GenPolynomial<C> p)
Remove all upper variables, which do not occur in polynomial.

Parameters:
p - polynomial.
Returns:
polynomial with removed variables

removeUnusedLowerVariables

public static <C extends RingElem<C>> GenPolynomial<C> removeUnusedLowerVariables(GenPolynomial<C> p)
Remove all lower variables, which do not occur in polynomial.

Parameters:
p - polynomial.
Returns:
polynomial with removed variables

selectWithVariable

public static <C extends RingElem<C>> GenPolynomial<C> selectWithVariable(java.util.List<GenPolynomial<C>> P,
                                                                          int i)
Select polynomial with univariate leading term in variable i.

Parameters:
i - variable index.
Returns:
polynomial with head term in variable i