Package cc.redberry.rings.poly
Class MultipleFieldExtension<Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>>
- java.lang.Object
-
- cc.redberry.rings.ImageRing<sPoly,mPoly>
-
- cc.redberry.rings.poly.MultipleFieldExtension<Term,mPoly,sPoly>
-
- All Implemented Interfaces:
IParser<mPoly>,Stringifiable<mPoly>,IPolynomialRing<mPoly>,Ring<mPoly>,Serializable,Iterable<mPoly>,Comparator<mPoly>
public class MultipleFieldExtension<Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>> extends ImageRing<sPoly,mPoly> implements IPolynomialRing<mPoly>
Multiple field extensionF(α_1, α_2, ..., α_N). Elements are represented as multivariate polynomials over(α_1, α_2, ..., α_N); internally all arithmetic operations are performed by switching to appropriate simple field extensionF(γ)(accessible viagetSimpleExtension()method) whereγis some primitive element (accessible viagetPrimitiveElement()method) computed automatically. Representation of generating algebraic elementsα_ias elements of this simple extension can be obtained viagetGeneratorRep(int)method. Originally, generators are represented by their minimal polynomials overF(α_1, α_2, ..., α_i)("tower" representation). To construct multiple field extensions one should use {@link #mkMultipleExtension(...)} andjoinAlgebraicElement(UnivariatePolynomial).
-
-
Field Summary
-
Fields inherited from class cc.redberry.rings.ImageRing
imageFunc, inverseFunc, ring
-
-
Constructor Summary
Constructors Constructor Description MultipleFieldExtension(MultipleFieldExtension<Term,mPoly,sPoly>[] tower, UnivariatePolynomial<mPoly>[] minimalPolynomialsOfGenerators, mPoly primitiveElement, sPoly[] generatorsReps, SimpleFieldExtension<sPoly> simpleExtension)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description mPolycopy(mPoly element)Makes a deep copy of the specified element (for immutable instances the same reference returned).intdegree()Returns the degree of this filed extension (that is the degree of primitive element)booleanequals(Object o)mPoly[]extendedGCD(mPoly a, mPoly b)Returns array of[gcd(a,b), s, t]such thats * a + t * b = gcd(a, b)mPolyfactorial(long num)Gives a product ofvalueOf(1) * valueOf(2) * .... * valueOf(num)mPolyfactory()Factory polynomialmPolygcd(Iterable<mPoly> elements)Returns greatest common divisor of specified elementsmPolygcd(mPoly... elements)Returns greatest common divisor of specified elementsmPolygcd(mPoly a, mPoly b)Returns the greatest common divisor of two elementsUnivariatePolynomial<mPoly>getGeneratorMinimalPoly(int iGenerator)Returns minimal polynomial corresponding to i-th generator.sPolygetGeneratorRep(int iGenerator)Returns representation of i-th generator as element of simple field extension generated by primitive elementgetPrimitiveElement()sPoly[]getGeneratorReps()Returns representation of generators as elements of simple field extension generated by primitive elementgetPrimitiveElement()mPolygetOne()Returns unit element of this ring (one)mPolygetPrimitiveElement()Returns the primitive element of this multiple field extensionSimpleFieldExtension<sPoly>getSimpleExtension()Returns the isomorphic simple field extension generated bygetPrimitiveElement()MultipleFieldExtension<Term,mPoly,sPoly>getSubExtension(int i)Returns the i-th extension from the towersPolygetUnivariateFactory()mPolygetZero()Returns zero element of this ringinthashCode()booleanisOne(mPoly element)Tests whether specified element is one (exactly)booleanisUnit(mPoly element)Tests whether specified element is a ring unitbooleanisZero(mPoly element)Tests whether specified element is zeroMultipleFieldExtension<Term,mPoly,sPoly>joinAlgebraicElement(UnivariatePolynomial<mPoly> algebraicElement)Adds algebraic element given by its minimal polynomial (not checked that it is irreducible) to this.MultipleFieldExtension<Term,mPoly,sPoly>joinAlgebraicElement(sPoly minimalPoly)Adds algebraic element given by its minimal polynomial (not checked that it is irreducible) to this.MultipleFieldExtension<Term,mPoly,sPoly>joinRedundantElement(mPoly element)Adds algebraic element given by its minimal polynomial (not checked that it is irreducible) to this.mPolylcm(mPoly a, mPoly b)Returns the least common multiple of two elementsstatic <Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>>
MultipleFieldExtension<Term,mPoly,sPoly>mkMultipleExtension(SimpleFieldExtension<sPoly> ext)static <Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>>
MultipleFieldExtension<Term,mPoly,sPoly>mkMultipleExtension(sPoly a)static <Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>>
MultipleFieldExtension<Term,mPoly,sPoly>mkMultipleExtension(sPoly... minimalPolynomials)Creates multiple field extensionF(α_1, α_2, ..., α_i)whereα_iare specified by their minimal polynomials over F.static <Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>>
MultipleFieldExtension<Term,mPoly,sPoly>mkSplittingField(sPoly poly)Constructs splitting field for a given polynomial.intnVariables()Number of polynomial variablesintsignum(mPoly element)Returns -1 ifelement < 0, 0 ifelement == 0and 1 ifelement > 0, where comparison is specified byComparator.compare(Object, Object)StringtoString()StringtoString(IStringifier stringifier)convert this to string with the use of stringifierStringtoString(String... variables)mPolyvalueOf(long val)Returns ring element associated with specifiedlongmPolyvalueOfBigInteger(BigInteger val)Returns ring element associated with specified integermPolyvariable(int variable)Creates poly representing a single specified variable-
Methods inherited from class cc.redberry.rings.ImageRing
abs, add, add, cardinality, characteristic, compare, decrement, divideAndRemainder, factor, factorSquareFree, image, image, increment, inverse, inverse, isEuclideanRing, isField, isPerfectPower, iterator, multiply, multiply, negate, parse, perfectPowerBase, perfectPowerExponent, pow, pow, pow, quotient, randomElement, reciprocal, remainder, subtract, valueOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
compare, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface cc.redberry.rings.poly.IPolynomialRing
mkCoder, parse
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface cc.redberry.rings.Ring
abs, add, add, addMutable, cardinality, characteristic, createArray, createArray, createArray, createArray, createArray2d, createArray2d, createZeroesArray, createZeroesArray2d, decrement, divideAndRemainder, divideExact, divideExactMutable, divideOrNull, factor, factorSquareFree, fillZeros, firstBezoutCoefficient, getNegativeOne, increment, isEuclideanRing, isField, isFinite, isFiniteField, isMinusOne, isPerfectPower, isUnitOrZero, iterator, lcm, lcm, max, min, multiply, multiply, multiply, multiply, multiplyMutable, negate, negateMutable, parse, perfectPowerBase, perfectPowerExponent, pow, pow, pow, quotient, randomElement, randomElement, randomElementTree, randomElementTree, randomNonZeroElement, reciprocal, remainder, setToValueOf, subtract, subtractMutable, valueOf, valueOf
-
-
-
-
Constructor Detail
-
MultipleFieldExtension
public MultipleFieldExtension(MultipleFieldExtension<Term,mPoly,sPoly>[] tower, UnivariatePolynomial<mPoly>[] minimalPolynomialsOfGenerators, mPoly primitiveElement, sPoly[] generatorsReps, SimpleFieldExtension<sPoly> simpleExtension)
-
-
Method Detail
-
nVariables
public int nVariables()
Description copied from interface:IPolynomialRingNumber of polynomial variables- Specified by:
nVariablesin interfaceIPolynomialRing<Term extends AMonomial<Term>>
-
factory
public mPoly factory()
Description copied from interface:IPolynomialRingFactory polynomial- Specified by:
factoryin interfaceIPolynomialRing<Term extends AMonomial<Term>>
-
variable
public mPoly variable(int variable)
Description copied from interface:IPolynomialRingCreates poly representing a single specified variable- Specified by:
variablein interfaceIPolynomialRing<Term extends AMonomial<Term>>
-
getUnivariateFactory
public sPoly getUnivariateFactory()
-
getPrimitiveElement
public mPoly getPrimitiveElement()
Returns the primitive element of this multiple field extension
-
degree
public int degree()
Returns the degree of this filed extension (that is the degree of primitive element)
-
getSimpleExtension
public SimpleFieldExtension<sPoly> getSimpleExtension()
Returns the isomorphic simple field extension generated bygetPrimitiveElement()
-
getGeneratorMinimalPoly
public UnivariatePolynomial<mPoly> getGeneratorMinimalPoly(int iGenerator)
Returns minimal polynomial corresponding to i-th generator.
-
getSubExtension
public MultipleFieldExtension<Term,mPoly,sPoly> getSubExtension(int i)
Returns the i-th extension from the tower
-
getGeneratorRep
public sPoly getGeneratorRep(int iGenerator)
Returns representation of i-th generator as element of simple field extension generated by primitive elementgetPrimitiveElement()
-
getGeneratorReps
public sPoly[] getGeneratorReps()
Returns representation of generators as elements of simple field extension generated by primitive elementgetPrimitiveElement()
-
joinAlgebraicElement
public MultipleFieldExtension<Term,mPoly,sPoly> joinAlgebraicElement(UnivariatePolynomial<mPoly> algebraicElement)
Adds algebraic element given by its minimal polynomial (not checked that it is irreducible) to this.
-
joinAlgebraicElement
public MultipleFieldExtension<Term,mPoly,sPoly> joinAlgebraicElement(sPoly minimalPoly)
Adds algebraic element given by its minimal polynomial (not checked that it is irreducible) to this.
-
joinRedundantElement
public MultipleFieldExtension<Term,mPoly,sPoly> joinRedundantElement(mPoly element)
Adds algebraic element given by its minimal polynomial (not checked that it is irreducible) to this.
-
valueOf
public mPoly valueOf(long val)
Description copied from interface:RingReturns ring element associated with specifiedlong
-
valueOfBigInteger
public mPoly valueOfBigInteger(BigInteger val)
Description copied from interface:RingReturns ring element associated with specified integer- Specified by:
valueOfBigIntegerin interfaceRing<Term extends AMonomial<Term>>- Overrides:
valueOfBigIntegerin classImageRing<sPoly extends IUnivariatePolynomial<sPoly>,mPoly extends AMultivariatePolynomial<Term,mPoly>>- Parameters:
val- integer- Returns:
- ring element associated with specified integer
-
getZero
public mPoly getZero()
Description copied from interface:RingReturns zero element of this ring
-
getOne
public mPoly getOne()
Description copied from interface:RingReturns unit element of this ring (one)
-
copy
public mPoly copy(mPoly element)
Description copied from interface:RingMakes a deep copy of the specified element (for immutable instances the same reference returned).
-
isZero
public boolean isZero(mPoly element)
Description copied from interface:RingTests whether specified element is zero
-
isOne
public boolean isOne(mPoly element)
Description copied from interface:RingTests whether specified element is one (exactly)- Specified by:
isOnein interfaceRing<Term extends AMonomial<Term>>- Overrides:
isOnein classImageRing<sPoly extends IUnivariatePolynomial<sPoly>,mPoly extends AMultivariatePolynomial<Term,mPoly>>- Parameters:
element- the ring element- Returns:
- whether specified element is exactly one
- See Also:
Ring.isUnit(Object)
-
isUnit
public boolean isUnit(mPoly element)
Description copied from interface:RingTests whether specified element is a ring unit- Specified by:
isUnitin interfaceRing<Term extends AMonomial<Term>>- Overrides:
isUnitin classImageRing<sPoly extends IUnivariatePolynomial<sPoly>,mPoly extends AMultivariatePolynomial<Term,mPoly>>- Parameters:
element- the ring element- Returns:
- whether specified element is a ring unit
- See Also:
Ring.isOne(Object)
-
gcd
public mPoly gcd(mPoly a, mPoly b)
Description copied from interface:RingReturns the greatest common divisor of two elements
-
extendedGCD
public mPoly[] extendedGCD(mPoly a, mPoly b)
Description copied from interface:RingReturns array of[gcd(a,b), s, t]such thats * a + t * b = gcd(a, b)- Specified by:
extendedGCDin interfaceRing<Term extends AMonomial<Term>>- Overrides:
extendedGCDin classImageRing<sPoly extends IUnivariatePolynomial<sPoly>,mPoly extends AMultivariatePolynomial<Term,mPoly>>
-
lcm
public mPoly lcm(mPoly a, mPoly b)
Description copied from interface:RingReturns the least common multiple of two elements
-
gcd
public mPoly gcd(mPoly... elements)
Description copied from interface:RingReturns greatest common divisor of specified elements
-
gcd
public mPoly gcd(Iterable<mPoly> elements)
Description copied from interface:RingReturns greatest common divisor of specified elements
-
signum
public int signum(mPoly element)
Description copied from interface:RingReturns -1 ifelement < 0, 0 ifelement == 0and 1 ifelement > 0, where comparison is specified byComparator.compare(Object, Object)- Specified by:
signumin interfaceIPolynomialRing<Term extends AMonomial<Term>>- Specified by:
signumin interfaceRing<Term extends AMonomial<Term>>- Overrides:
signumin classImageRing<sPoly extends IUnivariatePolynomial<sPoly>,mPoly extends AMultivariatePolynomial<Term,mPoly>>- Parameters:
element- the element- Returns:
- -1 if
element < 0, 0 ifelement == 0and 1 otherwise
-
factorial
public mPoly factorial(long num)
Description copied from interface:RingGives a product ofvalueOf(1) * valueOf(2) * .... * valueOf(num)
-
equals
public boolean equals(Object o)
- Specified by:
equalsin interfaceComparator<Term extends AMonomial<Term>>- Overrides:
equalsin classImageRing<sPoly extends IUnivariatePolynomial<sPoly>,mPoly extends AMultivariatePolynomial<Term,mPoly>>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classImageRing<sPoly extends IUnivariatePolynomial<sPoly>,mPoly extends AMultivariatePolynomial<Term,mPoly>>
-
toString
public String toString(IStringifier stringifier)
Description copied from interface:Stringifiableconvert this to string with the use of stringifier- Specified by:
toStringin interfaceStringifiable<Term extends AMonomial<Term>>
-
mkMultipleExtension
public static <Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>> MultipleFieldExtension<Term,mPoly,sPoly> mkMultipleExtension(sPoly a)
-
mkMultipleExtension
public static <Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>> MultipleFieldExtension<Term,mPoly,sPoly> mkMultipleExtension(SimpleFieldExtension<sPoly> ext)
-
mkMultipleExtension
public static <Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>> MultipleFieldExtension<Term,mPoly,sPoly> mkMultipleExtension(sPoly... minimalPolynomials)
Creates multiple field extensionF(α_1, α_2, ..., α_i)whereα_iare specified by their minimal polynomials over F.NOTE: it is not tested that specified minimal polynomials are irreducible
- Parameters:
minimalPolynomials- minimal polynomials of algebraic elements
-
mkSplittingField
public static <Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>,sPoly extends IUnivariatePolynomial<sPoly>> MultipleFieldExtension<Term,mPoly,sPoly> mkSplittingField(sPoly poly)
Constructs splitting field for a given polynomial.
-
-