## Class SimpleFieldExtension<E extends IUnivariatePolynomial<E>>

• ### Constructor Summary

Constructors
Modifier Constructor Description
`protected ` `SimpleFieldExtension​(E minimalPoly)`
Constructs a simple field extension `F(α)` generated by the algebraic number `α` with the specified minimal polynomial.
• ### Method Summary

Modifier and Type Method Description
`E` ```add​(E a, E b)```
`E` ```addMutable​(E a, E b)```
Adds two elements and destroys the initial content of `a`.
`<Term extends AMonomial<Term>,​mPoly extends AMultivariatePolynomial<Term,​mPoly>>MultipleFieldExtension<Term,​mPoly,​E>` `asMultipleExtension()`
Returns a view of this as a multiple field extension
`BigInteger` `cardinality()`
Returns the number of elements in this ring (cardinality) or null if ring is infinite
`BigInteger` `characteristic()`
Returns characteristic of this ring
`int` ```compare​(E o1, E o2)```
`E` `conjugatesProduct​(E element)`
Gives the product of all conjugates of given element (except element itself), that is ```norm(element) / element```
`E` `copy​(E element)`
Makes a deep copy of the specified element (for immutable instances the same reference returned).
`E[]` `createArray​(int length)`
Creates generic array of ring elements of specified length
`E[][]` `createArray2d​(int length)`
Creates 2d array of ring elements of specified length
`E[][]` ```createArray2d​(int m, int n)```
Creates 2d array of ring elements of specified shape
`int` `degree()`
Returns the degree of this filed extension (that is the degree of minimal polynomial)
`boolean` `equals​(Object o)`
`FactorDecomposition<E>` `factor​(E element)`
Factor specified element
`E` `factory()`
Factory polynomial
`E` `generator()`
Returns the generator element `α` of this field extension `F(α)`
`E` `getMinimalPolynomial()`
Returns the minimal polynomial of the generator (that is the "modulo" polynomial `p(x)` of this field viewed as quotient field `F[x]/<p(x)>`)
`E` `getMinimalPolynomialRef()`
INTERNAL
`E` `getOne()`
Returns unit element of this ring (one)
`E` `getZero()`
Returns zero element of this ring
`int` `hashCode()`
`boolean` `isEuclideanRing()`
Returns whether this ring is a Euclidean ring
`boolean` `isInTheBaseField​(E element)`
Returns whether the given element belongs to the base field
`boolean` `isOne​(E element)`
Tests whether specified element is one (exactly)
`boolean` `isZero​(E element)`
Tests whether specified element is zero
`E` `minimalPolynomial​(E element)`
Computes minimal polynomial of a given algebraic element
`E` ```multiply​(E a, E b)```
Multiplies two elements
`E` ```multiplyMutable​(E a, E b)```
Multiplies two elements and destroys the initial content of `a`
`E` `negate​(E element)`
Negates the given element
`E` `negateMutable​(E element)`
Negates the given element and destroys the initial content of `element`
`E` `norm​(E element)`
Gives the norm of field extension element (it is always belongs to the base field)
`<MPoly extends AMultivariatePolynomial>MPoly` `normOfPolynomial​(MultivariatePolynomial<E> poly)`
Gives the norm of multivariate polynomial over this field extension, which is always a polynomial with the coefficients from the base field.
`E` `normOfPolynomial​(UnivariatePolynomial<E> poly)`
Gives the norm of univariate polynomial over this field extension, which is always a polynomial with the coefficients from the base field
`int` `nVariables()`
Number of polynomial variables
`E` `parse​(String string)`
Parse string into ring element
`E` `randomElement​(org.apache.commons.math3.random.RandomGenerator rnd)`
Returns a random element from this ring
`E` `reciprocal​(E element)`
Gives the inverse element `element ^ (-1) `
`protected boolean` `shouldReduceFast​(int dividendDegree)`
empiric to switch between fast and plain division
`E` ```subtract​(E a, E b)```
Subtracts `b` from `a`
`E` ```subtractMutable​(E a, E b)```
Subtracts `b` from `a` and destroys the initial content of `a`
`String` `toString()`
`String` `toString​(IStringifier<E> stringifier)`
convert this to string with the use of stringifier
`String` `toString​(String... variables)`
`E` `trace​(E element)`
Gives the trace of field extension element (it is always belongs to the base field)
`E` `valueOf​(long val)`
Returns ring element associated with specified `long`
`E` `valueOf​(E val)`
Converts a value from other ring to this ring.
`E` `valueOfBigInteger​(BigInteger val)`
Returns ring element associated with specified integer
`E` `variable​(int variable)`
Creates poly representing a single specified variable
• ### Methods inherited from class cc.redberry.rings.ARing

`isPerfectPower, perfectPowerBase, perfectPowerExponent`
• ### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
• ### Methods inherited from interface java.util.Comparator

`reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`
• ### Methods inherited from interface cc.redberry.rings.poly.IPolynomialRing

`mkCoder, parse, signum`
• ### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`
• ### Methods inherited from interface cc.redberry.rings.Ring

`abs, add, createArray, createArray, createArray, createZeroesArray, createZeroesArray2d, decrement, divideAndRemainder, divideExact, divideExactMutable, divideOrNull, extendedGCD, factorial, factorSquareFree, fillZeros, firstBezoutCoefficient, gcd, gcd, gcd, getNegativeOne, increment, isField, isFinite, isFiniteField, isMinusOne, isPerfectPower, isUnit, isUnitOrZero, iterator, lcm, lcm, lcm, max, min, multiply, multiply, multiply, perfectPowerBase, perfectPowerExponent, pow, pow, pow, quotient, randomElement, randomElementTree, randomElementTree, randomNonZeroElement, remainder, setToValueOf, valueOf`
• ### Constructor Detail

• #### SimpleFieldExtension

`protected SimpleFieldExtension​(E minimalPoly)`
Constructs a simple field extension `F(α)` generated by the algebraic number `α` with the specified minimal polynomial.

NOTE: irreducibility test for the minimal polynomial is not performed here, use `IrreduciblePolynomials.irreducibleQ(IUnivariatePolynomial)` to test irreducibility.

Parameters:
`minimalPoly` - the minimal polynomial
• ### Method Detail

• #### isInTheBaseField

`public boolean isInTheBaseField​(E element)`
Returns whether the given element belongs to the base field
• #### generator

`public E generator()`
Returns the generator element `α` of this field extension `F(α)`
• #### degree

`public int degree()`
Returns the degree of this filed extension (that is the degree of minimal polynomial)
• #### getMinimalPolynomial

`public E getMinimalPolynomial()`
Returns the minimal polynomial of the generator (that is the "modulo" polynomial `p(x)` of this field viewed as quotient field `F[x]/<p(x)>`)
• #### getMinimalPolynomialRef

`public E getMinimalPolynomialRef()`
INTERNAL
• #### norm

`public E norm​(E element)`
Gives the norm of field extension element (it is always belongs to the base field)
• #### conjugatesProduct

`public E conjugatesProduct​(E element)`
Gives the product of all conjugates of given element (except element itself), that is ```norm(element) / element```
• #### trace

`public E trace​(E element)`
Gives the trace of field extension element (it is always belongs to the base field)
• #### normOfPolynomial

`public E normOfPolynomial​(UnivariatePolynomial<E> poly)`
Gives the norm of univariate polynomial over this field extension, which is always a polynomial with the coefficients from the base field
• #### normOfPolynomial

`public <MPoly extends AMultivariatePolynomial> MPoly normOfPolynomial​(MultivariatePolynomial<E> poly)`
Gives the norm of multivariate polynomial over this field extension, which is always a polynomial with the coefficients from the base field.
• #### minimalPolynomial

`public E minimalPolynomial​(E element)`
Computes minimal polynomial of a given algebraic element
• #### asMultipleExtension

