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 intFlag to remember if this product element is a unit in each cmponent.private static final org.apache.logging.log4j.Loggerfinal 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.intProduct comparison.copy()Clone this.Product quasi-division.Extended greatest common divisor.booleanComparison 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.inthashCode()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.booleanisFull()Is Product full.booleanIs Product idempotent.booleanisONE()Is Product one.booleanisUnit()Is Product unit.booleanisZERO()Is Product zero.Product multiply by coefficient.Product multiplication.negate()Product negate.Quotient and remainder by division of this by S.Product quasi-remainder.intsignum()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, waitMethods 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:
isZEROin 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:
isONEin 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:
isFullin 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:
isUnitin 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:
isIdempotentin 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:
toScriptFactoryin 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:
absin interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- the absolute value of this.
- See Also:
-
sum
Product summation.- Specified by:
sumin interfaceAbelianGroupElem<C extends RingElem<C>>- Parameters:
S- Product.- Returns:
- this+S.
-
negate
Product negate.- Specified by:
negatein interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- -this.
- See Also:
-
signum
public int signum()Product signum.- Specified by:
signumin interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- signum of first non-zero component.
- See Also:
-
subtract
Product subtraction.- Specified by:
subtractin interfaceAbelianGroupElem<C extends RingElem<C>>- Parameters:
S- Product.- Returns:
- this-S.
-
inverse
Product quasi-inverse.- Specified by:
inversein interfaceMonoidElem<C extends RingElem<C>>- Returns:
- S with S = 1/this if defined.
- See Also:
-
idempotent
Product idempotent.- Specified by:
idempotentin interfaceRegularRingElem<C extends RingElem<C>>- Returns:
- smallest S with this*S = this.
-
idemComplement
Product idempotent complement.- Specified by:
idemComplementin interfaceRegularRingElem<C extends RingElem<C>>- Returns:
- 1-this.idempotent().
-
idempotentAnd
Product idempotent and.- Specified by:
idempotentAndin interfaceRegularRingElem<C extends RingElem<C>>- Parameters:
S- Product.- Returns:
- this.idempotent() and S.idempotent().
-
idempotentOr
Product idempotent or.- Specified by:
idempotentOrin interfaceRegularRingElem<C extends RingElem<C>>- Parameters:
S- Product.- Returns:
- this.idempotent() or S.idempotent().
-
fillIdempotent
Product fill with idempotent.- Specified by:
fillIdempotentin interfaceRegularRingElem<C extends RingElem<C>>- Parameters:
S- Product.- Returns:
- fill this with S.idempotent().
-
fillOne
Product fill with one.- Specified by:
fillOnein interfaceRegularRingElem<C extends RingElem<C>>- Returns:
- fill this with one.
-
divide
Product quasi-division.- Specified by:
dividein interfaceMonoidElem<C extends RingElem<C>>- Parameters:
S- Product.- Returns:
- this/S.
-
remainder
Product quasi-remainder.- Specified by:
remainderin 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:
quotientRemainderin interfaceMonoidElem<C extends RingElem<C>>- Parameters:
S- a product- Returns:
- [this/S, this - (this/S)*S].
-
multiply
Product multiplication.- Specified by:
multiplyin 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.
-