Package com.yahoo.tensor
Class IndexedTensor.Indexes
java.lang.Object
com.yahoo.tensor.IndexedTensor.Indexes
- Enclosing class:
- IndexedTensor
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 -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanhasNext()Returns whether further values are available by calling next()long[]long[]Returns a copy of the indexes of this which must not be modifiedabstract voidnext()static IndexedTensor.Indexesof(DimensionSizes sizes) static IndexedTensor.Indexesof(TensorType type) Create indexes from a type containing bound indexed dimensions only.static IndexedTensor.Indexesof(TensorType type, List<String> iterateDimensionOrder) abstract longsize()Returns the address of the current position of these indexestoList()Returns an immutable list containing a copy of the indexes in thislongtoString()
-
Field Details
-
indexes
protected final long[] indexes
-
-
Method Details
-
of
Create indexes from a type containing bound indexed dimensions only.- Throws:
IllegalStateException- if the type contains dimensions which are not bound and indexed
-
of
-
of
-
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
Returns an immutable list containing a copy of the indexes in this -
toString
-
size
public abstract long size() -
next
public abstract void next() -
hasNext
public abstract boolean hasNext()Returns whether further values are available by calling next()
-