public abstract class SimpleFieldExtension<E extends IUnivariatePolynomial<E>> extends ARing<E> implements IPolynomialRing<E>
F(α)
represented as a univariate quotient ring F[x]/<m(x)>
where m(x)
is the minimal polynomial of α
. Elements of extension field are represented as univariate polynomials
in α
. To create simple field extensions one should use either FiniteField
for extensions of finite
fields or AlgebraicNumberField
for extensions of rationals. See MultipleFieldExtension
for
implementation of multiple extensions.Modifier | Constructor and Description |
---|---|
protected |
SimpleFieldExtension(E minimalPoly)
Constructs a simple field extension
F(α) generated by the algebraic number α with the specified
minimal polynomial. |
Modifier and Type | Method and Description |
---|---|
E |
add(E a,
E b)
Add two elements
|
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>> |
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> |
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(E val)
Converts a value from other ring to this ring.
|
E |
valueOf(long val)
Returns ring element associated with specified
long |
E |
valueOfBigInteger(BigInteger val)
Returns ring element associated with specified integer
|
E |
variable(int variable)
Creates poly representing a single specified variable
|
isPerfectPower, perfectPowerBase, perfectPowerExponent
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
mkCoder, parse, signum
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
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
forEach, spliterator
protected SimpleFieldExtension(E minimalPoly)
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.
minimalPoly
- the minimal polynomialpublic boolean isInTheBaseField(E element)
public E generator()
α
of this field extension F(α)
public int degree()
public E getMinimalPolynomial()
p(x)
of this field
viewed as quotient field F[x]/<p(x)>
)public E getMinimalPolynomialRef()
public E norm(E element)
public E conjugatesProduct(E element)
norm(element) /
element
public E trace(E element)
public E normOfPolynomial(UnivariatePolynomial<E> poly)
public <MPoly extends AMultivariatePolynomial> MPoly normOfPolynomial(MultivariatePolynomial<E> poly)
public E minimalPolynomial(E element)
public <Term extends AMonomial<Term>,mPoly extends AMultivariatePolynomial<Term,mPoly>> MultipleFieldExtension<Term,mPoly,E> asMultipleExtension()
public int nVariables()
IPolynomialRing
nVariables
in interface IPolynomialRing<E extends IUnivariatePolynomial<E>>
public E factory()
IPolynomialRing
factory
in interface IPolynomialRing<E extends IUnivariatePolynomial<E>>
public boolean isEuclideanRing()
Ring
isEuclideanRing
in interface Ring<E extends IUnivariatePolynomial<E>>
public BigInteger cardinality()
Ring
cardinality
in interface Ring<E extends IUnivariatePolynomial<E>>
public BigInteger characteristic()
Ring
characteristic
in interface Ring<E extends IUnivariatePolynomial<E>>
protected boolean shouldReduceFast(int dividendDegree)
public E add(E a, E b)
Ring
add
in interface Ring<E extends IUnivariatePolynomial<E>>
a
- the first elementb
- the second elementpublic E subtract(E a, E b)
Ring
b
from a
subtract
in interface Ring<E extends IUnivariatePolynomial<E>>
a
- the first elementb
- the second elementpublic E multiply(E a, E b)
Ring
multiply
in interface Ring<E extends IUnivariatePolynomial<E>>
a
- the first elementb
- the second elementpublic E negate(E element)
Ring
negate
in interface Ring<E extends IUnivariatePolynomial<E>>
element
- the ring elementpublic E addMutable(E a, E b)
Ring
a
.addMutable
in interface Ring<E extends IUnivariatePolynomial<E>>
a
- the first element (may be destroyed)b
- the second elementpublic E subtractMutable(E a, E b)
Ring
b
from a
and destroys the initial content of a
subtractMutable
in interface Ring<E extends IUnivariatePolynomial<E>>
a
- the first element (may be destroyed)b
- the second elementpublic E multiplyMutable(E a, E b)
Ring
a
multiplyMutable
in interface Ring<E extends IUnivariatePolynomial<E>>
a
- the first element (may be destroyed)b
- the second elementpublic E negateMutable(E element)
Ring
element
negateMutable
in interface Ring<E extends IUnivariatePolynomial<E>>
element
- the ring element (may be destroyed)public E reciprocal(E element)
Ring
element ^ (-1)
reciprocal
in interface Ring<E extends IUnivariatePolynomial<E>>
element
- the elementelement ^ (-1)
public FactorDecomposition<E> factor(E element)
Ring
factor
in interface Ring<E extends IUnivariatePolynomial<E>>
public E getZero()
Ring
getZero
in interface Ring<E extends IUnivariatePolynomial<E>>
public E getOne()
Ring
getOne
in interface Ring<E extends IUnivariatePolynomial<E>>
public boolean isZero(E element)
Ring
isZero
in interface Ring<E extends IUnivariatePolynomial<E>>
element
- the ring elementpublic boolean isOne(E element)
Ring
isOne
in interface Ring<E extends IUnivariatePolynomial<E>>
element
- the ring elementRing.isUnit(Object)
public E valueOf(long val)
Ring
long
valueOf
in interface Ring<E extends IUnivariatePolynomial<E>>
val
- machine integerlong
public E valueOfBigInteger(BigInteger val)
Ring
valueOfBigInteger
in interface Ring<E extends IUnivariatePolynomial<E>>
val
- integerpublic E valueOf(E val)
Ring
val
== valueOf(val)
is possible).valueOf
in interface Ring<E extends IUnivariatePolynomial<E>>
val
- some element from any ringval
public E copy(E element)
Ring
copy
in interface Ring<E extends IUnivariatePolynomial<E>>
element
- the elementpublic E[] createArray(int length)
Ring
createArray
in interface Ring<E extends IUnivariatePolynomial<E>>
length
- array lengthlength
public E[][] createArray2d(int length)
Ring
createArray2d
in interface Ring<E extends IUnivariatePolynomial<E>>
length
- array lengthlength
public E[][] createArray2d(int m, int n)
Ring
createArray2d
in interface Ring<E extends IUnivariatePolynomial<E>>
m
- result lengthn
- length of each array in the resultpublic int compare(E o1, E o2)
compare
in interface Comparator<E extends IUnivariatePolynomial<E>>
public E randomElement(org.apache.commons.math3.random.RandomGenerator rnd)
Ring
randomElement
in interface Ring<E extends IUnivariatePolynomial<E>>
rnd
- the source of randomnesspublic E variable(int variable)
IPolynomialRing
variable
in interface IPolynomialRing<E extends IUnivariatePolynomial<E>>
public E parse(String string)
Ring
public boolean equals(Object o)
equals
in interface Comparator<E extends IUnivariatePolynomial<E>>
equals
in class Object
public String toString(IStringifier<E> stringifier)
Stringifiable
toString
in interface Stringifiable<E extends IUnivariatePolynomial<E>>
Copyright © 2018. All rights reserved.