summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-01-09 19:02:33 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2018-01-09 19:02:33 +0100
commitaa66c74891bece9bcf9e4dc634aa3355c14cb249 (patch)
tree43635f501ce686a4df983d99c8c19ff13c445ea5 /eval
parentc2b5445e8d05fde0bd164471ff4a5541e43a4ac0 (diff)
Remove unused code.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.cpp21
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.h24
2 files changed, 10 insertions, 35 deletions
diff --git a/eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.cpp b/eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.cpp
index d5d2e3ff4c2..19a7038d686 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.cpp
@@ -10,36 +10,33 @@ DenseTensorAddressCombiner::~DenseTensorAddressCombiner() { }
DenseTensorAddressCombiner::DenseTensorAddressCombiner(const eval::ValueType &lhs,
const eval::ValueType &rhs)
- : _ops(),
- _combinedAddress(),
+ : _combinedAddress(),
_left(),
_commonRight(),
_right()
{
auto rhsItr = rhs.dimensions().cbegin();
auto rhsItrEnd = rhs.dimensions().cend();
+ uint32_t numDimensions(0);
for (const auto &lhsDim : lhs.dimensions()) {
while ((rhsItr != rhsItrEnd) && (rhsItr->name < lhsDim.name)) {
- _right.emplace_back(_ops.size(), rhsItr-rhs.dimensions().cbegin());
- _ops.push_back(AddressOp::RHS);
+ _right.emplace_back(numDimensions++, rhsItr-rhs.dimensions().cbegin());
++rhsItr;
}
if ((rhsItr != rhsItrEnd) && (rhsItr->name == lhsDim.name)) {
- _left.emplace_back(_ops.size(), _left.size());
- _commonRight.emplace_back(_ops.size(), rhsItr-rhs.dimensions().cbegin());
- _ops.push_back(AddressOp::BOTH);
+ _left.emplace_back(numDimensions, _left.size());
+ _commonRight.emplace_back(numDimensions, rhsItr-rhs.dimensions().cbegin());
+ ++numDimensions;
++rhsItr;
} else {
- _left.emplace_back(_ops.size(), _left.size());
- _ops.push_back(AddressOp::LHS);
+ _left.emplace_back(numDimensions++, _left.size());
}
}
while (rhsItr != rhsItrEnd) {
- _right.emplace_back(_ops.size(), rhsItr-rhs.dimensions().cbegin());
- _ops.push_back(AddressOp::RHS);
+ _right.emplace_back(numDimensions++, rhsItr-rhs.dimensions().cbegin());
++rhsItr;
}
- _combinedAddress.resize(_ops.size());
+ _combinedAddress.resize(numDimensions);
}
eval::ValueType
diff --git a/eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.h b/eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.h
index 92060ef430a..b09bcd945af 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.h
+++ b/eval/src/vespa/eval/tensor/dense/dense_tensor_address_combiner.h
@@ -18,25 +18,11 @@ namespace vespalib::tensor {
class DenseTensorAddressCombiner
{
public:
- using Address = DenseTensorCellsIterator::Address;
using Mapping = std::vector<std::pair<uint32_t, uint32_t>>;
private:
- enum class AddressOp { LHS, RHS, BOTH };
-
- using CellsIterator = DenseTensorCellsIterator;
-
- class AddressReader
- {
- private:
- const Address &_address;
- uint32_t _idx;
- public:
- AddressReader(const Address &address) : _address(address), _idx(0) {}
- Address::value_type nextLabel() { return _address[_idx++]; }
- };
+ using Address = DenseTensorCellsIterator::Address;
- std::vector<AddressOp> _ops;
Address _combinedAddress;
Mapping _left;
Mapping _commonRight;
@@ -50,14 +36,6 @@ public:
DenseTensorAddressCombiner(const eval::ValueType &lhs, const eval::ValueType &rhs);
~DenseTensorAddressCombiner();
void updateLeftAndCommon(const Address & addr) { update(addr, _left); }
- void updateRight(const Address & addr) { update(addr, _right); }
- bool hasCommonWithRight(const Address & addr) const {
- for (const auto & m : _commonRight) {
- if (_combinedAddress[m.first] != addr[m.second]) return false;
- }
- return true;
- }
-
const Mapping & getCommonRight() const { return _commonRight; }
const Mapping & getRight() const { return _right; }