Package edu.jas.application
Class SolvableLocal<C extends GcdRingElem<C>>
java.lang.Object
edu.jas.application.SolvableLocal<C>
- All Implemented Interfaces:
AbelianGroupElem<SolvableLocal<C>>
,Element<SolvableLocal<C>>
,GcdRingElem<SolvableLocal<C>>
,MonoidElem<SolvableLocal<C>>
,QuotPair<GenPolynomial<C>>
,RingElem<SolvableLocal<C>>
,Serializable
,Comparable<SolvableLocal<C>>
public class SolvableLocal<C extends GcdRingElem<C>>
extends Object
implements GcdRingElem<SolvableLocal<C>>, QuotPair<GenPolynomial<C>>
SolvableLocal ring element based on pairs of GenSolvablePolynomial with
GcdRingElem interface. Objects of this class are immutable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final boolean
final GenSolvablePolynomial
<C> Denominator part of the element data structure.protected int
Flag to remember if this local element is a unit.private static final org.apache.logging.log4j.Logger
final GenSolvablePolynomial
<C> Numerator part of the element data structure.final SolvableLocalRing
<C> SolvableLocal class factory data structure. -
Constructor Summary
ConstructorsModifierConstructorDescriptionThe constructor creates a SolvableLocal object from a ring factory.The constructor creates a SolvableLocal object from a ring factory and a numerator polynomial.The constructor creates a SolvableLocal object from a ring factory and a numerator and denominator polynomial.protected
SolvableLocal
(SolvableLocalRing<C> r, GenSolvablePolynomial<C> n, GenSolvablePolynomial<C> d, boolean isred) The constructor creates a SolvableLocal object from a ring factory and a numerator and denominator polynomial. -
Method Summary
Modifier and TypeMethodDescriptionabs()
SolvableLocal absolute value.int
compareTo
(SolvableLocal<C> b) SolvableLocal comparison.copy()
Clone this.Denominator.divide
(SolvableLocal<C> S) SolvableLocal division.SolvableLocal<C>[]
egcd
(SolvableLocal<C> b) Extended greatest common divisor.boolean
Comparison with any other object.factory()
Get the corresponding element factory.gcd
(SolvableLocal<C> b) Greatest common divisor.int
hashCode()
Hash code for this local.inverse()
SolvableLocal inverse.boolean
Is Qoutient a constant.boolean
isONE()
Is SolvableLocal one.boolean
isUnit()
Is SolvableLocal unit.boolean
isZERO()
Is SolvableLocal zero.monic()
SolvableLocal monic.SolvableLocal multiplication by coefficient.multiply
(SolvableLocal<C> S) SolvableLocal multiplication.SolvableLocal multiplication by exponent.SolvableLocal multiplication by GenSolvablePolynomial.negate()
SolvableLocal negate.Numerator.remainder
(SolvableLocal<C> S) SolvableLocal remainder.int
signum()
SolvableLocal signum.subtract
(SolvableLocal<C> S) SolvableLocal subtraction.sum
(SolvableLocal<C> S) SolvableLocal 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, quotientRemainder, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
debug
private static final boolean debug -
ring
SolvableLocal class factory data structure. -
num
Numerator part of the element data structure. -
den
Denominator part of the element data structure. -
isunit
protected int isunitFlag to remember if this local element is a unit. -1 is unknown, 1 is unit, 0 not a unit.
-
-
Constructor Details
-
SolvableLocal
The constructor creates a SolvableLocal object from a ring factory.- Parameters:
r
- ring factory.
-
SolvableLocal
The constructor creates a SolvableLocal object from a ring factory and a numerator polynomial. The denominator is assumed to be 1.- Parameters:
r
- ring factory.n
- numerator polynomial.
-
SolvableLocal
public SolvableLocal(SolvableLocalRing<C> r, GenSolvablePolynomial<C> n, GenSolvablePolynomial<C> d) The constructor creates a SolvableLocal object from a ring factory and a numerator and denominator polynomial.- Parameters:
r
- ring factory.n
- numerator polynomial.d
- denominator polynomial.
-
SolvableLocal
protected SolvableLocal(SolvableLocalRing<C> r, GenSolvablePolynomial<C> n, GenSolvablePolynomial<C> d, boolean isred) The constructor creates a SolvableLocal 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 Details
-
factory
Get the corresponding element factory.- Specified by:
factory
in interfaceElement<C extends GcdRingElem<C>>
- Returns:
- factory for this Element.
- See Also:
-
numerator
Numerator.- Specified by:
numerator
in interfaceQuotPair<C extends GcdRingElem<C>>
- See Also:
-
denominator
Denominator.- Specified by:
denominator
in interfaceQuotPair<C extends GcdRingElem<C>>
- See Also:
-
copy
Clone this.- Specified by:
copy
in interfaceElement<C extends GcdRingElem<C>>
- Returns:
- Creates and returns a copy of this Element.
- See Also:
-
isZERO
public boolean isZERO()Is SolvableLocal zero.- Specified by:
isZERO
in interfaceAbelianGroupElem<C extends GcdRingElem<C>>
- Returns:
- If this is 0 then true is returned, else false.
- See Also:
-
isONE
public boolean isONE()Is SolvableLocal one.- Specified by:
isONE
in interfaceMonoidElem<C extends GcdRingElem<C>>
- Returns:
- If this is 1 then true is returned, else false.
- See Also:
-
isUnit
public boolean isUnit()Is SolvableLocal unit.- Specified by:
isUnit
in interfaceMonoidElem<C extends GcdRingElem<C>>
- Returns:
- If this is a unit then true is returned, else false.
- See Also:
-
isConstant
public boolean isConstant()Is Qoutient a constant.- Specified by:
isConstant
in interfaceQuotPair<C extends GcdRingElem<C>>
- Returns:
- true, if this has constant numerator and denominator, else false.
-
toString
Get the String representation as RingElem. -
toScript
Get a scripting compatible string representation.- Specified by:
toScript
in interfaceElement<C extends GcdRingElem<C>>
- Returns:
- script compatible representation for this Element.
- See Also:
-
toScriptFactory
Get a scripting compatible string representation of the factory.- Specified by:
toScriptFactory
in interfaceElement<C extends GcdRingElem<C>>
- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
compareTo
SolvableLocal comparison.- Specified by:
compareTo
in interfaceComparable<C extends GcdRingElem<C>>
- Specified by:
compareTo
in interfaceElement<C extends GcdRingElem<C>>
- Parameters:
b
- SolvableLocal.- Returns:
- sign(this-b).
-
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code for this local. -
abs
SolvableLocal absolute value.- Specified by:
abs
in interfaceAbelianGroupElem<C extends GcdRingElem<C>>
- Returns:
- the absolute value of this.
- See Also:
-
sum
SolvableLocal summation.- Specified by:
sum
in interfaceAbelianGroupElem<C extends GcdRingElem<C>>
- Parameters:
S
- SolvableLocal.- Returns:
- this+S.
-
negate
SolvableLocal negate.- Specified by:
negate
in interfaceAbelianGroupElem<C extends GcdRingElem<C>>
- Returns:
- -this.
- See Also:
-
signum
public int signum()SolvableLocal signum.- Specified by:
signum
in interfaceAbelianGroupElem<C extends GcdRingElem<C>>
- Returns:
- signum(this).
- See Also:
-
subtract
SolvableLocal subtraction.- Specified by:
subtract
in interfaceAbelianGroupElem<C extends GcdRingElem<C>>
- Parameters:
S
- SolvableLocal.- Returns:
- this-S.
-
divide
SolvableLocal division.- Specified by:
divide
in interfaceMonoidElem<C extends GcdRingElem<C>>
- Parameters:
S
- SolvableLocal.- Returns:
- this/S.
-
inverse
SolvableLocal inverse.- Specified by:
inverse
in interfaceMonoidElem<C extends GcdRingElem<C>>
- Returns:
- S with S = 1/this if defined.
- See Also:
-
remainder
SolvableLocal remainder.- Specified by:
remainder
in interfaceMonoidElem<C extends GcdRingElem<C>>
- Parameters:
S
- SolvableLocal.- Returns:
- this - (this/S)*S.
-
multiply
SolvableLocal multiplication.- Specified by:
multiply
in interfaceMonoidElem<C extends GcdRingElem<C>>
- Parameters:
S
- SolvableLocal.- Returns:
- this*S.
-
multiply
SolvableLocal multiplication by GenSolvablePolynomial.- Parameters:
b
- GenSolvablePolynomial.- Returns:
- this*b.
-
multiply
SolvableLocal multiplication by coefficient.- Parameters:
b
- coefficient.- Returns:
- this*b.
-
multiply
SolvableLocal multiplication by exponent.- Parameters:
e
- exponent vector.- Returns:
- this*b.
-
monic
SolvableLocal monic.- Returns:
- this with monic value part.
-
gcd
Greatest common divisor.- Specified by:
gcd
in interfaceRingElem<C extends GcdRingElem<C>>
- Parameters:
b
- other element.- Returns:
- gcd(this,b).
-
egcd
Extended greatest common divisor. Note: Not implemented, throws UnsupportedOperationException.- Specified by:
egcd
in interfaceRingElem<C extends GcdRingElem<C>>
- Parameters:
b
- other element.- Returns:
- [ gcd(this,b), c1, c2 ] with c1*this + c2*b = gcd(this,b).
-