summaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/tensor/IndexedDoubleTensor.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/tensor/IndexedDoubleTensor.java')
-rw-r--r--vespajlib/src/main/java/com/yahoo/tensor/IndexedDoubleTensor.java25
1 files changed, 20 insertions, 5 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/IndexedDoubleTensor.java b/vespajlib/src/main/java/com/yahoo/tensor/IndexedDoubleTensor.java
index 5d5c2be4576..c9e5be31c15 100644
--- a/vespajlib/src/main/java/com/yahoo/tensor/IndexedDoubleTensor.java
+++ b/vespajlib/src/main/java/com/yahoo/tensor/IndexedDoubleTensor.java
@@ -52,6 +52,11 @@ class IndexedDoubleTensor extends IndexedTensor {
}
@Override
+ public IndexedTensor.BoundBuilder cell(float value, long ... indexes) {
+ return cell((double)value, indexes);
+ }
+
+ @Override
public IndexedTensor.BoundBuilder cell(double value, long ... indexes) {
values[(int)toValueIndex(indexes, sizes())] = value;
return this;
@@ -63,6 +68,11 @@ class IndexedDoubleTensor extends IndexedTensor {
}
@Override
+ public Builder cell(TensorAddress address, float value) {
+ return cell(address, (double)value);
+ }
+
+ @Override
public Builder cell(TensorAddress address, double value) {
values[(int)toValueIndex(address, sizes())] = value;
return this;
@@ -77,6 +87,11 @@ class IndexedDoubleTensor extends IndexedTensor {
}
@Override
+ public Builder cell(Cell cell, float value) {
+ return cell(cell, (double)value);
+ }
+
+ @Override
public Builder cell(Cell cell, double value) {
long directIndex = cell.getDirectIndex();
if (directIndex >= 0) // optimization
@@ -86,11 +101,11 @@ class IndexedDoubleTensor extends IndexedTensor {
return this;
}
- /**
- * Set a cell value by the index in the internal layout of this cell.
- * This requires knowledge of the internal layout of cells in this implementation, and should therefore
- * probably not be used (but when it can be used it is fast).
- */
+ @Override
+ public void cellByDirectIndex(long index, float value) {
+ cellByDirectIndex(index, (double)value);
+ }
+
@Override
public void cellByDirectIndex(long index, double value) {
values[(int)index] = value;