edu.jas.poly
Class Quotient<C extends RingElem<C>>
- java.lang.Object
-
- edu.jas.poly.Quotient<C>
-
- All Implemented Interfaces:
- AbelianGroupElem<Quotient<C>>, Element<Quotient<C>>, MonoidElem<Quotient<C>>, QuotPair<C>, RingElem<Quotient<C>>, java.io.Serializable, java.lang.Comparable<Quotient<C>>
public class Quotient<C extends RingElem<C>> extends java.lang.Object implements RingElem<Quotient<C>>, QuotPair<C>
Quotient element based on RingElem pairs. Objects of this class are immutable.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description CdenDenominator part of the element data structure.CnumNumerator part of the element data structure.QuotientRing<C>ringQuotient class factory data structure.
-
Constructor Summary
Constructors Constructor and Description Quotient(QuotientRing<C> r)The constructor creates a Quotient object from a ring factory.Quotient(QuotientRing<C> r, C n)The constructor creates a Quotient object from a ring factory and a numerator element.Quotient(QuotientRing<C> r, C n, C d)The constructor creates a Quotient object from a ring factory and a numerator and denominator element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Quotient<C>abs()Quotient absolute value.intcompareTo(Quotient<C> b)Quotient comparison.Quotient<C>copy()Clone this.Cdenominator()Denominator.Quotient<C>divide(Quotient<C> S)Quotient division.Quotient<C>[]egcd(Quotient<C> b)Extended greatest common divisor.booleanequals(java.lang.Object b)Comparison with any other object.QuotientRing<C>factory()Get the corresponding element factory.Quotient<C>gcd(Quotient<C> b)Greatest common divisor.inthashCode()Hash code for this local.Quotient<C>inverse()Quotient inverse.booleanisConstant()Is Quotient a constant.booleanisONE()Is Quotient one.booleanisUnit()Is Quotient unit.booleanisZERO()Is Quotient zero.Quotient<C>monic()Quotient monic.Quotient<C>multiply(Quotient<C> S)Quotient multiplication.Quotient<C>negate()Quotient negate.Cnumerator()Numerator.Quotient<C>[]quotientRemainder(Quotient<C> S)Quotient and remainder by division of this by S.Quotient<C>remainder(Quotient<C> S)Quotient remainder.intsignum()Quotient signum.Quotient<C>subtract(Quotient<C> S)Quotient subtraction.Quotient<C>sum(Quotient<C> S)Quotient 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.
-
-
-
Field Detail
-
ring
public final QuotientRing<C extends RingElem<C>> ring
Quotient class factory data structure.
-
-
Constructor Detail
-
Quotient
public Quotient(QuotientRing<C> r)
The constructor creates a Quotient object from a ring factory.- Parameters:
r- ring factory.
-
Quotient
public Quotient(QuotientRing<C> r, C n)
The constructor creates a Quotient object from a ring factory and a numerator element. The denominator is assumed to be 1.- Parameters:
r- ring factory.n- numerator.
-
Quotient
public Quotient(QuotientRing<C> r, C n, C d)
The constructor creates a Quotient object from a ring factory and a numerator and denominator element.- Parameters:
r- ring factory.n- numerator.d- denominator.
-
-
Method Detail
-
factory
public QuotientRing<C> factory()
Get the corresponding element factory.
-
numerator
public C numerator()
Numerator.
-
denominator
public C denominator()
Denominator.- Specified by:
denominatorin interfaceQuotPair<C extends RingElem<C>>- See Also:
QuotPair.denominator()
-
isConstant
public boolean isConstant()
Is Quotient a constant. Not implemented.- Specified by:
isConstantin interfaceQuotPair<C extends RingElem<C>>- Throws:
UnsupportedOperationException.
-
isZERO
public boolean isZERO()
Is Quotient zero.- Specified by:
isZEROin interfaceAbelianGroupElem<Quotient<C extends RingElem<C>>>- Returns:
- If this is 0 then true is returned, else false.
- See Also:
AbelianGroupElem.isZERO()
-
isONE
public boolean isONE()
Is Quotient one.- Specified by:
isONEin interfaceMonoidElem<Quotient<C extends RingElem<C>>>- Returns:
- If this is 1 then true is returned, else false.
- See Also:
MonoidElem.isONE()
-
isUnit
public boolean isUnit()
Is Quotient unit.- Specified by:
isUnitin interfaceMonoidElem<Quotient<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<Quotient<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 Quotient<C> abs()
Quotient absolute value.- Specified by:
absin interfaceAbelianGroupElem<Quotient<C extends RingElem<C>>>- Returns:
- the absolute value of this.
- See Also:
AbelianGroupElem.abs()
-
negate
public Quotient<C> negate()
Quotient negate.- Specified by:
negatein interfaceAbelianGroupElem<Quotient<C extends RingElem<C>>>- Returns:
- -this.
- See Also:
AbelianGroupElem.negate()
-
signum
public int signum()
Quotient signum.- Specified by:
signumin interfaceAbelianGroupElem<Quotient<C extends RingElem<C>>>- Returns:
- signum(this).
- See Also:
AbelianGroupElem.signum()
-
inverse
public Quotient<C> inverse()
Quotient inverse.- Specified by:
inversein interfaceMonoidElem<Quotient<C extends RingElem<C>>>- Returns:
- S with S = 1/this.
- See Also:
MonoidElem.inverse()
-
quotientRemainder
public Quotient<C>[] quotientRemainder(Quotient<C> S)
Quotient and remainder by division of this by S.- Parameters:
S- a Quotient- Returns:
- [this/S, this - (this/S)*S].
-
gcd
public Quotient<C> gcd(Quotient<C> b)
Greatest common divisor. Note: If not defined, throws UnsupportedOperationException.
-
-
DMelt 3.0 © DataMelt by jWork.ORG