# Class FiniteField<E extends IUnivariatePolynomial<E>>

Type Parameters:
`E` - type of polynomials that represent elements of this Galois field
All Implemented Interfaces:
`IParser<E>`, `Stringifiable<E>`, `IPolynomialRing<E>`, `Ring<E>`, `Serializable`, `Iterable<E>`, `Comparator<E>`

```public final class FiniteField<E extends IUnivariatePolynomial<E>>
extends SimpleFieldExtension<E>```
Galois field `GF(p, q)`. Galois field is represented as a quotient ring `F[x]/<m(x)>` with given irreducible polynomial `m(x)` (minimal polynomial); cardinality of then field is than `p^q` where ``` p``` is the cardinality of `F` and `q` is the degree of minimal polynomial. Since Galois field is in fact a simple field extension it inherits all corresponding methods.
Since:
1.0
`AlgebraicNumberField`, `Rings.GF(IUnivariatePolynomial)`, `Rings.GF(long, int)`, Serialized Form
• ## Field Summary

Fields
Modifier and Type Field Description
`static FiniteField<UnivariatePolynomialZp64>` `GF17p5`
GF(17^5)
`static FiniteField<UnivariatePolynomialZp64>` `GF27`
GF(3^3)
• ## Constructor Summary

Constructors
Constructor Description
`FiniteField​(E minimalPoly)`
Constructs finite field from the specified irreducible polynomial.
• ## Method Summary

Modifier and Type Method Description
`E[]` ```divideAndRemainder​(E a, E b)```
Returns quotient and remainder of `dividend / divider`
`E` ```gcd​(E a, E b)```
Returns the greatest common divisor of two elements
`boolean` `isField()`
Returns whether this ring is a field
`boolean` `isUnit​(E element)`
Tests whether specified element is a ring unit
`Iterator<E>` `iterator()`
Returns iterator over all field elements
`E` ```remainder​(E dividend, E divider)```
Returns the remainder of `dividend / divider`

### Methods inherited from class cc.redberry.rings.poly.SimpleFieldExtension

`add, addMutable, asMultipleExtension, cardinality, characteristic, compare, conjugatesProduct, copy, createArray, createArray2d, createArray2d, degree, equals, factor, factory, generator, getMinimalPolynomial, getMinimalPolynomialRef, getOne, getZero, hashCode, isEuclideanRing, isInTheBaseField, isOne, isZero, minimalPolynomial, multiply, multiplyMutable, negate, negateMutable, norm, normOfPolynomial, normOfPolynomial, nVariables, parse, randomElement, reciprocal, shouldReduceFast, subtract, subtractMutable, toString, toString, toString, trace, valueOf, valueOf, valueOfBigInteger, 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, divideExact, divideExactMutable, divideOrNull, extendedGCD, factorial, factorSquareFree, fillZeros, firstBezoutCoefficient, gcd, gcd, getNegativeOne, increment, isFinite, isFiniteField, isMinusOne, isPerfectPower, isUnitOrZero, lcm, lcm, lcm, max, min, multiply, multiply, multiply, perfectPowerBase, perfectPowerExponent, pow, pow, pow, quotient, randomElement, randomElementTree, randomElementTree, randomNonZeroElement, setToValueOf, valueOf`
• ## Field Details

• ### GF27

public static final  GF27
GF(3^3)
• ### GF17p5

public static final  GF17p5
GF(17^5)
• ## Constructor Details

• ### FiniteField

public FiniteField​(E minimalPoly)
Constructs finite field from the specified irreducible 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 Details

• ### isField

public boolean isField()
Description copied from interface: `Ring`
Returns whether this ring is a field
Returns:
whether this ring is a field
• ### isUnit

public boolean isUnit​(E element)
Description copied from interface: `Ring`
Tests whether specified element is a ring unit
Parameters:
`element` - the ring element
Returns:
whether specified element is a ring unit
`Ring.isOne(Object)`
• ### gcd

public E gcd​(E a, E b)
Description copied from interface: `Ring`
Returns the greatest common divisor of two elements
Parameters:
`a` - the first element
`b` - the second element
Returns:
gcd
• ### divideAndRemainder

public E[] divideAndRemainder​(E a, E b)
Description copied from interface: `Ring`
Returns quotient and remainder of `dividend / divider`
Parameters:
`a` - the dividend
`b` - the divider
Returns:
`{quotient, remainder}`
• ### remainder

public E remainder​(E dividend, E divider)
Description copied from interface: `Ring`
Returns the remainder of `dividend / divider`
Parameters:
`dividend` - the dividend
`divider` - the divider
Returns:
the remainder of `dividend / divider`
• ### iterator

public  iterator()
Returns iterator over all field elements
Returns:
iterator over all field elements