Skip to content
Snippets Groups Projects
Commit 4ee37768 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added bicubic_sort_weights_by_index_zip()

parent 80bf8d23
No related branches found
No related tags found
1 merge request!225M214003/develop
......@@ -7,6 +7,7 @@
#include <atomic>
#include "cpp_lib.h"
#include "process_int.h"
#include "cdo_timer.h"
#include <mpim_grid.h>
......@@ -59,7 +60,21 @@ renormalize_weights(const double (&srcLats)[4], double (&weights)[4][4])
for (int i = 0; i < 4; ++i) weights[i][2] = 0.0;
for (int i = 0; i < 4; ++i) weights[i][3] = 0.0;
}
/*
#ifdef HAVE_RANGES_ZIP
#include <ranges>
static void
bicubic_sort_weights_by_index_zip(size_t (&indices)[4], double (&weights)[4][4])
{
auto r = std::views::zip(indices, weights);
std::sort(r.begin(), r.end, [](auto a, auto b) {
auto [ai, aw] = a; // std::tuple
auto [bi, bw] = b;
return (ai < bi);
});
}
#endif
*/
static void
bicubic_sort_weights_by_index(size_t (&indices)[4], double (&weights)[4][4])
{
......@@ -94,7 +109,11 @@ bicubic_sort_weights(size_t (&indices)[4], double (&weights)[4][4])
constexpr size_t numWeights = 4;
if (is_sorted_list(numWeights, indices)) return;
// #ifdef HAVE_RANGES_ZIP
// bicubic_sort_weights_by_index_zip(indices, weights);
// #else
bicubic_sort_weights_by_index(indices, weights);
// #endif
}
static void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment