Package edu.jas.poly
Class IndexList
java.lang.Object
edu.jas.poly.IndexList
- All Implemented Interfaces:
Element<IndexList>
,MonoidElem<IndexList>
,Serializable
,Comparable<IndexList>
IndexList implements index lists for exterior polynomials. Index lists are
implemented as arrays of Java int type. Objects of this class are intended to
be immutable, except for the sign. If in doubt use
valueOf
to
get a conformant index list.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal IndexFactory
Reference to IndexFactory.int
Sign of index list.final int[]
Representation of index list as int arrays. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for IndexList.IndexList
(IndexFactory m, int[] v) Constructor for IndexList.IndexList
(IndexFactory m, int s, int[] v) Constructor for IndexList.IndexList
(IndexFactory m, String s) Constructor for IndexList. -
Method Summary
Modifier and TypeMethodDescriptionabs()
IndexList absolute value.long
Returns the number of bits in the representation of this index vector.int
IndexList compareTo.copy()
Clone this.int
degree()
IndexList degree.IndexList divide.boolean
IndexList divides test.boolean
Comparison with any other object.IndexList exterior product.factory()
Get the corresponding element factory.int[]
getVal()
Get the index vector.int
getVal
(int i) Get the index at position i.int
hashCode()
hashCode.IndexList interior left product.IndexList interior right product.inverse()
IndexList inverse.boolean
Check for IndexList conformant specification.boolean
isONE()
Is IndexList one.boolean
isUnit()
Is IndexList a unit.boolean
isZERO()
Is IndexList zero.int
length()
Get the length of this index list.int
maxDeg()
IndexList maximal degree.int
minDeg()
IndexList minimal degree.IndexList multiply.negate()
IndexList negate.IndexList remainder.protected int
setVal
(int i, int e) Set the index at position i to e.int
signum()
IndexList signum.int
IndexList strongCompareTo.toScript()
Get a scripting compatible string representation.Get a scripting compatible string representation of the factory.toString()
Get the string representation.int
IndexList weakCompareTo.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
-
val
public final int[] valRepresentation of index list as int arrays. -
sign
public int signSign of index list. -
mono
Reference to IndexFactory.
-
-
Constructor Details
-
IndexList
Constructor for IndexList. No argument constructor defining 0 index list. -
IndexList
Constructor for IndexList.- Parameters:
v
- array with indices.
-
IndexList
Constructor for IndexList. Note: A copy of v is internally created.- Parameters:
s
- sign of index list.v
- array with indices.
-
IndexList
Constructor for IndexList. Converts a String representation to an IndexList. Accepted format = E(1,2,3,4,5,6,7).- Parameters:
s
- String representation.- Throws:
NumberFormatException
-
-
Method Details
-
factory
Get the corresponding element factory. -
isConformant
public boolean isConformant()Check for IndexList conformant specification.- Returns:
- true if this a a conformant IndexList, else false.
-
copy
Clone this. -
getVal
public int[] getVal()Get the index vector.- Returns:
- val.
-
getVal
public int getVal(int i) Get the index at position i.- Parameters:
i
- position.- Returns:
- val[i].
-
setVal
protected int setVal(int i, int e) Set the index at position i to e.- Parameters:
i
- positione
- new index- Returns:
- old val[i].
-
length
public int length()Get the length of this index list.- Returns:
- val.length or -1 for 0 index list.
-
toString
Get the string representation. -
toScript
Get a scripting compatible string representation. -
toScriptFactory
Get a scripting compatible string representation of the factory.- Specified by:
toScriptFactory
in interfaceElement<IndexList>
- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
equals
Comparison with any other object. -
hashCode
public int hashCode()hashCode. Optimized for small indexes, i.e. ≤ 24 and small number of variables, i.e. ≤ 8. -
bitLength
public long bitLength()Returns the number of bits in the representation of this index vector.- Returns:
- number of bits in the representation of this IndexList, including sign bits.
-
isZERO
public boolean isZERO()Is IndexList zero.- Returns:
- If this sign is 0 then true is returned, else false.
-
isONE
public boolean isONE()Is IndexList one.- Specified by:
isONE
in interfaceMonoidElem<IndexList>
- Returns:
- If this sign != 0 and length val is zero then true returned, else false.
-
isUnit
public boolean isUnit()Is IndexList a unit.- Specified by:
isUnit
in interfaceMonoidElem<IndexList>
- Returns:
- If this is a unit then true is returned, else false.
-
abs
IndexList absolute value.- Returns:
- abs(this).
-
negate
IndexList negate.- Returns:
- -this.
-
exteriorProduct
IndexList exterior product. Also called wegde product.- Parameters:
V
- other index list- Returns:
- this /\ V.
-
multiply
IndexList multiply. Note: implemented by exteriorProduct.- Specified by:
multiply
in interfaceMonoidElem<IndexList>
- Parameters:
V
- other index list- Returns:
- this * V.
-
interiorLeftProduct
IndexList interior left product.- Parameters:
V
- other index list- Returns:
- this _| V.
-
interiorRightProduct
IndexList interior right product.- Parameters:
V
- other index list- Returns:
- this |_ V.
-
divides
IndexList divides test. Test if this is contained in V.- Parameters:
V
- other index list- Returns:
- true if this divides V, else false.
-
inverse
IndexList inverse. Note: not implemented.- Specified by:
inverse
in interfaceMonoidElem<IndexList>
- Returns:
- 1 / this.
-
divide
IndexList divide. Note: experimental.- Specified by:
divide
in interfaceMonoidElem<IndexList>
- Parameters:
V
- other IndexList.- Returns:
- this/V. Note: computed as interiorRightProduct, eventually useful.
-
remainder
IndexList remainder. Note: not implemented.- Specified by:
remainder
in interfaceMonoidElem<IndexList>
- Parameters:
V
- other IndexList.- Returns:
- this - (this/V). Note: not useful.
-
signum
public int signum()IndexList signum.- Returns:
- sign;
-
degree
public int degree()IndexList degree.- Returns:
- number of of all indexes.
-
maxDeg
public int maxDeg()IndexList maximal degree.- Returns:
- maximal index.
-
minDeg
public int minDeg()IndexList minimal degree.- Returns:
- minimal index.
-
compareTo
IndexList compareTo. -
weakCompareTo
IndexList weakCompareTo. Ignoring the degree in first pass.- Parameters:
V
- other index list- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-
strongCompareTo
IndexList strongCompareTo. Sort by degree in first pass, then by indices.- Parameters:
V
- other index list- Returns:
- 0 if U == V, -1 if U < V, 1 if U > V.
-