Package com.yahoo.tensor
Class IndexedTensor.Indexes
- java.lang.Object
-
- com.yahoo.tensor.IndexedTensor.Indexes
-
- Enclosing class:
- IndexedTensor
public abstract static class IndexedTensor.Indexes extends Object
An array of indexes into this tensor which are able to find the next index in the value order. next() can be called once per element in the dimensions we iterate over. It must be called once before accessing the first position.
-
-
Field Summary
Fields Modifier and Type Field Description protected long[]
indexes
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
hasNext()
Returns whether further values are available by calling next()long[]
indexesCopy()
long[]
indexesForReading()
Returns a copy of the indexes of this which must not be modifiedabstract void
next()
static IndexedTensor.Indexes
of(DimensionSizes sizes)
static IndexedTensor.Indexes
of(TensorType type)
Create indexes from a type containing bound indexed dimensions only.static IndexedTensor.Indexes
of(TensorType type, List<String> iterateDimensionOrder)
abstract long
size()
TensorAddress
toAddress()
Returns the address of the current position of these indexesList<Long>
toList()
Returns an immutable list containing a copy of the indexes in thislong
toSourceValueIndex()
String
toString()
-
-
-
Method Detail
-
of
public static IndexedTensor.Indexes of(TensorType type)
Create indexes from a type containing bound indexed dimensions only.- Throws:
IllegalStateException
- if the type contains dimensions which are not bound and indexed
-
of
public static IndexedTensor.Indexes of(TensorType type, List<String> iterateDimensionOrder)
-
of
public static IndexedTensor.Indexes of(DimensionSizes sizes)
-
toAddress
public TensorAddress toAddress()
Returns the address of the current position of these indexes
-
indexesCopy
public long[] indexesCopy()
-
indexesForReading
public long[] indexesForReading()
Returns a copy of the indexes of this which must not be modified
-
toSourceValueIndex
public long toSourceValueIndex()
-
toList
public List<Long> toList()
Returns an immutable list containing a copy of the indexes in this
-
size
public abstract long size()
-
next
public abstract void next()
-
hasNext
public abstract boolean hasNext()
Returns whether further values are available by calling next()
-
-