`public <Term extends AMonomial<Term>,​mPoly extends AMultivariatePolynomial<Term,​mPoly>> MultipleFieldExtension<Term,​mPoly,​E> asMultipleExtension()`
Returns a view of this as a multiple field extension
• #### nVariables

`public int nVariables()`
Description copied from interface: `IPolynomialRing`
Number of polynomial variables
Specified by:
`nVariables` in interface `IPolynomialRing<E extends IUnivariatePolynomial<E>>`
• #### factory

`public E factory()`
Description copied from interface: `IPolynomialRing`
Factory polynomial
Specified by:
`factory` in interface `IPolynomialRing<E extends IUnivariatePolynomial<E>>`
• #### isEuclideanRing

`public boolean isEuclideanRing()`
Description copied from interface: `Ring`
Returns whether this ring is a Euclidean ring
Specified by:
`isEuclideanRing` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Returns:
whether this ring is a Euclidean ring
• #### cardinality

`public BigInteger cardinality()`
Description copied from interface: `Ring`
Returns the number of elements in this ring (cardinality) or null if ring is infinite
Specified by:
`cardinality` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Returns:
the number of elements in this ring (cardinality) or null if ring is infinite
• #### characteristic

`public BigInteger characteristic()`
Description copied from interface: `Ring`
Returns characteristic of this ring
Specified by:
`characteristic` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Returns:
characteristic of this ring
• #### shouldReduceFast

`protected boolean shouldReduceFast​(int dividendDegree)`
empiric to switch between fast and plain division

```public E add​(E a,
E b)```
Description copied from interface: `Ring`
Specified by:
`add` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`a` - the first element
`b` - the second element
Returns:
a + b
• #### subtract

```public E subtract​(E a,
E b)```
Description copied from interface: `Ring`
Subtracts `b` from `a`
Specified by:
`subtract` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`a` - the first element
`b` - the second element
Returns:
a - b
• #### multiply

```public E multiply​(E a,
E b)```
Description copied from interface: `Ring`
Multiplies two elements
Specified by:
`multiply` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`a` - the first element
`b` - the second element
Returns:
a * b
• #### negate

`public E negate​(E element)`
Description copied from interface: `Ring`
Negates the given element
Specified by:
`negate` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`element` - the ring element
Returns:
-val

```public E addMutable​(E a,
E b)```
Description copied from interface: `Ring`
Adds two elements and destroys the initial content of `a`.
Specified by:
`addMutable` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`a` - the first element (may be destroyed)
`b` - the second element
Returns:
a + b
• #### subtractMutable

```public E subtractMutable​(E a,
E b)```
Description copied from interface: `Ring`
Subtracts `b` from `a` and destroys the initial content of `a`
Specified by:
`subtractMutable` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`a` - the first element (may be destroyed)
`b` - the second element
Returns:
a - b
• #### multiplyMutable

```public E multiplyMutable​(E a,
E b)```
Description copied from interface: `Ring`
Multiplies two elements and destroys the initial content of `a`
Specified by:
`multiplyMutable` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`a` - the first element (may be destroyed)
`b` - the second element
Returns:
a * b
• #### negateMutable

`public E negateMutable​(E element)`
Description copied from interface: `Ring`
Negates the given element and destroys the initial content of `element`
Specified by:
`negateMutable` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`element` - the ring element (may be destroyed)
Returns:
-element
• #### reciprocal

`public E reciprocal​(E element)`
Description copied from interface: `Ring`
Gives the inverse element `element ^ (-1) `
Specified by:
`reciprocal` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`element` - the element
Returns:
`element ^ (-1)`
• #### factor

`public FactorDecomposition<E> factor​(E element)`
Description copied from interface: `Ring`
Factor specified element
Specified by:
`factor` in interface `Ring<E extends IUnivariatePolynomial<E>>`
• #### getZero

`public E getZero()`
Description copied from interface: `Ring`
Returns zero element of this ring
Specified by:
`getZero` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Returns:
0
• #### getOne

`public E getOne()`
Description copied from interface: `Ring`
Returns unit element of this ring (one)
Specified by:
`getOne` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Returns:
1
• #### isZero

