From a5f75b58425abff78986f5a41ca3abfa2feacbb7 Mon Sep 17 00:00:00 2001 From: LTLA Date: Thu, 27 Jun 2024 00:23:09 -0700 Subject: [PATCH] Permute both x/y vectors in a single pass for efficiency. --- include/scran/fit_variance_trend.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/scran/fit_variance_trend.hpp b/include/scran/fit_variance_trend.hpp index 75aeafc..e0c9d11 100644 --- a/include/scran/fit_variance_trend.hpp +++ b/include/scran/fit_variance_trend.hpp @@ -3,6 +3,7 @@ #include #include +#include #include "WeightedLowess/WeightedLowess.hpp" /** @@ -153,8 +154,7 @@ void compute(size_t n, const Float_* mean, const Float_* variance, Float_* fitte auto& sorter = workspace.sorter; sorter.set(counter, xbuffer.data()); auto& work = workspace.sort_workspace; - sorter.permute(xbuffer.data(), work); - sorter.permute(ybuffer.data(), work); + sorter.permute(std::array{ xbuffer.data(), ybuffer.data() }, work); WeightedLowess::Options smooth_opt; if (options.use_minimum_width) {