Class SimpleFieldExtension<E extends IUnivariatePolynomial<E>>

• 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
• 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
• 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)
• 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]
• 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
• hashCode

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

public String toString​(String... variables)