Skip to content

Commit cb6a2ae

Browse files
Merge pull request #134 from TileDB-Inc/lums/tmp/elide_ranges
Elide uses of ranges
2 parents 0daabc2 + 9f27e6a commit cb6a2ae

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/include/algorithm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void for_each(RandomIt first, RandomIt last, UnaryFunction f) {
8888
* Execute a function in parallel over a range of elements as specified
8989
* by a begin and end iterator.
9090
*/
91-
template <std::random_access_iterator RandomIt, class UnaryFunction>
91+
template <class RandomIt, class UnaryFunction>
9292
void for_each(
9393
stdx::execution::parallel_policy&& par,
9494
RandomIt begin,
@@ -123,7 +123,7 @@ void for_each(
123123
* by a begin and end iterator. We also pass the thread number and the
124124
* current iteration number to the function.
125125
*/
126-
template <std::random_access_iterator RandomIt, class UnaryFunction>
126+
template <class RandomIt, class UnaryFunction>
127127
void for_each(
128128
stdx::execution::indexed_parallel_policy&& par,
129129
RandomIt begin,
@@ -162,7 +162,7 @@ void for_each(
162162
/**
163163
* Same as above, but with a range, rather than iterator pair.
164164
*/
165-
template <class /*std::ranges::random_access_range*/ Range, class UnaryFunction>
165+
template <class Range, class UnaryFunction>
166166
void range_for_each(
167167
stdx::execution::indexed_parallel_policy&& par,
168168
Range&& range,

src/include/scoring.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,18 @@
5050
#include <memory>
5151
#include <numeric>
5252
#include <queue>
53-
#include <ranges>
5453
#include <set>
5554
#include <span>
55+
5656
// #include <execution>
5757

5858
#include "linalg.h"
5959
#include "utils/fixed_min_heap.h"
6060
#include "utils/timer.h"
6161

62+
63+
64+
6265
// ----------------------------------------------------------------------------
6366
// Helper utilities
6467
//----------------------------------------------------------------------------
@@ -182,9 +185,8 @@ inline auto dot(U const& a, V const& b) {
182185
* @param k
183186
* @return
184187
*/
185-
template <
186-
std::ranges::random_access_range V,
187-
std::ranges::random_access_range L>
188+
189+
template <class V, class L>
188190
auto get_top_k_from_scores(V const& scores, L&& top_k, int k) {
189191
fixed_min_pair_heap<float, unsigned> s(k);
190192

0 commit comments

Comments
 (0)