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 IndexFactoryReference to IndexFactory.intSign 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.longReturns the number of bits in the representation of this index vector.intIndexList compareTo.copy()Clone this.intdegree()IndexList degree.IndexList divide.booleanIndexList divides test.booleanComparison with any other object.IndexList exterior product.factory()Get the corresponding element factory.int[]getVal()Get the index vector.intgetVal(int i) Get the index at position i.inthashCode()hashCode.IndexList interior left product.IndexList interior right product.inverse()IndexList inverse.booleanCheck for IndexList conformant specification.booleanisONE()Is IndexList one.booleanisUnit()Is IndexList a unit.booleanisZERO()Is IndexList zero.intlength()Get the length of this index list.intmaxDeg()IndexList maximal degree.intminDeg()IndexList minimal degree.IndexList multiply.negate()IndexList negate.IndexList remainder.protected intsetVal(int i, int e) Set the index at position i to e.intsignum()IndexList signum.intIndexList strongCompareTo.toScript()Get a scripting compatible string representation.Get a scripting compatible string representation of the factory.toString()Get the string representation.intIndexList weakCompareTo.Methods inherited from interface 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
-
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
-
toScript
-
toScriptFactory
Get a scripting compatible string representation of the factory.- Specified by:
toScriptFactoryin interfaceElement<IndexList>- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
equals
-
hashCode
-
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:
isONEin 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:
isUnitin interfaceMonoidElem<IndexList>- Returns:
- If this is a unit then true is returned, else false.
-
abs
-
negate
-
exteriorProduct
-
multiply
IndexList multiply. Note: implemented by exteriorProduct.- Specified by:
multiplyin interfaceMonoidElem<IndexList>- Parameters:
V- other index list- Returns:
- this * V.
-
interiorLeftProduct
-
interiorRightProduct
-
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:
inversein interfaceMonoidElem<IndexList>- Returns:
- 1 / this.
-
divide
IndexList divide. Note: experimental.- Specified by:
dividein interfaceMonoidElem<IndexList>- Parameters:
V- other IndexList.- Returns:
- this/V. Note: computed as interiorRightProduct, eventually useful.
-
remainder
IndexList remainder. Note: not implemented.- Specified by:
remainderin 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
-
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.
-