Class ModuloPolynomialField<R extends Field<R>>
java.lang.Object
org.apfloat.jscience.ModuloPolynomialField<R>
- Type Parameters:
R- The type of the polynomial coefficients.
- All Implemented Interfaces:
Serializable, Immutable, Realtime, ValueType, Field<ModuloPolynomialField<R>>, GroupAdditive<ModuloPolynomialField<R>>, GroupMultiplicative<ModuloPolynomialField<R>>, Ring<ModuloPolynomialField<R>>, Structure<ModuloPolynomialField<R>>
public class ModuloPolynomialField<R extends Field<R>>
extends Object
implements Field<ModuloPolynomialField<R>>, Serializable, Realtime
This class represents a polynomial modulo a modulus.
The modulus must be set with
setModulus(Polynomial); otherwise
the modulo reduction is not done.
For the polynomials to actually form a field, the modulus must be irreducible
over the coefficient field. Otherwise it's just a Ring and the
multiplicative inverse() method may fail.
- Since:
- 1.15.0
- Version:
- 1.15.0
- Author:
- Mikko Tommila
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionModuloPolynomialField(Polynomial<R> polynomial) Create a new modulo polynomial. -
Method Summary
Modifier and TypeMethodDescriptioncopy()booleanstatic <R extends Field<R>>
Polynomial<R> Returns the modulus ornullif modulo reduction is not done.inthashCode()inverse()minus(ModuloPolynomialField<R> that) Returns the difference of two polynomials.opposite()plus(ModuloPolynomialField<R> that) static <R extends Field<R>>
Polynomial<R> reduce(Polynomial<R> polynomial) Reduce the polynomial with the current modulus.static <R extends Field<R>>
voidsetModulus(Polynomial<R> modulus) Sets the modulus.times(ModuloPolynomialField<R> that) toString()toText()value()Returns the underlying polynomial.
-
Constructor Details
-
ModuloPolynomialField
Create a new modulo polynomial.- Parameters:
polynomial- The polynomial. Will be reduced by the modulus, if any.
-
-
Method Details
-
getModulus
Returns the modulus ornullif modulo reduction is not done. The modulus can be set in a thread-specific way usingLocalContext.- Type Parameters:
R- The type of the polynomial coefficients.- Returns:
- The local modulus or
nullif modulo reduction is not done. - See Also:
-
setModulus
Sets the modulus. The modulus can be set in a thread-specific way usingLocalContext.- Type Parameters:
R- The type of the polynomial coefficients.- Parameters:
modulus- The modulus ornullif modulo reduction is not done.
-
reduce
Reduce the polynomial with the current modulus.- Type Parameters:
R- The type of the polynomial coefficients.- Parameters:
polynomial- The polynomial.- Returns:
- The polynomial mod the current modulus.
-
plus
- Specified by:
plusin interfaceGroupAdditive<R extends Field<R>>
-
minus
Returns the difference of two polynomials.- Parameters:
that- The polynomial being subtracted.- Returns:
this - that
-
opposite
- Specified by:
oppositein interfaceGroupAdditive<R extends Field<R>>
-
times
-
inverse
- Specified by:
inversein interfaceGroupMultiplicative<R extends Field<R>>
-
value
-
copy
-
toText
-
toString
-
hashCode
-
equals
-