Package com.yahoo.tensor
Class DimensionSizes
java.lang.Object
com.yahoo.tensor.DimensionSizes
The sizes of a set of dimensions.
- Author:
- bratseth
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder of a set of dimension sizes. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of dimensions this provides the size ofboolean
int
hashCode()
static DimensionSizes
of
(TensorType type) Create sizes from a type containing bound indexed dimensions only.long
size
(int dimensionIndex) Returns the length of this in the nth dimensionlong
Returns the product of the sizes of this
-
Method Details
-
of
Create sizes from a type containing bound indexed dimensions only.- Throws:
IllegalStateException
- if the type contains dimensions which are not bound and indexed
-
size
public long size(int dimensionIndex) Returns the length of this in the nth dimension- Throws:
IllegalArgumentException
- if the index is larger than the number of dimensions in this tensor minus one
-
dimensions
public int dimensions()Returns the number of dimensions this provides the size of -
totalSize
public long totalSize()Returns the product of the sizes of this -
equals
-
hashCode
public int hashCode()
-