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, perfectPowerExponentclone, finalize, getClass, notify, notifyAll, wait, wait, waitmkCoder, parse, signumabs, 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, valueOfcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongforEach, spliteratorprotected 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) /
elementpublic 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()
IPolynomialRingnVariables in interface IPolynomialRing<E extends IUnivariatePolynomial<E>>public E factory()
IPolynomialRingfactory in interface IPolynomialRing<E extends IUnivariatePolynomial<E>>public boolean isEuclideanRing()
RingisEuclideanRing in interface Ring<E extends IUnivariatePolynomial<E>>public BigInteger cardinality()
Ringcardinality in interface Ring<E extends IUnivariatePolynomial<E>>public BigInteger characteristic()
Ringcharacteristic in interface Ring<E extends IUnivariatePolynomial<E>>protected boolean shouldReduceFast(int dividendDegree)
public E add(E a, E b)
Ringadd in interface Ring<E extends IUnivariatePolynomial<E>>a - the first elementb - the second elementpublic E subtract(E a, E b)
Ringb from asubtract in interface Ring<E extends IUnivariatePolynomial<E>>a - the first elementb - the second elementpublic E multiply(E a, E b)
Ringmultiply in interface Ring<E extends IUnivariatePolynomial<E>>a - the first elementb - the second elementpublic E negate(E element)
Ringnegate in interface Ring<E extends IUnivariatePolynomial<E>>element - the ring elementpublic E addMutable(E a, E b)
Ringa.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)
Ringb from a and destroys the initial content of asubtractMutable in interface Ring<E extends IUnivariatePolynomial<E>>a - the first element (may be destroyed)b - the second elementpublic E multiplyMutable(E a, E b)
RingamultiplyMutable in interface Ring<E extends IUnivariatePolynomial<E>>a - the first element (may be destroyed)b - the second elementpublic E negateMutable(E element)
RingelementnegateMutable in interface Ring<E extends IUnivariatePolynomial<E>>element - the ring element (may be destroyed)public E reciprocal(E element)
Ringelement ^ (-1) reciprocal in interface Ring<E extends IUnivariatePolynomial<E>>element - the elementelement ^ (-1)public FactorDecomposition<E> factor(E element)
Ringfactor in interface Ring<E extends IUnivariatePolynomial<E>>public E getZero()
RinggetZero in interface Ring<E extends IUnivariatePolynomial<E>>public E getOne()
RinggetOne in interface Ring<E extends IUnivariatePolynomial<E>>public boolean isZero(E element)
RingisZero in interface Ring<E extends IUnivariatePolynomial<E>>element - the ring elementpublic boolean isOne(E element)
RingisOne in interface Ring<E extends IUnivariatePolynomial<E>>element - the ring elementRing.isUnit(Object)public E valueOf(long val)
RinglongvalueOf in interface Ring<E extends IUnivariatePolynomial<E>>val - machine integerlongpublic E valueOfBigInteger(BigInteger val)
RingvalueOfBigInteger in interface Ring<E extends IUnivariatePolynomial<E>>val - integerpublic E valueOf(E val)
Ringval
== valueOf(val) is possible).valueOf in interface Ring<E extends IUnivariatePolynomial<E>>val - some element from any ringvalpublic E copy(E element)
Ringcopy in interface Ring<E extends IUnivariatePolynomial<E>>element - the elementpublic E[] createArray(int length)
RingcreateArray in interface Ring<E extends IUnivariatePolynomial<E>>length - array lengthlengthpublic E[][] createArray2d(int length)
RingcreateArray2d in interface Ring<E extends IUnivariatePolynomial<E>>length - array lengthlengthpublic E[][] createArray2d(int m, int n)
RingcreateArray2d 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)
RingrandomElement in interface Ring<E extends IUnivariatePolynomial<E>>rnd - the source of randomnesspublic E variable(int variable)
IPolynomialRingvariable in interface IPolynomialRing<E extends IUnivariatePolynomial<E>>public E parse(String string)
Ringpublic boolean equals(Object o)
equals in interface Comparator<E extends IUnivariatePolynomial<E>>equals in class Objectpublic String toString(IStringifier<E> stringifier)
StringifiabletoString in interface Stringifiable<E extends IUnivariatePolynomial<E>>Copyright © 2022. All rights reserved.