summaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor_apply.h
diff options
context:
space:
mode:
Diffstat (limited to 'vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor_apply.h')
-rw-r--r--vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor_apply.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor_apply.h b/vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor_apply.h
new file mode 100644
index 00000000000..e0a8b2cee5b
--- /dev/null
+++ b/vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor_apply.h
@@ -0,0 +1,23 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#pragma once
+
+namespace vespalib {
+namespace tensor {
+class Tensor;
+class SparseTensor;
+namespace sparse {
+
+/**
+ * Create new tensor using all combinations of input tensor cells with matching
+ * labels for common dimensions, using func to calculate new cell value
+ * based on the cell values in the input tensors.
+ */
+template <typename Function>
+std::unique_ptr<Tensor>
+apply(const SparseTensor &lhs, const SparseTensor &rhs, Function &&func);
+
+
+} // namespace vespalib::tensor::sparse
+} // namespace vespalib::tensor
+} // namespace vespalib