aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/erasure/helpers.cpp
diff options
context:
space:
mode:
authormax42 <max42@yandex-team.com>2023-06-30 11:13:34 +0300
committermax42 <max42@yandex-team.com>2023-06-30 11:13:34 +0300
commit3e1899838408bbad47622007aa382bc8a2b01f87 (patch)
tree0f21c1e6add187ddb6c3ccc048a7d640ce03fb87 /library/cpp/erasure/helpers.cpp
parent5463eb3f5e72a86f858a3d27c886470a724ede34 (diff)
downloadydb-3e1899838408bbad47622007aa382bc8a2b01f87.tar.gz
Revert "YT-19324: move YT provider to ydb/library/yql"
This reverts commit ca272f12fdd0e8d5c3e957fc87939148f1caaf72, reversing changes made to 49f8acfc8b0b5c0071b804423bcf53fda26c7c12.
Diffstat (limited to 'library/cpp/erasure/helpers.cpp')
-rw-r--r--library/cpp/erasure/helpers.cpp80
1 files changed, 0 insertions, 80 deletions
diff --git a/library/cpp/erasure/helpers.cpp b/library/cpp/erasure/helpers.cpp
deleted file mode 100644
index 74edeca52c..0000000000
--- a/library/cpp/erasure/helpers.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "helpers.h"
-
-#include <algorithm>
-#include <iterator>
-
-namespace NErasure {
-
-TPartIndexList MakeSegment(int begin, int end) {
- TPartIndexList result(end - begin);
- for (int i = begin; i < end; ++i) {
- result[i - begin] = i;
- }
- return result;
-}
-
-TPartIndexList MakeSingleton(int elem) {
- TPartIndexList result;
- result.push_back(elem);
- return result;
-}
-
-TPartIndexList Difference(int begin, int end, const TPartIndexList& subtrahend) {
- size_t pos = 0;
- TPartIndexList result;
- for (int i = begin; i < end; ++i) {
- while (pos < subtrahend.size() && subtrahend[pos] < i) {
- pos += 1;
- }
- if (pos == subtrahend.size() || subtrahend[pos] != i) {
- result.push_back(i);
- }
- }
- return result;
-}
-
-TPartIndexList Difference(const TPartIndexList& first, const TPartIndexList& second) {
- TPartIndexList result;
- std::set_difference(first.begin(), first.end(), second.begin(), second.end(), std::back_inserter(result));
- return result;
-}
-
-TPartIndexList Difference(const TPartIndexList& set, int subtrahend) {
- return Difference(set, MakeSingleton(subtrahend));
-}
-
-TPartIndexList Intersection(const TPartIndexList& first, const TPartIndexList& second) {
- TPartIndexList result;
- std::set_intersection(first.begin(), first.end(), second.begin(), second.end(), std::back_inserter(result));
- return result;
-}
-
-TPartIndexList Union(const TPartIndexList& first, const TPartIndexList& second) {
- TPartIndexList result;
- std::set_union(first.begin(), first.end(), second.begin(), second.end(), std::back_inserter(result));
- return result;
-}
-
-bool Contains(const TPartIndexList& set, int elem) {
- return std::binary_search(set.begin(), set.end(), elem);
-}
-
-TPartIndexList UniqueSortedIndices(const TPartIndexList& indices) {
- TPartIndexList copy = indices;
- std::sort(copy.begin(), copy.end());
- copy.erase(std::unique(copy.begin(), copy.end()), copy.end());
- return copy;
-}
-
-TPartIndexList ExtractRows(const TPartIndexList& matrix, int width, const TPartIndexList& rows) {
- Y_ASSERT(matrix.size() % width == 0);
- TPartIndexList result(width * rows.size());
- for (size_t i = 0; i < rows.size(); ++i) {
- auto start = matrix.begin() + rows[i] * width;
- std::copy(start, start + width, result.begin() + i * width);
- }
- return result;
-}
-
-} // namespace NErasure
-