Skip to content

Commit

Permalink
Permute both x/y vectors in a single pass for efficiency.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Jun 27, 2024
1 parent 6196a72 commit a5f75b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/scran/fit_variance_trend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <algorithm>
#include <vector>
#include <array>
#include "WeightedLowess/WeightedLowess.hpp"

/**
Expand Down Expand Up @@ -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<Float_*, 2>{ xbuffer.data(), ybuffer.data() }, work);

WeightedLowess::Options<Float_> smooth_opt;
if (options.use_minimum_width) {
Expand Down

0 comments on commit a5f75b5

Please sign in to comment.