-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete an unused function template (#1772)
The function was never even instantiated.
- Loading branch information
Showing
2 changed files
with
1 addition
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,99 +3,15 @@ | |
// Author: Björn Buchhold ([email protected]) | ||
#pragma once | ||
|
||
#include <iomanip> | ||
#include <type_traits> | ||
#include <vector> | ||
|
||
#include "backports/algorithm.h" | ||
#include "engine/IndexSequence.h" | ||
#include "engine/idTable/IdTable.h" | ||
#include "global/Constants.h" | ||
#include "global/Id.h" | ||
#include "util/Exception.h" | ||
#include "util/Log.h" | ||
|
||
class Engine { | ||
public: | ||
template <typename Comp, int WIDTH> | ||
static void filter(const IdTableView<WIDTH>& v, const Comp& comp, | ||
IdTableStatic<WIDTH>* result) { | ||
AD_CONTRACT_CHECK(result); | ||
AD_CONTRACT_CHECK(result->size() == 0); | ||
LOG(DEBUG) << "Filtering " << v.size() << " elements.\n"; | ||
for (const auto& e : v) { | ||
if (comp(e)) { | ||
result->push_back(e); | ||
} | ||
} | ||
LOG(DEBUG) << "Filter done, size now: " << result->size() << " elements.\n"; | ||
} | ||
|
||
template <int IN_WIDTH, int FILTER_WIDTH> | ||
static void filter(const IdTable& dynV, size_t fc1, size_t fc2, | ||
const IdTable& dynFilter, IdTable* dynResult) { | ||
AD_CONTRACT_CHECK(dynResult); | ||
AD_CONTRACT_CHECK(dynResult->size() == 0); | ||
LOG(DEBUG) << "Filtering " << dynV.size() | ||
<< " elements with a filter relation with " << dynFilter.size() | ||
<< "elements\n"; | ||
|
||
// Check trivial case. | ||
if (dynV.size() == 0 || dynFilter.size() == 0) { | ||
return; | ||
} | ||
|
||
const IdTableView<IN_WIDTH> v = dynV.asStaticView<IN_WIDTH>(); | ||
const IdTableView<FILTER_WIDTH> filter = | ||
dynFilter.asStaticView<FILTER_WIDTH>(); | ||
IdTableStatic<IN_WIDTH> result = std::move(*dynResult).toStatic<IN_WIDTH>(); | ||
|
||
// Intersect both lists. | ||
size_t i = 0; | ||
size_t j = 0; | ||
|
||
while (i < v.size() && j < filter.size()) { | ||
while (v(i, fc1) < filter(j, 0)) { | ||
++i; | ||
if (i >= v.size()) { | ||
goto finish; | ||
} | ||
} | ||
while (filter(j, 0) < v(i, fc1)) { | ||
++j; | ||
if (j >= filter.size()) { | ||
goto finish; | ||
} | ||
} | ||
while (v(i, fc1) == filter(j, 0)) { | ||
// fc1 match, create cross-product | ||
// Check fc2 | ||
if (v(i, fc2) == filter(j, 1)) { | ||
result.push_back(v, i); | ||
++i; | ||
if (i >= v.size()) { | ||
break; | ||
} | ||
} else if (v(i, fc2) < filter(j, 1)) { | ||
++i; | ||
if (i >= v.size()) { | ||
break; | ||
} | ||
} else { | ||
++j; | ||
if (j >= filter.size()) { | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
finish: | ||
*dynResult = std::move(result).toDynamic(); | ||
|
||
LOG(DEBUG) << "Filter done, size now: " << dynResult->size() | ||
<< " elements.\n"; | ||
} | ||
|
||
template <size_t WIDTH> | ||
static void sort(IdTable* tab, const size_t keyColumn) { | ||
LOG(DEBUG) << "Sorting " << tab->size() << " elements ..." << std::endl; | ||
|