edu.jas.poly
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>>, java.io.Serializable, java.lang.Comparable<Residue<C>>
public class Residue<C extends RingElem<C>> extends java.lang.Object implements RingElem<Residue<C>>
Residue element based on RingElem residue. Objects of this class are (nearly) immutable.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Residue<C>abs()Residue absolute value.intcompareTo(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.booleanequals(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.inthashCode()Hash code for this local.Residue<C>inverse()Residue inverse.booleanisONE()Is Residue one.booleanisUnit()Is Residue unit.booleanisZERO()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.intsignum()Residue signum.Residue<C>subtract(Residue<C> S)Residue subtraction.Residue<C>sum(Residue<C> S)Residue summation.java.lang.StringtoScript()Get a scripting compatible string representation.java.lang.StringtoScriptFactory()Get a scripting compatible string representation of the factory.java.lang.StringtoString()Get the String representation as RingElem.
-
-
-
Constructor Detail
-
Residue
public Residue(ResidueRing<C> r)
The constructor creates a Residue object from a ring factory.- Parameters:
r- ring factory.
-
Residue
public Residue(ResidueRing<C> r, C a)
The constructor creates a Residue object from a ring factory and a ring element.- Parameters:
r- ring factory.a- ring element.
-
Residue
public 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.- Parameters:
r- ring factory.a- ring element.u- isunit indicator, -1, 0, 1.
-
-
Method Detail
-
factory
public ResidueRing<C> factory()
Get the corresponding element factory.
-
isZERO
public boolean isZERO()
Is Residue zero.- Specified by:
isZEROin interfaceAbelianGroupElem<Residue<C extends RingElem<C>>>- Returns:
- If this is 0 then true is returned, else false.
- See Also:
AbelianGroupElem.isZERO()
-
isONE
public boolean isONE()
Is Residue one.- Specified by:
isONEin interfaceMonoidElem<Residue<C extends RingElem<C>>>- Returns:
- If this is 1 then true is returned, else false.
- See Also:
MonoidElem.isONE()
-
isUnit
public boolean isUnit()
Is Residue unit.- Specified by:
isUnitin interfaceMonoidElem<Residue<C extends RingElem<C>>>- Returns:
- If this is a unit then true is returned, else false.
- See Also:
MonoidElem.isUnit()
-
toString
public java.lang.String toString()
Get the String representation as RingElem.- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
toScript
public java.lang.String toScript()
Get a scripting compatible string representation.
-
toScriptFactory
public java.lang.String toScriptFactory()
Get a scripting compatible string representation of the factory.- Specified by:
toScriptFactoryin interfaceElement<Residue<C extends RingElem<C>>>- Returns:
- script compatible representation for this ElemFactory.
- See Also:
Element.toScriptFactory()
-
equals
public boolean equals(java.lang.Object b)
Comparison with any other object.
-
hashCode
public int hashCode()
Hash code for this local.
-
abs
public Residue<C> abs()
Residue absolute value.- Specified by:
absin interfaceAbelianGroupElem<Residue<C extends RingElem<C>>>- Returns:
- the absolute value of this.
- See Also:
AbelianGroupElem.abs()
-
negate
public Residue<C> negate()
Residue negate.- Specified by:
negatein interfaceAbelianGroupElem<Residue<C extends RingElem<C>>>- Returns:
- -this.
- See Also:
AbelianGroupElem.negate()
-
signum
public int signum()
Residue signum.- Specified by:
signumin interfaceAbelianGroupElem<Residue<C extends RingElem<C>>>- Returns:
- signum(this).
- See Also:
AbelianGroupElem.signum()
-
inverse
public Residue<C> inverse()
Residue inverse.- Specified by:
inversein interfaceMonoidElem<Residue<C extends RingElem<C>>>- Returns:
- S with S = 1/this if defined.
- See Also:
MonoidElem.inverse()
-
quotientRemainder
public Residue<C>[] quotientRemainder(Residue<C> S)
Quotient and remainder by division of this by S.- Parameters:
S- a Residue- Returns:
- [this/S, this - (this/S)*S].
-
gcd
public Residue<C> gcd(Residue<C> b)
Greatest common divisor. Note: Not implemented, throws UnsupportedOperationException.
-
-
DMelt 3.0 © DataMelt by jWork.ORG