`public boolean isZero​(E element)`
Description copied from interface: `Ring`
Tests whether specified element is zero
Specified by:
`isZero` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`element` - the ring element
Returns:
whether specified element is zero
• #### isOne

`public boolean isOne​(E element)`
Description copied from interface: `Ring`
Tests whether specified element is one (exactly)
Specified by:
`isOne` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`element` - the ring element
Returns:
whether specified element is exactly one
`Ring.isUnit(Object)`
• #### valueOf

`public E valueOf​(long val)`
Description copied from interface: `Ring`
Returns ring element associated with specified `long`
Specified by:
`valueOf` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`val` - machine integer
Returns:
ring element associated with specified `long`
• #### valueOfBigInteger

`public E valueOfBigInteger​(BigInteger val)`
Description copied from interface: `Ring`
Returns ring element associated with specified integer
Specified by:
`valueOfBigInteger` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`val` - integer
Returns:
ring element associated with specified integer
• #### valueOf

`public E valueOf​(E val)`
Description copied from interface: `Ring`
Converts a value from other ring to this ring. The result is not guarantied to be a new instance (i.e. ```val == valueOf(val)``` is possible).
Specified by:
`valueOf` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`val` - some element from any ring
Returns:
this ring element associated with specified `val`
• #### copy

`public E copy​(E element)`
Description copied from interface: `Ring`
Makes a deep copy of the specified element (for immutable instances the same reference returned).
Specified by:
`copy` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`element` - the element
Returns:
deep copy of specified element
• #### createArray

`public E[] createArray​(int length)`
Description copied from interface: `Ring`
Creates generic array of ring elements of specified length
Specified by:
`createArray` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`length` - array length
Returns:
array of ring elements of specified `length`
• #### createArray2d

`public E[][] createArray2d​(int length)`
Description copied from interface: `Ring`
Creates 2d array of ring elements of specified length
Specified by:
`createArray2d` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`length` - array length
Returns:
2d array of ring elements of specified `length`
• #### createArray2d

```public E[][] createArray2d​(int m,
int n)```
Description copied from interface: `Ring`
Creates 2d array of ring elements of specified shape
Specified by:
`createArray2d` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`m` - result length
`n` - length of each array in the result
Returns:
2d array E[m][n]
• #### compare

```public int compare​(E o1,
E o2)```
Specified by:
`compare` in interface `Comparator<E extends IUnivariatePolynomial<E>>`
• #### randomElement

`public E randomElement​(org.apache.commons.math3.random.RandomGenerator rnd)`
Description copied from interface: `Ring`
Returns a random element from this ring
Specified by:
`randomElement` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`rnd` - the source of randomness
Returns:
random element from this ring
• #### variable

`public E variable​(int variable)`
Description copied from interface: `IPolynomialRing`
Creates poly representing a single specified variable
Specified by:
`variable` in interface `IPolynomialRing<E extends IUnivariatePolynomial<E>>`
• #### parse

`public E parse​(String string)`
Description copied from interface: `Ring`
Parse string into ring element
Specified by:
`parse` in interface `IParser<E extends IUnivariatePolynomial<E>>`
Specified by:
`parse` in interface `Ring<E extends IUnivariatePolynomial<E>>`
Parameters:
`string` - string
Returns:
ring element
`Coder`
• #### equals

`public boolean equals​(Object o)`
Specified by:
`equals` in interface `Comparator<E extends IUnivariatePolynomial<E>>`
Overrides:
`equals` in class `Object`
• #### hashCode

`public int hashCode()`
Overrides:
`hashCode` in class `Object`
• #### toString

`public String toString​(IStringifier<E> stringifier)`
Description copied from interface: `Stringifiable`
convert this to string with the use of stringifier
Specified by:
`toString` in interface `Stringifiable<E extends IUnivariatePolynomial<E>>`
• #### toString

`public String toString​(String... variables)`
• #### toString

`public String toString()`
Overrides:
`toString` in class `Object`