edu.jas.application
Class Quotient<C extends GcdRingElem<C>>

java.lang.Object
  extended by edu.jas.application.Quotient<C>
All Implemented Interfaces:
AbelianGroupElem<Quotient<C>>, Element<Quotient<C>>, MonoidElem<Quotient<C>>, RingElem<Quotient<C>>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Quotient<C>>

public class Quotient<C extends GcdRingElem<C>>
extends java.lang.Object
implements RingElem<Quotient<C>>

Quotient, i.e. rational function, based on GenPolynomial with RingElem interface. Objects of this class are immutable.

Author:
Heinz Kredel
See Also:
Serialized Form

Field Summary
 GenPolynomial<C> den
          Denominator part of the element data structure.
 GenPolynomial<C> num
          Numerator part of the element data structure.
 QuotientRing<C> ring
          Quotient class factory data structure.
 
Constructor Summary
  Quotient(QuotientRing<C> r)
          The constructor creates a Quotient object from a ring factory.
  Quotient(QuotientRing<C> r, GenPolynomial<C> n)
          The constructor creates a Quotient object from a ring factory and a numerator polynomial.
  Quotient(QuotientRing<C> r, GenPolynomial<C> n, GenPolynomial<C> d)
          The constructor creates a Quotient object from a ring factory and a numerator and denominator polynomial.
protected Quotient(QuotientRing<C> r, GenPolynomial<C> n, GenPolynomial<C> d, boolean isred)
          The constructor creates a Quotient object from a ring factory and a numerator and denominator polynomial.
 
Method Summary
 Quotient<C> abs()
          Quotient absolute value.
 Quotient<C> clone()
          Clone this.
 int compareTo(Quotient<C> b)
          Quotient comparison.
 Quotient<C> divide(Quotient<C> S)
          Quotient division.
 Quotient<C>[] egcd(Quotient<C> b)
          Extended greatest common divisor.
 boolean equals(java.lang.Object b)
          Comparison with any other object.
 Quotient<C> gcd(Quotient<C> b)
          Greatest common divisor.
 int hashCode()
          Hash code for this local.
 Quotient<C> inverse()
          Quotient inverse.
 boolean isONE()
          Is Quotient one.
 boolean isUnit()
          Is Quotient unit.
 boolean isZERO()
          Is Quotient zero.
 Quotient<C> monic()
          Quotient monic.
 Quotient<C> multiply(GenPolynomial<C> b)
          Quotient multiplication by GenPolynomial.
 Quotient<C> multiply(Quotient<C> S)
          Quotient multiplication.
 Quotient<C> negate()
          Quotient negate.
 Quotient<C> remainder(Quotient<C> S)
          Quotient remainder.
 int signum()
          Quotient signum.
 Quotient<C> subtract(Quotient<C> S)
          Quotient subtraction.
 Quotient<C> sum(Quotient<C> S)
          Quotient summation.
 java.lang.String toString()
          Get the String representation as RingElem.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ring

public final QuotientRing<C extends GcdRingElem<C>> ring
Quotient class factory data structure.


num

public final GenPolynomial<C extends GcdRingElem<C>> num
Numerator part of the element data structure.


den

public final GenPolynomial<C extends GcdRingElem<C>> den
Denominator part of the element 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,
                GenPolynomial<C> n)
The constructor creates a Quotient object from a ring factory and a numerator polynomial. The denominator is assumed to be 1.

Parameters:
r - ring factory.
n - numerator polynomial.

Quotient

public Quotient(QuotientRing<C> r,
                GenPolynomial<C> n,
                GenPolynomial<C> d)
The constructor creates a Quotient object from a ring factory and a numerator and denominator polynomial.

Parameters:
r - ring factory.
n - numerator polynomial.
d - denominator polynomial.

Quotient

protected Quotient(QuotientRing<C> r,
                   GenPolynomial<C> n,
                   GenPolynomial<C> d,
                   boolean isred)
The constructor creates a Quotient object from a ring factory and a numerator and denominator polynomial.

Parameters:
r - ring factory.
n - numerator polynomial.
d - denominator polynomial.
isred - true if gcd(n,d) == 1, else false.
Method Detail

clone

public Quotient<C> clone()
Clone this.

Specified by:
clone in interface Element<Quotient<C extends GcdRingElem<C>>>
Overrides:
clone in class java.lang.Object
See Also:
Object.clone()
Returns:
Creates and returns a copy of this Elemnt.

isZERO

public boolean isZERO()
Is Quotient zero.

Specified by:
isZERO in interface AbelianGroupElem<Quotient<C extends GcdRingElem<C>>>
See Also:
AbelianGroupElem.isZERO()
Returns:
If this is 0 then true is returned, else false.

