Package edu.jas.application
Class Local<C extends GcdRingElem<C>>
- java.lang.Object
-
- edu.jas.application.Local<C>
-
- All Implemented Interfaces:
AbelianGroupElem<Local<C>>,Element<Local<C>>,MonoidElem<Local<C>>,QuotPair<GenPolynomial<C>>,RingElem<Local<C>>,java.io.Serializable,java.lang.Comparable<Local<C>>
public class Local<C extends GcdRingElem<C>> extends java.lang.Object implements RingElem<Local<C>>, QuotPair<GenPolynomial<C>>
Local ring element based on GenPolynomial with RingElem interface. Objects of this class are (nearly) immutable.- Author:
- Heinz Kredel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected GenPolynomial<C>denDenominator part of the element data structure.protected intisunitFlag to remember if this local element is a unit. -1 is unknown, 1 is unit, 0 not a unit.protected GenPolynomial<C>numNumerator part of the element data structure.LocalRing<C>ringLocal class factory data structure.
-
Constructor Summary
Constructors Modifier Constructor Description Local(LocalRing<C> r)The constructor creates a Local object from a ring factory.Local(LocalRing<C> r, GenPolynomial<C> n)The constructor creates a Local object from a ring factory and a numerator polynomial.Local(LocalRing<C> r, GenPolynomial<C> n, GenPolynomial<C> d)The constructor creates a Local object from a ring factory and a numerator and denominator polynomial.protectedLocal(LocalRing<C> r, GenPolynomial<C> n, GenPolynomial<C> d, boolean isred)The constructor creates a Local object from a ring factory and a numerator and denominator polynomial.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Local<C>abs()Local absolute value.intcompareTo(Local<C> b)Local comparison.Local<C>copy()Clone this.GenPolynomial<C>denominator()Denominator.Local<C>divide(Local<C> S)Local division.Local<C>[]egcd(Local<C> b)Extended greatest common divisor.booleanequals(java.lang.Object b)Comparison with any other object.LocalRing<C>factory()Get the corresponding element factory.Local<C>gcd(Local<C> b)Greatest common divisor.inthashCode()Hash code for this local.Local<C>inverse()Local inverse.booleanisConstant()Is Qoutient a constant.booleanisONE()Is Local one.booleanisUnit()Is Local unit.booleanisZERO()Is Local zero.Local<C>monic()Local monic.Local<C>multiply(C b)Local multiplication by coefficient.Local<C>multiply(Local<C> S)Local multiplication.Local<C>multiply(ExpVector e)Local multiplication by exponent.Local<C>multiply(GenPolynomial<C> b)Local multiplication by GenPolynomial.Local<C>negate()Local negate.GenPolynomial<C>numerator()Numerator.Local<C>remainder(Local<C> S)Local remainder.intsignum()Local signum.Local<C>subtract(Local<C> S)Local subtraction.Local<C>sum(Local<C> S)Local 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, quotientRemainder, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
-
-
-
-
Field Detail
-
ring
public final LocalRing<C extends GcdRingElem<C>> ring
Local class factory data structure.
-
num
protected final GenPolynomial<C extends GcdRingElem<C>> num
Numerator part of the element data structure.
-
den
protected final GenPolynomial<C extends GcdRingElem<C>> den
Denominator part of the element data structure.
-
isunit
protected int isunit
Flag to remember if this local element is a unit. -1 is unknown, 1 is unit, 0 not a unit.
-
-
Constructor Detail
-
Local
public Local(LocalRing<C> r)
The constructor creates a Local object from a ring factory.- Parameters:
r- ring factory.
-
Local
public Local(LocalRing<C> r, GenPolynomial<C> n)
The constructor creates a Local object from a ring factory and a numerator polynomial. The denominator is assumed to be 1.- Parameters:
r- ring factory.n- numerator polynomial.
-
Local
public Local(LocalRing<C> r, GenPolynomial<C> n, GenPolynomial<C> d)
The constructor creates a Local object from a ring factory and a numerator and denominator polynomial.- Parameters:
r- ring factory.n- numerator polynomial.d- denominator polynomial.
-
Local
protected Local(LocalRing<C> r, GenPolynomial<C> n, GenPolynomial<C> d, boolean isred)
The constructor creates a Local 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
-
factory
public LocalRing<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 GenPolynomial<C> numerator()
Numerator.- Specified by:
numeratorin interfaceQuotPair<C extends GcdRingElem<C>>- See Also:
QuotPair.numerator()
-
denominator
public GenPolynomial<C> denominator()
Denominator.- Specified by:
denominatorin interfaceQuotPair<C extends GcdRingElem<C>>- See Also:
QuotPair.denominator()
-
copy
public Local<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 Local 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 Local 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 Local 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(Local<C> b)
Local comparison.- Specified by:
compareToin interfacejava.lang.Comparable<C extends GcdRingElem<C>>- Specified by:
compareToin interfaceElement<C extends GcdRingElem<C>>- Parameters:
b- Local.- 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 local.- Specified by:
hashCodein interfaceElement<C extends GcdRingElem<C>>- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashCode.
- See Also:
Object.hashCode()
-
abs
public Local<C> abs()
Local absolute value.- Specified by:
absin interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Returns:
- the absolute value of this.
- See Also:
AbelianGroupElem.abs()
-
sum
public Local<C> sum(Local<C> S)
Local summation.- Specified by:
sumin interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Parameters:
S- Local.- Returns:
- this+S.
-
negate
public Local<C> negate()
Local negate.- Specified by:
negatein interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Returns:
- -this.
- See Also:
AbelianGroupElem.negate()
-
signum
public int signum()
Local signum.- Specified by:
signumin interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Returns:
- signum(this).
- See Also:
AbelianGroupElem.signum()
-
subtract
public Local<C> subtract(Local<C> S)
Local subtraction.- Specified by:
subtractin interfaceAbelianGroupElem<C extends GcdRingElem<C>>- Parameters:
S- Local.- Returns:
- this-S.
-
divide
public Local<C> divide(Local<C> S)
Local division.- Specified by:
dividein interfaceMonoidElem<C extends GcdRingElem<C>>- Parameters:
S- Local.- Returns:
- this/S.
-
inverse
public Local<C> inverse()
Local inverse.- Specified by:
inversein interfaceMonoidElem<C extends GcdRingElem<C>>- Returns:
- S with S = 1/this if defined.
- See Also:
MonoidElem.inverse()
-
remainder
public Local<C> remainder(Local<C> S)
Local remainder.- Specified by:
remainderin interfaceMonoidElem<C extends GcdRingElem<C>>- Parameters:
S- Local.- Returns:
- this - (this/S)*S.
-
multiply
public Local<C> multiply(Local<C> S)
Local multiplication.- Specified by:
multiplyin interfaceMonoidElem<C extends GcdRingElem<C>>- Parameters:
S- Local.- Returns:
- this*S.
-
multiply
public Local<C> multiply(GenPolynomial<C> b)
Local multiplication by GenPolynomial.- Parameters:
b- GenPolynomial.- Returns:
- this*b.
-
multiply
public Local<C> multiply(C b)
Local multiplication by coefficient.- Parameters:
b- coefficient.- Returns:
- this*b.
-
multiply
public Local<C> multiply(ExpVector e)
Local multiplication by exponent.- Parameters:
e- exponent vector.- Returns:
- this*b.
-
gcd
public Local<C> gcd(Local<C> b)
Greatest common divisor.- Specified by:
gcdin interfaceRingElem<C extends GcdRingElem<C>>- Parameters:
b- other element.- Returns:
- gcd(this,b).
-
egcd
public Local<C>[] egcd(Local<C> b)
Extended greatest common divisor. Note: Not implemented, throws UnsupportedOperationException.- 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).
-
-