Package edu.jas.arith
Class Product<C extends RingElem<C>>
java.lang.Object
edu.jas.arith.Product<C>
- All Implemented Interfaces:
AbelianGroupElem<Product<C>>
,Element<Product<C>>
,GcdRingElem<Product<C>>
,MonoidElem<Product<C>>
,RegularRingElem<Product<C>>
,RingElem<Product<C>>
,Serializable
,Comparable<Product<C>>
Direct product element based on RingElem. Objects of this class are (nearly)
immutable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
Flag to remember if this product element is a unit in each cmponent.private static final org.apache.logging.log4j.Logger
final ProductRing
<C> Product class factory data structure.Value part of the element data structure. -
Constructor Summary
ConstructorsConstructorDescriptionProduct
(ProductRing<C> r) The constructor creates a Product object from a ring factory.The constructor creates a Product object from a ring factory and a ring element.The constructor creates a Product object from a ring factory, a ring element and an indicator if a is a unit. -
Method Summary
Modifier and TypeMethodDescriptionabs()
Product absolute value.int
Product comparison.copy()
Clone this.Product quasi-division.Extended greatest common divisor.boolean
Comparison with any other object.extend
(int i, int j) Product extend.factory()
Get the corresponding element factory.fillIdempotent
(Product<C> S) Product fill with idempotent.fillOne()
Product fill with one.Greatest common divisor.get
(int i) Get component.int
hashCode()
Hash code for this local.Product idempotent complement.Product idempotent.idempotentAnd
(Product<C> S) Product idempotent and.idempotentOr
(Product<C> S) Product idempotent or.inverse()
Product quasi-inverse.boolean
isFull()
Is Product full.boolean
Is Product idempotent.boolean
isONE()
Is Product one.boolean
isUnit()
Is Product unit.boolean
isZERO()
Is Product zero.Product multiply by coefficient.Product multiplication.negate()
Product negate.Quotient and remainder by division of this by S.Product quasi-remainder.int
signum()
Product signum.Product subtraction.Product 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 -
ring
Product class factory data structure. -
val
Value part of the element data structure. -
isunit
protected int isunitFlag to remember if this product element is a unit in each cmponent. -1 is unknown, 1 is unit, 0 not a unit.
-
-
Constructor Details
-
Product
The constructor creates a Product object from a ring factory.- Parameters:
r
- ring factory.
-
Product
The constructor creates a Product object from a ring factory and a ring element.- Parameters:
r
- ring factory.a
- ring element.
-
Product
The constructor creates a Product object from a ring factory, a ring element and an indicator if a is a unit.- Parameters:
r
- ring factory.a
- ring element.u
- isunit indicator, -1, 0, 1.
-
-
Method Details
-
get
Get component.- Parameters:
i
- index of component.- Returns:
- val(i).
-
factory
Get the corresponding element factory. -
copy
Clone this. -
isZERO
public boolean isZERO()Is Product 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 Product one.- Specified by:
isONE
in interfaceMonoidElem<C extends RingElem<C>>
- Returns:
- If this is 1 then true is returned, else false.
- See Also:
-
isFull
public boolean isFull()Is Product full.- Specified by:
isFull
in interfaceRegularRingElem<C extends RingElem<C>>
- Returns:
- If every component is non-zero, then true is returned, else false.
-
isUnit
public boolean isUnit()Is Product unit.- Specified by:
isUnit
in interfaceMonoidElem<C extends RingElem<C>>
- Returns:
- If this is a unit then true is returned, else false.
- See Also:
-
isIdempotent
public boolean isIdempotent()Is Product idempotent.- Specified by:
isIdempotent
in interfaceRegularRingElem<C extends RingElem<C>>
- Returns:
- If this is a idempotent element then true is returned, else false.
-
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
Product comparison. -
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code for this local. -
extend
Product extend. Add new component j with value of component i.- Parameters:
i
- from index.j
- to index.- Returns:
- the extended value of this.
-
abs
Product absolute value.- Specified by:
abs
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- the absolute value of this.
- See Also:
-
sum
Product summation.- Specified by:
sum
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Parameters:
S
- Product.- Returns:
- this+S.
-
negate
Product negate.- Specified by:
negate
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- -this.
- See Also:
-
signum
public int signum()Product signum.- Specified by:
signum
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- signum of first non-zero component.
- See Also:
-
subtract
Product subtraction.- Specified by:
subtract
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Parameters:
S
- Product.- Returns:
- this-S.
-
inverse
Product quasi-inverse.- Specified by:
inverse
in interfaceMonoidElem<C extends RingElem<C>>
- Returns:
- S with S = 1/this if defined.
- See Also:
-
idempotent
Product idempotent.- Specified by:
idempotent
in interfaceRegularRingElem<C extends RingElem<C>>
- Returns:
- smallest S with this*S = this.
-
idemComplement
Product idempotent complement.- Specified by:
idemComplement
in interfaceRegularRingElem<C extends RingElem<C>>
- Returns:
- 1-this.idempotent().
-
idempotentAnd
Product idempotent and.- Specified by:
idempotentAnd
in interfaceRegularRingElem<C extends RingElem<C>>
- Parameters:
S
- Product.- Returns:
- this.idempotent() and S.idempotent().
-
idempotentOr
Product idempotent or.- Specified by:
idempotentOr
in interfaceRegularRingElem<C extends RingElem<C>>
- Parameters:
S
- Product.- Returns:
- this.idempotent() or S.idempotent().
-
fillIdempotent
Product fill with idempotent.- Specified by:
fillIdempotent
in interfaceRegularRingElem<C extends RingElem<C>>
- Parameters:
S
- Product.- Returns:
- fill this with S.idempotent().
-
fillOne
Product fill with one.- Specified by:
fillOne
in interfaceRegularRingElem<C extends RingElem<C>>
- Returns:
- fill this with one.
-
divide
Product quasi-division.- Specified by:
divide
in interfaceMonoidElem<C extends RingElem<C>>
- Parameters:
S
- Product.- Returns:
- this/S.
-
remainder
Product quasi-remainder.- Specified by:
remainder
in interfaceMonoidElem<C extends RingElem<C>>
- Parameters:
S
- Product.- 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 product- Returns:
- [this/S, this - (this/S)*S].
-
multiply
Product multiplication.- Specified by:
multiply
in interfaceMonoidElem<C extends RingElem<C>>
- Parameters:
S
- Product.- Returns:
- this*S.
-
multiply
Product multiply by coefficient.- Parameters:
c
- coefficient.- Returns:
- this*c.
-
gcd
Greatest common divisor. -
egcd
Extended greatest common divisor.
-