Package edu.jas.poly
Class PolyUtil
- java.lang.Object
-
- 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
Constructors Constructor Description PolyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <C extends RingElem<C>>
CabsNorm(GenPolynomial<C> p)Absoulte norm.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>baseDensePseudoQuotient(GenPolynomial<C> P, GenPolynomial<C> S)GenPolynomial dense pseudo quotient.static <C extends RingElem<C>>
GenPolynomial<C>baseDensePseudoRemainder(GenPolynomial<C> P, GenPolynomial<C> S)GenPolynomial dense pseudo remainder.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 sparse pseudo divide.static <C extends RingElem<C>>
GenPolynomial<C>[]basePseudoQuotientRemainder(GenPolynomial<C> P, GenPolynomial<C> S)GenPolynomial sparse pseudo quotient and remainder.static <C extends RingElem<C>>
GenPolynomial<C>basePseudoRemainder(GenPolynomial<C> P, GenPolynomial<C> S)Deprecated.(forRemoval=true) UsebaseSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)insteadstatic <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>>
GenPolynomial<C>baseSparsePseudoRemainder(GenPolynomial<C> P, GenPolynomial<C> S)GenPolynomial sparse pseudo 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>>
longcoeffMaxDegree(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>>
CevaluateAll(RingFactory<C> cfac, GenPolynomial<C> A, java.util.List<C> a)Evaluate all variables.static <C extends RingElem<C>>
java.util.List<C>evaluateAll(RingFactory<C> cfac, java.util.List<GenPolynomial<C>> L, 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>>
CevaluateMain(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 <C extends RingElem<C>>
GenSolvablePolynomial<GenPolynomial<C>>extendCoefficients(GenSolvablePolynomialRing<GenPolynomial<C>> pfac, GenSolvablePolynomial<GenPolynomial<C>> A, int j, long k)Extend coefficient variables.static BigIntegerfactorBound(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 GenPolynomial<BigInteger>integerFromRationalCoefficients(GenPolynomialRing<BigInteger> fac, java.math.BigInteger gcd, java.math.BigInteger lcm, 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<GenPolynomial<C>>intersect(GenPolynomialRing<C> R, java.util.List<GenPolynomial<C>> F)Intersection.static <C extends RingElem<C>>
java.util.List<GenSolvablePolynomial<C>>intersect(GenSolvablePolynomialRing<C> R, java.util.List<GenSolvablePolynomial<C>> F)Intersection.static <C extends RingElem<C>>
java.util.List<GenWordPolynomial<C>>intersect(GenWordPolynomialRing<C> R, java.util.List<GenWordPolynomial<C>> F)Intersection.static <C extends RingElem<C>>
booleanisBasePseudoQuotientRemainder(GenPolynomial<C> P, GenPolynomial<C> S, GenPolynomial<C> q, GenPolynomial<C> r)Is GenPolynomial pseudo quotient and remainder.static <C extends RingElem<C>>
booleanisRecursivePseudoQuotientRemainder(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S, GenPolynomial<GenPolynomial<C>> q, GenPolynomial<GenPolynomial<C>> r)Is recursive GenPolynomial pseudo quotient and remainder.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>>
longmaxDegree(java.util.List<GenPolynomial<C>> P)Maximal degree of polynomial list.static <C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>monic(GenPolynomial<GenPolynomial<C>> p)GenPolynomial monic, i.e. leadingBaseCoefficient == 1.static <C extends RingElem<C>>
GenSolvablePolynomial<GenPolynomial<C>>monic(GenSolvablePolynomial<GenPolynomial<C>> p)GenSolvablePolynomial 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 <C extends RingElem<C>>
java.util.List<GenPolynomial<GenPolynomial<C>>>monicRec(java.util.List<GenPolynomial<GenPolynomial<C>>> L)Recursive 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<C>reciprocalTransformation(GenPolynomial<C> A)Polynomial reciprocal transformation.static <C extends RingElem<C>>
GenPolynomial<C>reciprocalTransformation(GenPolynomial<C> A, int i)Polynomial reciprocal transformation.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>>recursiveDensePseudoRemainder(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S)GenPolynomial dense pseudo remainder.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 divide.static <C extends RingElem<C>>
GenWordPolynomial<GenPolynomial<C>>recursiveDivide(GenWordPolynomial<GenPolynomial<C>> P, GenPolynomial<C> s)GenPolynomial divide.static <C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>recursivePseudoDivide(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S)GenPolynomial recursive pseudo divide.static <C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>recursivePseudoRemainder(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S)Deprecated.(forRemoval=true) UserecursiveSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)insteadstatic <C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>recursiveSparsePseudoRemainder(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>removeUnusedMiddleVariables(GenPolynomial<C> p)Remove upper block of middle 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<C>substituteUnivariateMult(GenPolynomial<C> f, GenPolynomial<C> t)Substitute univariate polynomial with multivariate coefficients.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 Product<ModInteger>toProduct(ProductRing<ModInteger> pfac, BigInteger c)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 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 GcdRingElem<C>>
Product<C>toProductGen(ProductRing<C> pfac, C 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 RingElem<C>>
GenPolynomial<GenPolynomial<C>>toRecursive(GenPolynomialRing<GenPolynomial<C>> rfac, GenPolynomial<C> A)To recursive representation.static <C extends RingElem<C>>
GenSolvablePolynomial<GenPolynomial<C>>toRecursive(GenSolvablePolynomialRing<GenPolynomial<C>> rfac, GenSolvablePolynomial<C> A)To recursive representation.static <C extends RingElem<C>>
longtotalDegree(java.util.List<GenPolynomial<C>> P)Total degree of polynomial list.static <C extends RingElem<C>>
longtotalDegreeLeadingTerm(java.util.List<GenPolynomial<C>> P)Maximal degree of leading terms of a polynomial list.static <C extends RingElem<C>>
GenPolynomial<C>translation(GenPolynomial<C> A, java.util.List<C> H)Polynomial translation, all variables.static <C extends RingElem<C>>
GenPolynomial<C>translation1(GenPolynomial<C> A, java.util.List<C> H)Polynomial translation, r-1 variables.static <C extends RingElem<C>>
GenPolynomial<C>translationBase(GenPolynomial<C> A, C h)Polynomial translation, base univariate.static <C extends RingElem<C>>
GenPolynomial<C>translationMain(GenPolynomial<C> A, C h)Polynomial translation, main variable.static <C extends RingElem<C>>
GenPolynomial<GenPolynomial<C>>translationMainRecursive(GenPolynomial<GenPolynomial<C>> A, C h)Polynomial translation, main variable.static <C extends RingElem<C>>
java.util.List<GenWordPolynomial<C>>wordMonic(java.util.List<GenWordPolynomial<C>> L)Word polynomial list monic.
-
-
-
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 GenPolynomial<BigInteger> integerFromRationalCoefficients(GenPolynomialRing<BigInteger> fac, java.math.BigInteger gcd, java.math.BigInteger lcm, 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.- Parameters:
fac- result polynomial factory.gcd- of rational coefficient numerators.lcm- of rational coefficient denominators.A- polynomial with BigRational coefficients to be converted.- Returns:
- 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 AlgebraicNumbercoefficients, 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 AlgebraicNumbercoefficients, 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 AlgebraicNumbercoefficients, 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<GenPolynomial>. - Returns:
- monic(p).
-
monic
public static <C extends RingElem<C>> GenSolvablePolynomial<GenPolynomial<C>> monic(GenSolvablePolynomial<GenPolynomial<C>> p)
GenSolvablePolynomial monic, i.e. leadingBaseCoefficient == 1. If leadingBaseCoefficient is not invertible returns this unmodified.- Type Parameters:
C- coefficient type.- Parameters:
p- recursive GenSolvablePolynomial<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.
-
wordMonic
public static <C extends RingElem<C>> java.util.List<GenWordPolynomial<C>> wordMonic(java.util.List<GenWordPolynomial<C>> L)
Word polynomial list monic.- Type Parameters:
C- coefficient type.- Parameters:
L- list of word polynomials with field coefficients.- Returns:
- list of word polynomials with leading coefficient 1.
-
monicRec
public static <C extends RingElem<C>> java.util.List<GenPolynomial<GenPolynomial<C>>> monicRec(java.util.List<GenPolynomial<GenPolynomial<C>>> L)
Recursive polynomial list monic.- Type Parameters:
C- coefficient type.- Parameters:
L- list of recursive polynomials with field coefficients.- Returns:
- list of polynomials with leading base 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.
-
extendCoefficients
public static <C extends RingElem<C>> GenSolvablePolynomial<GenPolynomial<C>> extendCoefficients(GenSolvablePolynomialRing<GenPolynomial<C>> pfac, GenSolvablePolynomial<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 A in the ring rfac.
-
toRecursive
public static <C extends RingElem<C>> GenSolvablePolynomial<GenPolynomial<C>> toRecursive(GenSolvablePolynomialRing<GenPolynomial<C>> rfac, GenSolvablePolynomial<C> A)
To recursive representation. Represent as solvable polynomial in i+r variables with coefficients in i variables. Works for arbitrary term orders.- Type Parameters:
C- coefficient type.- Parameters:
rfac- recursive solvable polynomial ring factory.A- solvable polynomial to be converted.- Returns:
- Recursive represenations of A 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.
-
basePseudoRemainder
@Deprecated public static <C extends RingElem<C>> GenPolynomial<C> basePseudoRemainder(GenPolynomial<C> P, GenPolynomial<C> S)
Deprecated.(forRemoval=true) UsebaseSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)insteadGenPolynomial 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. m' ≤ deg(P)-deg(S)
-
baseSparsePseudoRemainder
public static <C extends RingElem<C>> GenPolynomial<C> baseSparsePseudoRemainder(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. m' ≤ deg(P)-deg(S)
-
baseDensePseudoRemainder
public static <C extends RingElem<C>> GenPolynomial<C> baseDensePseudoRemainder(GenPolynomial<C> P, GenPolynomial<C> S)
GenPolynomial dense pseudo remainder. For univariate polynomials.- Parameters:
P- GenPolynomial.S- nonzero GenPolynomial.- Returns:
- remainder with ldcf(S)m P = quotient * S + remainder. m == deg(P)-deg(S)
-
baseDensePseudoQuotient
public static <C extends RingElem<C>> GenPolynomial<C> baseDensePseudoQuotient(GenPolynomial<C> P, GenPolynomial<C> S)
GenPolynomial dense pseudo quotient. For univariate polynomials.- Parameters:
P- GenPolynomial.S- nonzero GenPolynomial.- Returns:
- quotient with ldcf(S)m P = quotient * S + remainder. m == deg(P)-deg(S)
-
basePseudoDivide
public static <C extends RingElem<C>> GenPolynomial<C> basePseudoDivide(GenPolynomial<C> P, GenPolynomial<C> S)
GenPolynomial sparse 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. m' ≤ deg(P)-deg(S)
-
basePseudoQuotientRemainder
public static <C extends RingElem<C>> GenPolynomial<C>[] basePseudoQuotientRemainder(GenPolynomial<C> P, GenPolynomial<C> S)
GenPolynomial sparse 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. m' ≤ deg(P)-deg(S)
-
isBasePseudoQuotientRemainder
public static <C extends RingElem<C>> boolean isBasePseudoQuotientRemainder(GenPolynomial<C> P, GenPolynomial<C> S, GenPolynomial<C> q, GenPolynomial<C> r)
Is GenPolynomial pseudo quotient and remainder. For univariate polynomials.- Type Parameters:
C- coefficient type.- Parameters:
P- base GenPolynomial.S- nonzero base GenPolynomial.- Returns:
- true, if P = q * S + r, else false.
-
recursiveDivide
public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursiveDivide(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<C> s)
GenPolynomial divide. For recursive polynomials. Division by coefficient ring element.- Type Parameters:
C- coefficient type.- Parameters:
P- recursive GenPolynomial.s- GenPolynomial.- Returns:
- this/s.
-
recursiveDivide
public static <C extends RingElem<C>> GenWordPolynomial<GenPolynomial<C>> recursiveDivide(GenWordPolynomial<GenPolynomial<C>> P, GenPolynomial<C> s)
GenPolynomial 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
@Deprecated public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursivePseudoRemainder(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S)
Deprecated.(forRemoval=true) UserecursiveSparsePseudoRemainder(edu.jas.poly.GenPolynomial,edu.jas.poly.GenPolynomial)insteadGenPolynomial 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.
-
recursiveSparsePseudoRemainder
public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursiveSparsePseudoRemainder(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.
-
recursiveDensePseudoRemainder
public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursiveDensePseudoRemainder(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S)
GenPolynomial dense pseudo remainder. For recursive polynomials.- Parameters:
P- recursive GenPolynomial.S- nonzero recursive GenPolynomial.- Returns:
- remainder with ldcf(S)m' P = quotient * S + remainder.
-
recursivePseudoDivide
public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> recursivePseudoDivide(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S)
GenPolynomial recursive 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.
-
isRecursivePseudoQuotientRemainder
public static <C extends RingElem<C>> boolean isRecursivePseudoQuotientRemainder(GenPolynomial<GenPolynomial<C>> P, GenPolynomial<GenPolynomial<C>> S, GenPolynomial<GenPolynomial<C>> q, GenPolynomial<GenPolynomial<C>> r)
Is recursive GenPolynomial pseudo quotient and remainder. For recursive polynomials.- Type Parameters:
C- coefficient type.- Parameters:
P- recursive GenPolynomial.S- nonzero recursive GenPolynomial.- Returns:
- true, if P ~= q * S + r, else false.
-
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.
-
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.
-
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. The product of all maxNorms of potential factors is less than or equal to 2**b times the maxNorm of A. Gelfonds bound is used.- Parameters:
e- degree vector of a GenPolynomial A.- Returns:
- 2**b.
- See Also:
- "maspoly.SACIPOL.mi#IPFCB from SAC2/MAS"
-
absNorm
public static <C extends RingElem<C>> C absNorm(GenPolynomial<C> p)
Absoulte norm. Square root of the sum of the squared coefficients.- Parameters:
p- GenPolynomial- Returns:
- sqrt( sumi |ci|2 ).
-
reciprocalTransformation
public static <C extends RingElem<C>> GenPolynomial<C> reciprocalTransformation(GenPolynomial<C> A)
Polynomial reciprocal transformation.- Type Parameters:
C- coefficient type.- Parameters:
A- is a non-zero polynomial, with n=DEG(A).- Returns:
- B with B(x) = x**n*A(1/x), where x is the main variable of A.
- See Also:
- "maspoly.SACPOL.mi#PRT from SAC2/MAS"
-
reciprocalTransformation
public static <C extends RingElem<C>> GenPolynomial<C> reciprocalTransformation(GenPolynomial<C> A, int i)
Polynomial reciprocal transformation.- Type Parameters:
C- coefficient type.- Parameters:
A- is a non-zero polynomial, with n=DEG(A,i), A(x_r, ..., x_0).i- variable to be transformed, 0 is the main variable.- Returns:
- B with B(x) = x_i**n*A(1/x_i), where x_i is the i-th variable of A.
- See Also:
- "maspoly.SACPOL.mi#PRT from SAC2/MAS"
-
translationMain
public static <C extends RingElem<C>> GenPolynomial<C> translationMain(GenPolynomial<C> A, C h)
Polynomial translation, main variable.- Type Parameters:
C- coefficient type.- Parameters:
A- is a non-zero polynomial in r variables, A(x_1, ..., x(r-1), x_r).h- is a coefficient ring element.- Returns:
- B with B(x1, ..., x(r-1), xr) = A(x1, ..., x(r-1), xr+h).
- See Also:
- "maspoly.SACIPOL.mi#IPTRAN from SAC2/MAS"
-
translationMainRecursive
public static <C extends RingElem<C>> GenPolynomial<GenPolynomial<C>> translationMainRecursive(GenPolynomial<GenPolynomial<C>> A, C h)
Polynomial translation, main variable.- Type Parameters:
C- coefficient type.- Parameters:
A- is a non-zero recursive polynomial in r variables, A(x_1, ..., x(r-1))(x_r).h- is a coefficient ring element.- Returns:
- B with B(x1, ..., x(r-1))(xr) = A(x1, ..., x(r-1))(xr+h).
- See Also:
- "maspoly.SACIPOL.mi#IPTRAN from SAC2/MAS"
-
translationBase
public static <C extends RingElem<C>> GenPolynomial<C> translationBase(GenPolynomial<C> A, C h)
Polynomial translation, base univariate.- Type Parameters:
C- coefficient type.- Parameters:
A- is a non-zero polynomial in 1 variables, A(x_1).h- is a coefficient ring element.- Returns:
- B with B(x1) = A(x1+h1).
- See Also:
- "maspoly.SACIPOL.mi#IPTRAN from SAC2/MAS"
-
translation
public static <C extends RingElem<C>> GenPolynomial<C> translation(GenPolynomial<C> A, java.util.List<C> H)
Polynomial translation, all variables.- Type Parameters:
C- coefficient type.- Parameters:
A- is a non-zero polynomial in r variables, A(x_1, ..., x(r-1), x_r).H- is a list of coefficient ring elements H = (h1, ..., hr).- Returns:
- B with B(x1, ..., x(r-1), xr) = A(x1+h1, ..., x(r-1)+h(r-1), xr+hr).
- See Also:
- "maspoly.SACIPOL.mi#IPTRAN from SAC2/MAS"
-
translation1
public static <C extends RingElem<C>> GenPolynomial<C> translation1(GenPolynomial<C> A, java.util.List<C> H)
Polynomial translation, r-1 variables.- Type Parameters:
C- coefficient type.- Parameters:
A- is a non-zero polynomial in r variables, A(x_1, ..., x(r-1), x_r).H- is a list of coefficient ring elements H = (h2, ..., hr).- Returns:
- B with B(x1, ..., x(r-1), xr) = A(x1, x2+h2, ..., x(r-1)+h(r-1), xr+hr).
- See Also:
- "maspoly.SACIPOL.mi#IPTRAN from SAC2/MAS"
-
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. Could also be calledevaluateFirst(), but type erasure of parameterAdoes not allow the same name.- 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- recursive polynomial to be evaluated.a- value to evaluate at.- Returns:
- A( a, x_2, ..., x_n).
-
evaluateAll
public static <C extends RingElem<C>> java.util.List<C> evaluateAll(RingFactory<C> cfac, java.util.List<GenPolynomial<C>> L, java.util.List<C> a)
Evaluate all variables.- Type Parameters:
C- coefficient type.- Parameters:
cfac- coefficient ring factory.L- list of polynomials to be evaluated.a- = (a_1, a_2, ..., a_n) a tuple of values to evaluate at.- Returns:
- L = ( A_1(a_1, a_2, ..., a_n), ... A_k(a_1, a_2, ..., a_n)).
-
evaluateAll
public static <C extends RingElem<C>> C evaluateAll(RingFactory<C> cfac, GenPolynomial<C> A, java.util.List<C> a)
Evaluate all variables.- Type Parameters:
C- coefficient type.- Parameters:
cfac- coefficient ring 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 f(x <- t).
-
substituteUnivariateMult
public static <C extends RingElem<C>> GenPolynomial<C> substituteUnivariateMult(GenPolynomial<C> f, GenPolynomial<C> t)
Substitute univariate polynomial with multivariate coefficients.- Parameters:
f- univariate polynomial with multivariate coefficients.t- polynomial for substitution.- Returns:
- polynomial f(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- GenPolynomialresult 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- GenPolynomialresult 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)
Total degree of polynomial list.- Returns:
- total degree of the polynomial list.
-
maxDegree
public static <C extends RingElem<C>> long maxDegree(java.util.List<GenPolynomial<C>> P)
Maximal degree of polynomial list.- Returns:
- maximal 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.
-
intersect
public static <C extends RingElem<C>> java.util.List<GenPolynomial<C>> intersect(GenPolynomialRing<C> R, java.util.List<GenPolynomial<C>> F)
Intersection. Intersection of a list of polynomials with a polynomial ring. The polynomial ring must be a contraction of the polynomial ring of the list of polynomials and the TermOrder must be an elimination order.- Parameters:
R- polynomial ringF- list of polynomials- Returns:
- R \cap F
-
intersect
public static <C extends RingElem<C>> java.util.List<GenSolvablePolynomial<C>> intersect(GenSolvablePolynomialRing<C> R, java.util.List<GenSolvablePolynomial<C>> F)
Intersection. Intersection of a list of solvable polynomials with a solvable polynomial ring. The solvable polynomial ring must be a contraction of the solvable polynomial ring of the list of polynomials and the TermOrder must be an elimination order.- Parameters:
R- solvable polynomial ringF- list of solvable polynomials- Returns:
- R \cap F
-
intersect
public static <C extends RingElem<C>> java.util.List<GenWordPolynomial<C>> intersect(GenWordPolynomialRing<C> R, java.util.List<GenWordPolynomial<C>> F)
Intersection. Intersection of a list of word polynomials with a word polynomial ring. The polynomial ring must be a contraction of the polynomial ring of the list of polynomials,- Parameters:
R- word polynomial ringF- list of word polynomials- Returns:
- R \cap F
-
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
-
removeUnusedMiddleVariables
public static <C extends RingElem<C>> GenPolynomial<C> removeUnusedMiddleVariables(GenPolynomial<C> p)
Remove upper block of middle 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
-
-