Class IndexFactory
java.lang.Object
edu.jas.poly.IndexFactory
- All Implemented Interfaces:
ElemFactory<IndexList>, MonoidFactory<IndexList>, Serializable
IndexList factory implements a factory for index lists for exterior
polynomials. Objects of this class are intended to be immutable. If in doubt
use
valueOf to get a conformant index list.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classComparator for IndexLists. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default imaxlength for this index lists.static final StringThe default coordinate variable name.private final IndexFactory.IndexListComparatorDefined descending order comparator.private final IndexFactory.IndexListComparatorDefined descending weak order comparator.final IndexListThe maximal index list for this factory.final intThe maximal length index list for this factory.private static final org.apache.logging.log4j.LoggerLog4j logger object.private final IndexFactory.IndexListComparatorDefined ascending order comparator.private final IndexFactory.IndexListComparatorDefined ascending weak order comparator.final IndexListThe one element index list.private static final RandomRandom number generator.final StringThe coordinate variable name.(package private) final booleanDefined index list comparison. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for IndexFactory.IndexFactory(int r) Constructor for IndexFactory.IndexFactory(int r, boolean w) Constructor for IndexFactory.IndexFactory(int s, int t) Constructor for IndexFactory.IndexFactory(int s, int t, String v, boolean w) Constructor for IndexFactory.IndexFactory(int r, String v) Constructor for IndexFactory.IndexFactory(int r, String v, boolean w) Constructor for IndexFactory. -
Method Summary
Modifier and TypeMethodDescriptionClone IndexList.booleanComparison with any other object.fromInteger(long a) Get the Element for a.Get the Element for a.Generators.Get the ascending order comparator.Get the descending order comparator.getONE()Get IndexList one.getZERO()Get IndexList zero.inthashCode()hashCode.booleanQuery if this monoid is associative.booleanQuery if this monoid is commutative.booleanisFinite()Is this structure finite or infinite.intlength()Get the maximal length of index lists of this factory.Parse from Reader.Parser for IndexList.final IndexListrandom(int r) Generate a random IndexList.final IndexListrandom(int r, float q) Generate a random IndexList.final IndexListGenerate a random IndexList.final IndexListGenerate a random IndexList.final IndexListsequence(int s, int r) Generate a sequence IndexList.static int[]sequenceArray(int s, int r) Generate a sequence array.toScript()Get a scripting compatible string representation.toString()Get the string representation.valueOf(int[] e) Value of other.Value of other.Value of other.Value of other.valueOf(Collection<Integer> e) Value of other.
-
Field Details
-
imaxlength
public final int imaxlengthThe maximal length index list for this factory. -
vname
The coordinate variable name. -
imax
The maximal index list for this factory. -
weak
final boolean weakDefined index list comparison. Strong compare: false, weak compare: true. -
random
Random number generator. -
logger
private static final org.apache.logging.log4j.Logger loggerLog4j logger object. -
ONE
The one element index list. -
DEFAULT_VNAME
-
DEFAULT_SIZE
public static final int DEFAULT_SIZEThe default imaxlength for this index lists.- See Also:
-
horder
Defined descending order comparator. Sorts the highest terms first. -
lorder
Defined ascending order comparator. Sorts the lowest terms first. -
hweak
Defined descending weak order comparator. Sorts the highest terms first. -
lweak
Defined ascending weak order comparator. Sorts the lowest terms first.
-
-
Constructor Details
-
IndexFactory
public IndexFactory()Constructor for IndexFactory. No argument constructor . -
IndexFactory
public IndexFactory(int r) Constructor for IndexFactory.- Parameters:
r- length of index lists, starting with index 1.
-
IndexFactory
public IndexFactory(int r, boolean w) Constructor for IndexFactory.- Parameters:
r- length of index lists, starting with index 1.w- termorder for index lists: true for weak, false for strong.
-
IndexFactory
Constructor for IndexFactory.- Parameters:
r- length of index lists, starting with index 1.v- coordinate vname.
-
IndexFactory
Constructor for IndexFactory.- Parameters:
r- length of index lists, starting with index 1.v- coordinate vname.w- termorder for index lists: true for weak, false for strong.
-
IndexFactory
public IndexFactory(int s, int t) Constructor for IndexFactory.- Parameters:
s- start index.t- length of index lists.
-
IndexFactory
Constructor for IndexFactory.- Parameters:
s- start index.t- length of index lists.v- coordinate vname.w- termorder for index lists: true for weak, false for strong.
-
-
Method Details
-
isFinite
public boolean isFinite()Is this structure finite or infinite.- Specified by:
isFinitein interfaceElemFactory<IndexList>- Returns:
- true if this structure is finite, else false.
- See Also:
-
isCommutative
public boolean isCommutative()Query if this monoid is commutative.- Specified by:
isCommutativein interfaceMonoidFactory<IndexList>- Returns:
- true if this monoid is commutative, else false.
-
isAssociative
public boolean isAssociative()Query if this monoid is associative.- Specified by:
isAssociativein interfaceMonoidFactory<IndexList>- Returns:
- true if this monoid is associative, else false.
-
fromInteger
Get the Element for a.- Specified by:
fromIntegerin interfaceElemFactory<IndexList>- Parameters:
a- long- Returns:
- element corresponding to a.
-
fromInteger
Get the Element for a.- Specified by:
fromIntegerin interfaceElemFactory<IndexList>- Parameters:
a- java.math.BigInteger.- Returns:
- element corresponding to a.
-
valueOf
-
valueOf
Value of other.- Specified by:
valueOfin interfaceElemFactory<IndexList>- Parameters:
var- String of index names.- Returns:
- value as IndexList.
-
valueOf
Value of other.- Parameters:
e- other Collection of Integer indexes.- Returns:
- value as IndexList.
-
valueOf
Value of other.- Parameters:
e- other int[] of indexes, may not be conform to IndexList specification.- Returns:
- value as IndexList.
-
valueOf
-
generators
Generators.- Specified by:
generatorsin interfaceElemFactory<IndexList>- Returns:
- list of generators for this index list.
-
copy
Clone IndexList.- Specified by:
copyin interfaceElemFactory<IndexList>- Parameters:
o-- Returns:
- a copy of c.
- See Also:
-
length
public int length()Get the maximal length of index lists of this factory.- Returns:
- imaxlength.
-
toString
-
toScript
Get a scripting compatible string representation.- Specified by:
toScriptin interfaceElemFactory<IndexList>- Returns:
- script compatible representation for this Element.
- See Also:
-
parse
Parser for IndexList. Converts a String representation to an IndexList. Accepted format = E(1,2,3,4,5,6,7).- Specified by:
parsein interfaceElemFactory<IndexList>- Parameters:
s- String representation.- Returns:
- parsed IndexList
- Throws:
NumberFormatException
-
parse
Parse from Reader. White space is delimiter for index list.- Specified by:
parsein interfaceElemFactory<IndexList>- Parameters:
r- Reader.- Returns:
- the next Element found on r.
-
equals
-
hashCode
-
getZERO
-
getONE
Get IndexList one.- Specified by:
getONEin interfaceMonoidFactory<IndexList>- Returns:
- 1 IndexList.
-
random
Generate a random IndexList.- Specified by:
randomin interfaceElemFactory<IndexList>- Parameters:
r- length of new IndexList.- Returns:
- random IndexList.
-
random
Generate a random IndexList.- Specified by:
randomin interfaceElemFactory<IndexList>- Parameters:
r- length of new IndexList.rnd- is a source for random bits.- Returns:
- random IndexList.
-
random
Generate a random IndexList.- Parameters:
r- length of new IndexList.q- density of nozero indexes.- Returns:
- random IndexList.
-
random
-
sequence
Generate a sequence IndexList.- Parameters:
s- starting index.r- length of new IndexList.- Returns:
- sequence (s, s+1, ..., s+r-1) IndexList.
-
sequenceArray
public static int[] sequenceArray(int s, int r) Generate a sequence array.- Parameters:
s- starting index.r- length of array.- Returns:
- sequence (s, s+1, ..., s+r-1) array.
-
getDescendComparator
Get the descending order comparator. Sorts the highest terms first.- Returns:
- horder.
-
getAscendComparator
Get the ascending order comparator. Sorts the lowest terms first.- Returns:
- lorder.
-