Class Residue<C extends RingElem<C>>
java.lang.Object
edu.jas.poly.Residue<C>
- All Implemented Interfaces:
AbelianGroupElem<Residue<C>>, Element<Residue<C>>, MonoidElem<Residue<C>>, RingElem<Residue<C>>, Serializable, Comparable<Residue<C>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final booleanprotected intFlag to remember if this residue element is a unit.private static final org.apache.logging.log4j.Loggerprotected final ResidueRing<C> Residue class factory data structure.protected final CValue part of the element data structure. -
Constructor Summary
ConstructorsConstructorDescriptionResidue(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. -
Method Summary
Modifier and TypeMethodDescriptionabs()Residue absolute value.intResidue comparison.copy()Copy this.Residue division.Extended greatest common divisor.booleanComparison with any other object.factory()Get the corresponding element factory.Greatest common divisor.inthashCode()Hash code for this local.inverse()Residue inverse.booleanisONE()Is Residue one.booleanisUnit()Is Residue unit.booleanisZERO()Is Residue zero.Residue multiplication.negate()Residue negate.Quotient and remainder by division of this by S.Residue remainder.intsignum()Residue signum.Residue subtraction.Residue summation.toScript()Get a scripting compatible string representation.Get a scripting compatible string representation of the factory.toString()Get the String representation as RingElem.Methods inherited from interface MonoidElem
leftDivide, leftRemainder, power, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
debug
private static final boolean debug -
ring
Residue class factory data structure. -
val
-
isunit
protected int isunitFlag to remember if this residue element is a unit. -1 is unknown, 1 is unit, 0 not a unit.
-
-
Constructor Details
-
Residue
The constructor creates a Residue object from a ring factory.- Parameters:
r- ring factory.
-
Residue
The constructor creates a Residue object from a ring factory and a ring element.- Parameters:
r- ring factory.a- ring element.
-
Residue
The constructor creates a Residue object from a ring factory, a ring element and an indicator if a is a unit.- Parameters:
r- ring factory.a- ring element.u- isunit indicator, -1, 0, 1.
-
-
Method Details
-
factory
-
copy
-
isZERO
public boolean isZERO()Is Residue zero.- Specified by:
isZEROin interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- If this is 0 then true is returned, else false.
- See Also:
-
isONE
public boolean isONE()Is Residue one.- Specified by:
isONEin interfaceMonoidElem<C extends RingElem<C>>- Returns:
- If this is 1 then true is returned, else false.
- See Also:
-
isUnit
public boolean isUnit()Is Residue unit.- Specified by:
isUnitin interfaceMonoidElem<C extends RingElem<C>>- Returns:
- If this is a unit then true is returned, else false.
- See Also:
-
toString
-
toScript
-
toScriptFactory
-
compareTo
Residue comparison. -
equals
-
hashCode
-
abs
-
sum
-
negate
-
signum
public int signum()Residue signum.- Specified by:
signumin interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- signum(this).
- See Also:
-
subtract
-
divide
-
inverse
-
remainder
-
quotientRemainder
Quotient and remainder by division of this by S.- Specified by:
quotientRemainderin interfaceMonoidElem<C extends RingElem<C>>- Parameters:
S- a Residue- Returns:
- [this/S, this - (this/S)*S].
-
multiply
-
gcd
-
egcd
-