public class Residue<C extends GcdRingElem<C>> extends java.lang.Object implements GcdRingElem<Residue<C>>
Modifier and Type | Field and Description |
---|---|
protected int |
isunit
Flag to remember if this residue element is a unit. -1 is unknown, 1 is
unit, 0 not a unit.
|
ResidueRing<C> |
ring
Residue class factory data structure.
|
GenPolynomial<C> |
val
Value part of the element data structure.
|
Constructor and Description |
---|
Residue(ResidueRing<C> r)
The constructor creates a Residue object from a ring factory.
|
Residue(ResidueRing<C> r,
GenPolynomial<C> a)
The constructor creates a Residue object from a ring factory and a
polynomial.
|
Residue(ResidueRing<C> r,
GenPolynomial<C> a,
int u)
The constructor creates a Residue object from a ring factory, a
polynomial and an indicator if a is a unit.
|
Modifier and Type | Method and Description |
---|---|
Residue<C> |
abs()
Residue absolute value.
|
int |
compareTo(Residue<C> b)
Residue comparison.
|
Residue<C> |
copy()
Clone this.
|
Residue<C> |
divide(Residue<C> S)
Residue division.
|
Residue<C>[] |
egcd(Residue<C> b)
Extended greatest common divisor.
|
boolean |
equals(java.lang.Object b)
Comparison with any other object.
|
ResidueRing<C> |
factory()
Get the corresponding element factory.
|
Residue<C> |
gcd(Residue<C> b)
Greatest common divisor.
|
int |
hashCode()
Hash code for this residue.
|
Residue<C> |
inverse()
Residue inverse.
|
boolean |
isConstant()
Is Residue a constant.
|
boolean |
isONE()
Is Residue one.
|
boolean |
isUnit()
Is Residue unit.
|
boolean |
isZERO()
Is Residue zero.
|
Residue<C> |
monic()
Residue monic.
|
Residue<C> |
multiply(Residue<C> S)
Residue multiplication.
|
Residue<C> |
negate()
Residue negate.
|
Residue<C> |
remainder(Residue<C> S)
Residue remainder.
|
int |
signum()
Residue signum.
|
Residue<C> |
subtract(Residue<C> S)
Residue subtraction.
|
Residue<C> |
sum(Residue<C> S)
Residue summation.
|
java.lang.String |
toScript()
Get a scripting compatible string representation.
|
java.lang.String |
toScriptFactory()
Get a scripting compatible string representation of the factory.
|
java.lang.String |
toString()
Get the String representation as RingElem.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
leftDivide, leftRemainder, power, quotientRemainder, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
public final ResidueRing<C extends GcdRingElem<C>> ring
public final GenPolynomial<C extends GcdRingElem<C>> val
protected int isunit
public Residue(ResidueRing<C> r)
r
- residue ring factory.public Residue(ResidueRing<C> r, GenPolynomial<C> a)
r
- residue ring factory.a
- polynomial.public Residue(ResidueRing<C> r, GenPolynomial<C> a, int u)
r
- residue ring factory.a
- polynomial.u
- isunit indicator, -1, 0, 1.public ResidueRing<C> factory()
factory
in interface Element<Residue<C extends GcdRingElem<C>>>
Element.factory()
public boolean isZERO()
isZERO
in interface AbelianGroupElem<Residue<C extends GcdRingElem<C>>>
AbelianGroupElem.isZERO()
public boolean isONE()
isONE
in interface MonoidElem<Residue<C extends GcdRingElem<C>>>
MonoidElem.isONE()
public boolean isUnit()
isUnit
in interface MonoidElem<Residue<C extends GcdRingElem<C>>>
MonoidElem.isUnit()
public boolean isConstant()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toScript()
toScript
in interface Element<Residue<C extends GcdRingElem<C>>>
Element.toScript()
public java.lang.String toScriptFactory()
toScriptFactory
in interface Element<Residue<C extends GcdRingElem<C>>>
Element.toScriptFactory()
public int compareTo(Residue<C> b)
compareTo
in interface Element<Residue<C extends GcdRingElem<C>>>
compareTo
in interface java.lang.Comparable<Residue<C extends GcdRingElem<C>>>
b
- Residue.public boolean equals(java.lang.Object b)
public int hashCode()
public Residue<C> abs()
abs
in interface AbelianGroupElem<Residue<C extends GcdRingElem<C>>>
AbelianGroupElem.abs()
public Residue<C> sum(Residue<C> S)
sum
in interface AbelianGroupElem<Residue<C extends GcdRingElem<C>>>
S
- Residue.public Residue<C> negate()
negate
in interface AbelianGroupElem<Residue<C extends GcdRingElem<C>>>
AbelianGroupElem.negate()
public int signum()
signum
in interface AbelianGroupElem<Residue<C extends GcdRingElem<C>>>
AbelianGroupElem.signum()
public Residue<C> subtract(Residue<C> S)
subtract
in interface AbelianGroupElem<Residue<C extends GcdRingElem<C>>>
S
- Residue.public Residue<C> divide(Residue<C> S)
divide
in interface MonoidElem<Residue<C extends GcdRingElem<C>>>
S
- Residue.public Residue<C> inverse()
inverse
in interface MonoidElem<Residue<C extends GcdRingElem<C>>>
MonoidElem.inverse()
public Residue<C> remainder(Residue<C> S)
remainder
in interface MonoidElem<Residue<C extends GcdRingElem<C>>>
S
- Residue.public Residue<C> multiply(Residue<C> S)
multiply
in interface MonoidElem<Residue<C extends GcdRingElem<C>>>
S
- Residue.