Package 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>>
,Serializable
,Comparable<Quotient<C>>
public class Quotient<C extends RingElem<C>>
extends Object
implements RingElem<Quotient<C>>, QuotPair<C>
Quotient element based on RingElem pairs. Objects of this class are
immutable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final boolean
final C
Denominator part of the element data structure.private static final org.apache.logging.log4j.Logger
final C
Numerator part of the element data structure.final QuotientRing
<C> Quotient class factory data structure. -
Constructor Summary
ConstructorsModifierConstructorDescriptionQuotient
(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.protected
Quotient
(QuotientRing<C> r, C n, C d, boolean isred) The constructor creates a Quotient object from a ring factory and a numerator and denominator element. -
Method Summary
Modifier and TypeMethodDescriptionabs()
Quotient absolute value.int
Quotient comparison.copy()
Clone this.Denominator.Quotient division.Extended greatest common divisor.boolean
Comparison with any other object.factory()
Get the corresponding element factory.Greatest common divisor.int
hashCode()
Hash code for this local.inverse()
Quotient inverse.boolean
Is Quotient a constant.boolean
isONE()
Is Quotient one.boolean
isUnit()
Is Quotient unit.boolean
isZERO()
Is Quotient zero.monic()
Quotient monic.Quotient multiplication.negate()
Quotient negate.Numerator.Quotient and remainder by division of this by S.Quotient remainder.int
signum()
Quotient signum.Quotient subtraction.Quotient 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.jas.structure.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
Quotient class factory data structure. -
num
Numerator part of the element data structure. -
den
Denominator part of the element data structure.
-
-
Constructor Details
-
Quotient
The constructor creates a Quotient object from a ring factory.- Parameters:
r
- ring factory.
-
Quotient
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
The constructor creates a Quotient object from a ring factory and a numerator and denominator element.- Parameters:
r
- ring factory.n
- numerator.d
- denominator.
-
Quotient
The constructor creates a Quotient object from a ring factory and a numerator and denominator element.- Parameters:
r
- ring factory.n
- numerator.d
- denominator.isred
- true if gcd(n,d) == 1, else false.
-
-
Method Details
-
factory
Get the corresponding element factory. -
numerator
Numerator. -
denominator
Denominator.- Specified by:
denominator
in interfaceQuotPair<C extends RingElem<C>>
- See Also:
-
isConstant
public boolean isConstant()Is Quotient a constant. Not implemented.- Specified by:
isConstant
in interfaceQuotPair<C extends RingElem<C>>
-
copy
Clone this. -
isZERO
public boolean isZERO()Is Quotient zero.- Specified by:
isZERO
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- If this is 0 then true is returned, else false.
- See Also:
-
isONE
public boolean isONE()Is Quotient one.- Specified by:
isONE
in interfaceMonoidElem<C extends RingElem<C>>
- Returns:
- If this is 1 then true is returned, else false.
- See Also:
-
isUnit
public boolean isUnit()Is Quotient unit.- Specified by:
isUnit
in interfaceMonoidElem<C extends RingElem<C>>
- Returns:
- If this is a unit then true is returned, else false.
- See Also:
-
toString
Get the String representation as RingElem. -
toScript
Get a scripting compatible string representation. -
toScriptFactory
Get a scripting compatible string representation of the factory.- Specified by:
toScriptFactory
in interfaceElement<C extends RingElem<C>>
- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
compareTo
Quotient comparison. -
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code for this local. -
abs
Quotient absolute value.- Specified by:
abs
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- the absolute value of this.
- See Also:
-
sum
Quotient summation.- Specified by:
sum
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Parameters:
S
- Quotient.- Returns:
- this+S.
-
negate
Quotient negate.- Specified by:
negate
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- -this.
- See Also:
-
signum
public int signum()Quotient signum.- Specified by:
signum
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- signum(this).
- See Also:
-
subtract
Quotient subtraction.- Specified by:
subtract
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Parameters:
S
- Quotient.- Returns:
- this-S.
-
divide
Quotient division.- Specified by:
divide
in interfaceMonoidElem<C extends RingElem<C>>
- Parameters:
S
- Quotient.- Returns:
- this/S.
-
inverse
Quotient inverse.- Specified by:
inverse
in interfaceMonoidElem<C extends RingElem<C>>
- Returns:
- S with S = 1/this.
- See Also:
-
remainder
Quotient remainder.- Specified by:
remainder
in interfaceMonoidElem<C extends RingElem<C>>
- Parameters:
S
- Quotient.- Returns:
- this - (this/S)*S.
-
quotientRemainder
Quotient and remainder by division of this by S.- Specified by:
quotientRemainder
in interfaceMonoidElem<C extends RingElem<C>>
- Parameters:
S
- a Quotient- Returns:
- [this/S, this - (this/S)*S].
-
multiply
Quotient multiplication.- Specified by:
multiply
in interfaceMonoidElem<C extends RingElem<C>>
- Parameters:
S
- Quotient.- Returns:
- this*S.
-
monic
Quotient monic.- Returns:
- this with monic value part.
-
gcd
Greatest common divisor. Note: If not defined, throws UnsupportedOperationException. -
egcd
Extended greatest common divisor. Note: If not defined, throws UnsupportedOperationException.
-