isONE

public boolean isONE()
Is Quotient one.

Specified by:
isONE in interface MonoidElem<Quotient<C extends GcdRingElem<C>>>
See Also:
MonoidElem.isONE()
Returns:
If this is 1 then true is returned, else false.

isUnit

public boolean isUnit()
Is Quotient unit.

Specified by:
isUnit in interface MonoidElem<Quotient<C extends GcdRingElem<C>>>
See Also:
MonoidElem.isUnit()
Returns:
If this is a unit then true is returned, else false.

toString

public java.lang.String toString()
Get the String representation as RingElem.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

compareTo

public int compareTo(Quotient<C> b)
Quotient comparison.

Specified by:
compareTo in interface Element<Quotient<C extends GcdRingElem<C>>>
Specified by:
compareTo in interface java.lang.Comparable<Quotient<C extends GcdRingElem<C>>>
Parameters:
b - Quotient.
Returns:
sign(this-b).

equals

public boolean equals(java.lang.Object b)
Comparison with any other object.

Specified by:
equals in interface Element<Quotient<C extends GcdRingElem<C>>>
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)
Returns:
true if this is equal to b, else false.

hashCode

public int hashCode()
Hash code for this local.

Specified by:
hashCode in interface Element<Quotient<C extends GcdRingElem<C>>>
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()
Returns:
the hashCode.

abs

public Quotient<C> abs()
Quotient absolute value.

Specified by:
abs in interface AbelianGroupElem<Quotient<C extends GcdRingElem<C>>>
See Also:
AbelianGroupElem.abs()
Returns:
the absolute value of this.

sum

public Quotient<C> sum(Quotient<C> S)
Quotient summation.

Specified by:
sum in interface AbelianGroupElem<Quotient<C extends GcdRingElem<C>>>
Parameters:
S - Quotient.
Returns:
this+S.

negate

public Quotient<C> negate()
Quotient negate.

Specified by:
negate in interface AbelianGroupElem<Quotient<C extends GcdRingElem<C>>>
See Also:
AbelianGroupElem.negate()
Returns:
-this.

signum

public int signum()
Quotient signum.

Specified by:
signum in interface AbelianGroupElem<Quotient<C extends GcdRingElem<C>>>
See Also:
AbelianGroupElem.signum()
Returns:
signum(this).

subtract

public Quotient<C> subtract(Quotient<C> S)
Quotient subtraction.

Specified by:
subtract in interface AbelianGroupElem<Quotient<C extends GcdRingElem<C>>>
Parameters:
S - Quotient.
Returns:
this-S.

divide

public Quotient<C> divide(Quotient<C> S)
Quotient division.

Specified by:
divide in interface MonoidElem<Quotient<C extends GcdRingElem<C>>>
Parameters:
S - Quotient.
Returns:
this/S.

inverse

public Quotient<C> inverse()
Quotient inverse.

Specified by:
inverse in interface MonoidElem<Quotient<C extends GcdRingElem<C>>>
See Also:
MonoidElem.inverse()
Returns:
S with S = 1/this.

remainder

public Quotient<C> remainder(Quotient<C> S)
Quotient remainder.

Specified by:
remainder in interface MonoidElem<Quotient<C extends GcdRingElem<C>>>
Parameters:
S - Quotient.
Returns:
this - (this/S)*S.

multiply

public Quotient<C> multiply(Quotient<C> S)
Quotient multiplication.

Specified by:
multiply in interface MonoidElem<Quotient<C extends GcdRingElem<C>>>
Parameters:
S - Quotient.
Returns:
this*S.

multiply

public Quotient<C> multiply(GenPolynomial<C> b)
Quotient multiplication by GenPolynomial.

Parameters:
b - GenPolynomial.
Returns:
this*b.

monic

public Quotient<C> monic()
Quotient monic.

Returns:
this with monic value part.

gcd

public Quotient<C> gcd(Quotient<C> b)
Greatest common divisor. Note: Not implemented, throws RuntimeException.

Specified by:
gcd in interface RingElem<Quotient<C extends GcdRingElem<C>>>
Parameters:
b - other element.
Returns:
gcd(this,b).

egcd

public Quotient<C>[] egcd(Quotient<C> b)
Extended greatest common divisor. Note: Not implemented, throws RuntimeException.

Specified by:
egcd in interface RingElem<Quotient<C extends GcdRingElem<C>>>
Parameters:
b - other element.
Returns:
[ gcd(this,b), c1, c2 ] with c1*this + c2*b = gcd(this,b).