summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHaavard <havardpe@yahoo-inc.com>2017-01-11 12:21:44 +0000
committerHaavard <havardpe@yahoo-inc.com>2017-01-11 12:21:44 +0000
commitaa047631c6fe95f11570e14555775ed3f426116f (patch)
treef07f40455c414ec415b8a91fda5beab6a51441bc /vespalib
parentd010b8e9840273fd39edcd7d408aea30c3ce922b (diff)
rename perform functions to map and join
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/eval/simple_tensor/simple_tensor_test.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/eval/simple_tensor.cpp4
-rw-r--r--vespalib/src/vespa/vespalib/eval/simple_tensor.h4
-rw-r--r--vespalib/src/vespa/vespalib/eval/simple_tensor_engine.cpp4
4 files changed, 8 insertions, 8 deletions
diff --git a/vespalib/src/tests/eval/simple_tensor/simple_tensor_test.cpp b/vespalib/src/tests/eval/simple_tensor/simple_tensor_test.cpp
index 33812779a30..36cb9f773c1 100644
--- a/vespalib/src/tests/eval/simple_tensor/simple_tensor_test.cpp
+++ b/vespalib/src/tests/eval/simple_tensor/simple_tensor_test.cpp
@@ -91,7 +91,7 @@ TEST("require that simple tensors can have their values negated") {
.add({{"x","1"},{"y","1"}}, -1)
.add({{"x","2"},{"y","1"}}, 3)
.add({{"x","1"},{"y","2"}}, -5));
- auto result = SimpleTensor::perform(operation::Neg(), *tensor);
+ auto result = SimpleTensor::map(operation::Neg(), *tensor);
EXPECT_EQUAL(*expect, *result);
Stash stash;
const Value &result2 = SimpleTensorEngine::ref().map(operation::Neg(), *tensor, stash);
@@ -116,7 +116,7 @@ TEST("require that simple tensors can be multiplied with each other") {
.add({{"x","2"},{"y","1"},{"z","1"}}, 21)
.add({{"x","2"},{"y","1"},{"z","2"}}, 39)
.add({{"x","1"},{"y","2"},{"z","1"}}, 55));
- auto result = SimpleTensor::perform(operation::Mul(), *lhs, *rhs);
+ auto result = SimpleTensor::join(operation::Mul(), *lhs, *rhs);
EXPECT_EQUAL(*expect, *result);
Stash stash;
const Value &result2 = SimpleTensorEngine::ref().apply(operation::Mul(), *lhs, *rhs, stash);
diff --git a/vespalib/src/vespa/vespalib/eval/simple_tensor.cpp b/vespalib/src/vespa/vespalib/eval/simple_tensor.cpp
index 1c5a7d20535..d0d3ab49f42 100644
--- a/vespalib/src/vespa/vespalib/eval/simple_tensor.cpp
+++ b/vespalib/src/vespa/vespalib/eval/simple_tensor.cpp
@@ -439,7 +439,7 @@ SimpleTensor::equal(const SimpleTensor &a, const SimpleTensor &b)
}
std::unique_ptr<SimpleTensor>
-SimpleTensor::perform(const UnaryOperation &op, const SimpleTensor &a)
+SimpleTensor::map(const UnaryOperation &op, const SimpleTensor &a)
{
Cells cells(a.cells());
for (auto &cell: cells) {
@@ -449,7 +449,7 @@ SimpleTensor::perform(const UnaryOperation &op, const SimpleTensor &a)
}
std::unique_ptr<SimpleTensor>
-SimpleTensor::perform(const BinaryOperation &op, const SimpleTensor &a, const SimpleTensor &b)
+SimpleTensor::join(const BinaryOperation &op, const SimpleTensor &a, const SimpleTensor &b)
{
TypeAnalyzer type_info(a.type(), b.type());
Builder builder(type_info.result_type);
diff --git a/vespalib/src/vespa/vespalib/eval/simple_tensor.h b/vespalib/src/vespa/vespalib/eval/simple_tensor.h
index f2471b0cd04..51af84a53ff 100644
--- a/vespalib/src/vespa/vespalib/eval/simple_tensor.h
+++ b/vespalib/src/vespa/vespalib/eval/simple_tensor.h
@@ -76,8 +76,8 @@ public:
std::unique_ptr<SimpleTensor> reduce(const BinaryOperation &op, const std::vector<vespalib::string> &dimensions) const;
static std::unique_ptr<SimpleTensor> create(const TensorSpec &spec);
static bool equal(const SimpleTensor &a, const SimpleTensor &b);
- static std::unique_ptr<SimpleTensor> perform(const UnaryOperation &op, const SimpleTensor &a);
- static std::unique_ptr<SimpleTensor> perform(const BinaryOperation &op, const SimpleTensor &a, const SimpleTensor &b);
+ static std::unique_ptr<SimpleTensor> map(const UnaryOperation &op, const SimpleTensor &a);
+ static std::unique_ptr<SimpleTensor> join(const BinaryOperation &op, const SimpleTensor &a, const SimpleTensor &b);
};
} // namespace vespalib::eval
diff --git a/vespalib/src/vespa/vespalib/eval/simple_tensor_engine.cpp b/vespalib/src/vespa/vespalib/eval/simple_tensor_engine.cpp
index 06e514e51ba..9b77f7dfa99 100644
--- a/vespalib/src/vespa/vespalib/eval/simple_tensor_engine.cpp
+++ b/vespalib/src/vespa/vespalib/eval/simple_tensor_engine.cpp
@@ -102,7 +102,7 @@ SimpleTensorEngine::map(const UnaryOperation &op, const eval::Tensor &a, Stash &
{
assert(&a.engine() == this);
const SimpleTensor &simple_a = static_cast<const SimpleTensor&>(a);
- auto result = SimpleTensor::perform(op, simple_a);
+ auto result = SimpleTensor::map(op, simple_a);
return stash.create<TensorValue>(std::move(result));
}
@@ -113,7 +113,7 @@ SimpleTensorEngine::apply(const BinaryOperation &op, const eval::Tensor &a, cons
assert(&b.engine() == this);
const SimpleTensor &simple_a = static_cast<const SimpleTensor&>(a);
const SimpleTensor &simple_b = static_cast<const SimpleTensor&>(b);
- auto result = SimpleTensor::perform(op, simple_a, simple_b);
+ auto result = SimpleTensor::join(op, simple_a, simple_b);
return stash.create<TensorValue>(std::move(result));
}