diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-06-14 13:50:54 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-06-14 13:50:54 +0200 |
commit | 799acc9335f0dc3eebc747db8397aef0b4d930a9 (patch) | |
tree | 051baee0f938c2b088daa4a0fcb9120993abd95c /vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java | |
parent | 7e2d577daf548e171a7d7bf16a6996f9b894c330 (diff) | |
parent | 1b2c6aa193483f9a7eaaf17a5a82037b93bd1749 (diff) |
Merge with master
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java b/vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java index aeb3da8ac40..aca2bfc1b0f 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java @@ -16,7 +16,7 @@ import java.util.Set; import java.util.function.DoubleBinaryOperator; /** - * An indexed (dense) tensor backed by a double array. + * An indexed (dense) tensor backed by an array. * * @author bratseth */ @@ -143,9 +143,8 @@ public abstract class IndexedTensor implements Tensor { long valueIndex = 0; for (int i = 0; i < indexes.length; i++) { - if (indexes[i] >= sizes.size(i)) { - throw new IllegalArgumentException(indexes + " are not within bounds"); - } + if (indexes[i] >= sizes.size(i)) + throw new IllegalArgumentException(Arrays.toString(indexes) + " are not within bounds"); valueIndex += productOfDimensionsAfter(i, sizes) * indexes[i]; } return valueIndex; |