Package edu.jas.fd
Class SolvableQuotient<C extends GcdRingElem<C>>
- java.lang.Object
-
- edu.jas.fd.SolvableQuotient<C>
-
- All Implemented Interfaces:
AbelianGroupElem<SolvableQuotient<C>>,Element<SolvableQuotient<C>>,GcdRingElem<SolvableQuotient<C>>,MonoidElem<SolvableQuotient<C>>,QuotPair<GenPolynomial<C>>,RingElem<SolvableQuotient<C>>,java.io.Serializable,java.lang.Comparable<SolvableQuotient<C>>
public class SolvableQuotient<C extends GcdRingElem<C>> extends java.lang.Object implements GcdRingElem<SolvableQuotient<C>>, QuotPair<GenPolynomial<C>>
SolvableQuotient, that is a (left) rational function, based on GenSolvablePolynomial with RingElem interface. Objects of this class are immutable.- Author:
- Heinz Kredel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description GenSolvablePolynomial<C>denDenominator part of the element data structure.GenSolvablePolynomial<C>numNumerator part of the element data structure.SolvableQuotientRing<C>ringSolvableQuotient class factory data structure.
-
Constructor Summary
Constructors Modifier Constructor Description SolvableQuotient(SolvableQuotientRing<C> r)The constructor creates a SolvableQuotient object from a ring factory.SolvableQuotient(SolvableQuotientRing<C> r, GenSolvablePolynomial<C> n)The constructor creates a SolvableQuotient object from a ring factory and a numerator polynomial.SolvableQuotient(SolvableQuotientRing<C> r, GenSolvablePolynomial<C> n, GenSolvablePolynomial<C> d)The constructor creates a SolvableQuotient object from a ring factory and a numerator and denominator solvable polynomial.protectedSolvableQuotient(SolvableQuotientRing<C> r, GenSolvablePolynomial<C> n, GenSolvablePolynomial<C> d, boolean isred)The constructor creates a SolvableQuotient object from a ring factory and a numerator and denominator polynomial.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SolvableQuotient<C>abs()SolvableQuotient absolute value.intcompareTo(SolvableQuotient<C> b)SolvableQuotient comparison.SolvableQuotient<C>copy()Clone this.GenSolvablePolynomial<C>denominator()Denominator.SolvableQuotient<C>divide(SolvableQuotient<C> S)SolvableQuotient division.SolvableQuotient<C>[]egcd(SolvableQuotient<C> b)Extended greatest common divisor.booleanequals(java.lang.Object b)Comparison with any other object.SolvableQuotientRing<C>factory()Get the corresponding element factory.SolvableQuotient<C>gcd(SolvableQuotient<C> b)Greatest common divisor.inthashCode()Hash code for this element.SolvableQuotient<C>inverse()SolvableQuotient inverse.booleanisConstant()Is Qoutient a constant.booleanisONE()Is SolvableQuotient one.booleanisRightFraction(SolvableQuotient<C> s)Test if SolvableQuotient right fraction.booleanisUnit()Is SolvableQuotient a unit.booleanisZERO()Is SolvableQuotient zero.SolvableQuotient<C>monic()SolvableQuotient monic.SolvableQuotient<C>multiply(C b)SolvableQuotient multiplication by coefficient.SolvableQuotient<C>multiply(SolvableQuotient<C> S)SolvableQuotient multiplication.SolvableQuotient<C>multiply(ExpVector e)SolvableQuotient multiplication by exponent.SolvableQuotient<C>multiply(GenSolvablePolynomial<C> b)SolvableQuotient multiplication by GenSolvablePolynomial.SolvableQuotient<C>negate()SolvableQuotient negate.GenSolvablePolynomial<C>numerator()Numerator.SolvableQuotient<C>[]quotientRemainder(SolvableQuotient<C> S)Quotient and remainder by division of this by S.SolvableQuotient<C>remainder(SolvableQuotient<C> S)SolvableQuotient remainder.SolvableQuotient<C>rightFraction()SolvableQuotient right fraction.intsignum()SolvableQuotient signum.SolvableQuotient<C>subtract(SolvableQuotient<C> S)SolvableQuotient subtraction.SolvableQuotient<C>sum(SolvableQuotient<C> S)SolvableQuotient 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.-
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 Detail
-
ring
public final SolvableQuotientRing<C extends GcdRingElem<C>> ring
SolvableQuotient class factory data structure.
-
num
public final GenSolvablePolynomial<C extends GcdRingElem<C>> num
Numerator part of the element data structure.
-
den
public final GenSolvablePolynomial<C extends GcdRingElem<C>> den
Denominator part of the element data structure.
-
-
Constructor Detail
-
SolvableQuotient
public SolvableQuotient(SolvableQuotientRing<C> r)
The constructor creates a SolvableQuotient object from a ring factory.- Parameters:
r- ring factory.
-
SolvableQuotient
public SolvableQuotient(SolvableQuotientRing<C> r, GenSolvablePolynomial<C> n)
The constructor creates a SolvableQuotient object from a ring factory and a numerator polynomial. The denominator is assumed to be 1.- Parameters:
r- ring factory.n- numerator solvable polynomial.
-
SolvableQuotient
public SolvableQuotient(SolvableQuotientRing<C> r, GenSolvablePolynomial<C> n, GenSolvablePolynomial<C> d)
The constructor creates a SolvableQuotient object from a ring factory and a numerator and denominator solvable polynomial.- Parameters:
r- ring factory.n- numerator polynomial.d- denominator polynomial.
-
SolvableQuotient
protected SolvableQuotient(SolvableQuotientRing<C> r, GenSolvablePolynomial<C> n, GenSolvablePolynomial<C> d, boolean isred)
The constructor creates a SolvableQuotient object from a ring factory and a numerator and denominator polynomial.- Parameters:
r- ring factory.n- numerator polynomial.d- denominator polynomial.isred- unused at the moment.
-
-
Method Detail
-
factory
public SolvableQuotientRing<C> factory()
Get the corresponding element factory.- Specified by:
factoryin interfaceElement<C extends GcdRingElem<C>>- Returns:
- factory for this Element.
- See Also:
Element.factory()
-
numerator
public GenSolvablePolynomial<C> numerator()
Numerator.- Specified by:
numeratorin interfaceQuotPair<C extends GcdRingElem<C>>- See Also:
QuotPair.numerator()
-
denominator
public GenSolvablePolynomial<C> denominator()
Denominator.- Specified by:
denominatorin interfaceQuotPair<C extends GcdRingElem<C>>- See Also:
QuotPair.denominator()
-
copy
public SolvableQuotient<C> copy()
Clone this.- Specified by:
copyin interfaceElement<C extends GcdRingElem<C>>- Returns:
- Creates and returns a copy of this Element.
- See Also:
Object.clone()
-
isZERO
public boolean isZERO()
Is SolvableQuotient zero.- Specified by:
isZEROin interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Returns:
- If this is 0 then true is returned, else false.
- See Also:
AbelianGroupElem.isZERO()
-
isONE
public boolean isONE()
Is SolvableQuotient one.- Specified by:
isONEin interfaceMonoidElem<C extends GcdRingElem<C>>- Returns:
- If this is 1 then true is returned, else false.
- See Also:
MonoidElem.isONE()
-
isUnit
public boolean isUnit()
Is SolvableQuotient a unit.- Specified by:
isUnitin interfaceMonoidElem<C extends GcdRingElem<C>>- Returns:
- If this is a unit then true is returned, else false.
- See Also:
MonoidElem.isUnit()
-
isConstant
public boolean isConstant()
Is Qoutient a constant.- Specified by:
isConstantin interfaceQuotPair<C extends GcdRingElem<C>>- Returns:
- true, if this has constant numerator and denominator, else false.
-
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.- Specified by:
toScriptin interfaceElement<C extends GcdRingElem<C>>- Returns:
- script compatible representation for this Element.
- See Also:
Element.toScript()
-
toScriptFactory
public java.lang.String toScriptFactory()
Get a scripting compatible string representation of the factory.- Specified by:
toScriptFactoryin interfaceElement<C extends GcdRingElem<C>>- Returns:
- script compatible representation for this ElemFactory.
- See Also:
Element.toScriptFactory()
-
compareTo
public int compareTo(SolvableQuotient<C> b)
SolvableQuotient comparison.- Specified by:
compareToin interfacejava.lang.Comparable<C extends GcdRingElem<C>>- Specified by:
compareToin interfaceElement<C extends GcdRingElem<C>>- Parameters:
b- SolvableQuotient.- Returns:
- sign(this-b).
-
equals
public boolean equals(java.lang.Object b)
Comparison with any other object.- Specified by:
equalsin interfaceElement<C extends GcdRingElem<C>>- Overrides:
equalsin classjava.lang.Object- Returns:
- true if this is equal to b, else false.
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Hash code for this element.- Specified by:
hashCodein interfaceElement<C extends GcdRingElem<C>>- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashCode.
- See Also:
Object.hashCode()
-
rightFraction
public SolvableQuotient<C> rightFraction()
SolvableQuotient right fraction. Note: It is not possible to distinguish right from left fractions in the current implementation. So it is not possible to compute with right fractions.- Returns:
- SolvableQuotient(a,b), where den-1 num = a b -1
-
isRightFraction
public boolean isRightFraction(SolvableQuotient<C> s)
Test if SolvableQuotient right fraction. Note: It is not possible to distinguish right from left fractions in the current implementation. So it is not possible to compute with right fractions.- Parameters:
s- = SolvableQuotient(a,b)- Returns:
- true if s is a right fraction of this, i.e. den-1 num = a b-1
-
abs
public SolvableQuotient<C> abs()
SolvableQuotient absolute value.- Specified by:
absin interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Returns:
- the absolute value of this.
- See Also:
AbelianGroupElem.abs()
-
sum
public SolvableQuotient<C> sum(SolvableQuotient<C> S)
SolvableQuotient summation.- Specified by:
sumin interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Parameters:
S- SolvableQuotient.- Returns:
- this+S.
-
negate
public SolvableQuotient<C> negate()
SolvableQuotient negate.- Specified by:
negatein interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Returns:
- -this.
- See Also:
AbelianGroupElem.negate()
-
signum
public int signum()
SolvableQuotient signum.- Specified by:
signumin interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Returns:
- signum(this).
- See Also:
AbelianGroupElem.signum()
-
subtract
public SolvableQuotient<C> subtract(SolvableQuotient<C> S)
SolvableQuotient subtraction.- Specified by:
subtractin interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Parameters:
S- SolvableQuotient.- Returns:
- this-S.
-
divide
public SolvableQuotient<C> divide(SolvableQuotient<C> S)
SolvableQuotient division.- Specified by:
dividein interfaceMonoidElem<C extends GcdRingElem<C>>- Parameters:
S- SolvableQuotient.- Returns:
- this/S.
-
inverse
public SolvableQuotient<C> inverse()
SolvableQuotient inverse.- Specified by:
inversein interfaceMonoidElem<C extends GcdRingElem<C>>- Returns:
- S with S = 1/this.
- See Also:
MonoidElem.inverse()
-
remainder
public SolvableQuotient<C> remainder(SolvableQuotient<C> S)
SolvableQuotient remainder.- Specified by:
remainderin interfaceMonoidElem<C extends GcdRingElem<C>>- Parameters:
S- SolvableQuotient.- Returns:
- this - (this/S)*S.
-
quotientRemainder
public SolvableQuotient<C>[] quotientRemainder(SolvableQuotient<C> S)
Quotient and remainder by division of this by S.- Specified by:
quotientRemainderin interfaceMonoidElem<C extends GcdRingElem<C>>- Parameters:
S- a SolvableQuotient- Returns:
- [this/S, this - (this/S)*S].
-
multiply
public SolvableQuotient<C> multiply(SolvableQuotient<C> S)
SolvableQuotient multiplication.- Specified by:
multiplyin interfaceMonoidElem<C extends GcdRingElem<C>>- Parameters:
S- SolvableQuotient.- Returns:
- this*S.
-
multiply
public SolvableQuotient<C> multiply(GenSolvablePolynomial<C> b)
SolvableQuotient multiplication by GenSolvablePolynomial.- Parameters:
b- GenSolvablePolynomial. - Returns:
- this*b.
-
multiply
public SolvableQuotient<C> multiply(C b)
SolvableQuotient multiplication by coefficient.- Parameters:
b- coefficient.- Returns:
- this*b.
-
multiply
public SolvableQuotient<C> multiply(ExpVector e)
SolvableQuotient multiplication by exponent.- Parameters:
e- exponent vector.- Returns:
- this*b.
-
monic
public SolvableQuotient<C> monic()
SolvableQuotient monic.- Returns:
- this with monic value part.
-
gcd
public SolvableQuotient<C> gcd(SolvableQuotient<C> b)
Greatest common divisor.- Specified by:
gcdin interfaceRingElem<C extends GcdRingElem<C>>- Parameters:
b- other element.- Returns:
- gcd(this,b).
-
egcd
public SolvableQuotient<C>[] egcd(SolvableQuotient<C> b)
Extended greatest common divisor.- Specified by:
egcdin interfaceRingElem<C extends GcdRingElem<C>>- Parameters:
b- other element.- Returns:
- [ gcd(this,b), c1, c2 ] with c1*this + c2*b = gcd(this,b).
-
-