cc.redberry.core.indices
Interface Indices
-
- All Known Subinterfaces:
- SimpleIndices
public interface IndicesThis interface states common tensor indices functionality. For specification and more information see methods summary and implementations. Objects of this type are considered to be immutable.For individual index structure (bit masks in the integer representation) see
IndicesUtils.- Since:
- 1.0
- See Also:
IndicesBuilder,IndexMapping,IndicesUtils
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description IndicesapplyIndexMapping(IndexMapping mapping)This method applies specifiedIndexMappingto thisIndicesobject and returns the resultingIndicesobject.booleanequals(java.lang.Object other)booleanequalsRegardlessOrder(Indices indices)Returnstrueif thisIndicesobject contains exactly same indices as specified one, without taking into account the relative ordering of indices.intget(IndexType type, int position)Returns the index of the specified type at the specified position in thisIndices.intget(int position)Returns the index at the specified position in thisIndices.IntArraygetAllIndices()Return immutableIntArrayof all indices.IndicesgetFree()Returns new instance ofIndices, which contains only free (non contracted) indices from thisIndicesinstance.IndicesgetInverted()Returns new instance ofIndices, which contains inverted indices, i.e.IndicesgetLower()Returns lower (covariant) indices.int[]getNamesOfDummies()Returns sorted array of dummy indices names.IndicesgetOfType(IndexType type)Returns indices of the specified type, which are contained in thisIndicesobject.short[]getPositionsInOrbits()IndicesgetUpper()Returns upper (contravariant) indices.intsize()Returns the number of indicesintsize(IndexType type)Returns the number of indices of specified type.voidtestConsistentWithException()Returns alwaystruein public API methods.int[]toArray()Returns a copy of inner array of indices.java.lang.StringtoString(OutputFormat outputFormat)String representation ofIndicesobject in specified output format.
-
-
-
Method Detail
-
getUpper
Indices getUpper()
Returns upper (contravariant) indices.- Returns:
- upper indices
-
getLower
Indices getLower()
Returns lower (covariant) indices.- Returns:
- lower indices
-
getAllIndices
IntArray getAllIndices()
Return immutableIntArrayof all indices.- Returns:
IntArrayof all indices
-
toArray
int[] toArray()
Returns a copy of inner array of indices.- Returns:
- a copy of inner array of indices
-
size
int size()
Returns the number of indices- Returns:
- number of indices
-
size
int size(IndexType type)
Returns the number of indices of specified type.- Parameters:
type- type of indices- Returns:
- number of indices of specified type
-
get
int get(int position)
Returns the index at the specified position in thisIndices.- Parameters:
position- position of the index- Returns:
- the index at the specified position in this
Indices - Throws:
java.lang.IndexOutOfBoundsException- - if the index is out of range (index < 0 || index >= size())
-
get
int get(IndexType type, int position)
Returns the index of the specified type at the specified position in thisIndices.- Parameters:
type- IndexTypeposition- position of the index to return- Returns:
- the index of the specified type at the
specified position in this
Indices - Throws:
java.lang.IndexOutOfBoundsException- - if the index is out of range
-
getNamesOfDummies
int[] getNamesOfDummies()
Returns sorted array of dummy indices names.- Returns:
- sorted array of dummy indices names
-
getFree
Indices getFree()
Returns new instance ofIndices, which contains only free (non contracted) indices from thisIndicesinstance. The returnedIndicesobject keeps the relative order of indices same as in the thisIndices.- Returns:
- only free indices
-
getInverted
Indices getInverted()
Returns new instance ofIndices, which contains inverted indices, i.e. all upper indices becomes lower, and all lower become upper. The terms of ordering in the result are same as in the initialIndicesobject.- Returns:
- indices with inverted states
-
getOfType
Indices getOfType(IndexType type)
Returns indices of the specified type, which are contained in thisIndicesobject.- Parameters:
type- the type of indices- Returns:
- indices of the specified type, which are contained in this indices object.
-
equalsRegardlessOrder
boolean equalsRegardlessOrder(Indices indices)
Returnstrueif thisIndicesobject contains exactly same indices as specified one, without taking into account the relative ordering of indices.- Parameters:
indices- indices- Returns:
trueif thisIndicesobject contains exactly same indices as specified one, with no respect to the relative ordering of indices.
-
testConsistentWithException
void testConsistentWithException()
Returns alwaystruein public API methods.
-
applyIndexMapping
Indices applyIndexMapping(IndexMapping mapping)
This method applies specifiedIndexMappingto thisIndicesobject and returns the resultingIndicesobject.- Parameters:
mapping- specifiedIndexMapping- Returns:
- resulting
Indicesobject - See Also:
IndexMapping
-
toString
java.lang.String toString(OutputFormat outputFormat)
String representation ofIndicesobject in specified output format.- Parameters:
outputFormat- output format- Returns:
- string representation of
Indicesobject in specified output format. - See Also:
OutputFormat
-
equals
boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
getPositionsInOrbits
short[] getPositionsInOrbits()
- See Also:
IndicesSymmetries.getPositionsInOrbits()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG