public class Residue<C extends RingElem<C>> extends java.lang.Object implements RingElem<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.
|
protected ResidueRing<C> |
ring
Residue class factory data structure.
|
protected 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,
C a)
The constructor creates a Residue object from a ring factory and a ring
element.
|
Residue(ResidueRing<C> r,
C a,
int u)
The constructor creates a Residue object from a ring factory, a ring
element 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()
Copy 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 local.
|
Residue<C> |
inverse()
Residue inverse.
|
boolean |
isONE()
Is Residue one.
|
boolean |
isUnit()
Is Residue unit.
|
boolean |
isZERO()
Is Residue zero.
|
Residue<C> |
multiply(Residue<C> S)
Residue multiplication.
|
Residue<C> |
negate()
Residue negate.
|
Residue<C>[] |
quotientRemainder(Residue<C> S)
Quotient and remainder by division of this by S.
|
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, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
protected final ResidueRing<C extends RingElem<C>> ring
protected int isunit
public Residue(ResidueRing<C> r)
r
- ring factory.public Residue(ResidueRing<C> r, C a)
r
- ring factory.a
- ring element.public Residue(ResidueRing<C> r, C a, int u)
r
- ring factory.a
- ring element.u
- isunit indicator, -1, 0, 1.public ResidueRing<C> factory()
public boolean isZERO()
isZERO
in interface AbelianGroupElem<Residue<C extends RingElem<C>>>
AbelianGroupElem.isZERO()
public boolean isONE()
isONE
in interface MonoidElem<Residue<C extends RingElem<C>>>
MonoidElem.isONE()
public boolean isUnit()
isUnit
in interface MonoidElem<Residue<C extends RingElem<C>>>
MonoidElem.isUnit()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toScript()
public java.lang.String toScriptFactory()
toScriptFactory
in interface Element<Residue<C extends RingElem<C>>>
Element.toScriptFactory()
public boolean equals(java.lang.Object b)
public int hashCode()
public Residue<C> abs()
abs
in interface AbelianGroupElem<Residue<C extends RingElem<C>>>
AbelianGroupElem.abs()
public Residue<C> negate()
negate
in interface AbelianGroupElem<Residue<C extends RingElem<C>>>
AbelianGroupElem.negate()
public int signum()
signum
in interface AbelianGroupElem<Residue<C extends RingElem<C>>>
AbelianGroupElem.signum()
public Residue<C> inverse()
inverse
in interface MonoidElem<Residue<C extends RingElem<C>>>
MonoidElem.inverse()
public Residue<C>[] quotientRemainder(Residue<C> S)
quotientRemainder
in interface MonoidElem<Residue<C extends RingElem<C>>>
S
- a Residuepublic Residue<C> gcd(Residue<C> b)