aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2017-01-05 10:50:38 +0100
committerJon Bratseth <bratseth@yahoo-inc.com>2017-01-05 10:50:38 +0100
commit5977d8e45b6306a8516c06bbf57190ab3931380b (patch)
treeb21e83bbeb34ca699c7bb60d044810547d05639e /vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java
parentf6007e2cce9c6048ae27a8af3df6fdd917162f75 (diff)
Use Tensor.Cell in iteration interface
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java')
-rw-r--r--vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java b/vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java
index 030fdb754de..d55fe9e1ac8 100644
--- a/vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java
+++ b/vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java
@@ -100,7 +100,7 @@ public class Join extends PrimitiveTensorFunction {
/** When both tensors have the same dimensions, at most one cell matches a cell in the other tensor */
private Tensor singleSpaceJoin(Tensor a, Tensor b, TensorType joinedType) {
Tensor.Builder builder = Tensor.Builder.of(joinedType);
- for (Iterator<Map.Entry<TensorAddress, Double>> i = a.cellIterator(); i.hasNext(); ) {
+ for (Iterator<Tensor.Cell> i = a.cellIterator(); i.hasNext(); ) {
Map.Entry<TensorAddress, Double> aCell = i.next();
double bCellValue = b.get(aCell.getKey());
if (Double.isNaN(bCellValue)) continue; // no match
@@ -188,7 +188,7 @@ public class Join extends PrimitiveTensorFunction {
private Tensor generalSubspaceJoin(Tensor subspace, Tensor superspace, TensorType joinedType, boolean reversedArgumentOrder) {
int[] subspaceIndexes = subspaceIndexes(superspace.type(), subspace.type());
Tensor.Builder builder = Tensor.Builder.of(joinedType);
- for (Iterator<Map.Entry<TensorAddress, Double>> i = superspace.cellIterator(); i.hasNext(); ) {
+ for (Iterator<Tensor.Cell> i = superspace.cellIterator(); i.hasNext(); ) {
Map.Entry<TensorAddress, Double> supercell = i.next();
TensorAddress subaddress = mapAddressToSubspace(supercell.getKey(), subspaceIndexes);
double subspaceValue = subspace.get(subaddress);
@@ -220,9 +220,9 @@ public class Join extends PrimitiveTensorFunction {
int[] aToIndexes = mapIndexes(a.type(), joinedType);
int[] bToIndexes = mapIndexes(b.type(), joinedType);
Tensor.Builder builder = Tensor.Builder.of(joinedType);
- for (Iterator<Map.Entry<TensorAddress, Double>> aIterator = a.cellIterator(); aIterator.hasNext(); ) {
+ for (Iterator<Tensor.Cell> aIterator = a.cellIterator(); aIterator.hasNext(); ) {
Map.Entry<TensorAddress, Double> aCell = aIterator.next();
- for (Iterator<Map.Entry<TensorAddress, Double>> bIterator = b.cellIterator(); bIterator.hasNext(); ) {
+ for (Iterator<Tensor.Cell> bIterator = b.cellIterator(); bIterator.hasNext(); ) {
Map.Entry<TensorAddress, Double> bCell = bIterator.next();
TensorAddress combinedAddress = combineAddresses(aCell.getKey(), aToIndexes,
bCell.getKey(), bToIndexes, joinedType);