Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoralez committed May 6, 2024
1 parent d635d45 commit 55c7526
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/rolling.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ template <typename T, typename Comp>
inline void RollingCompTransform(const T *data, int n, T *out, int window_size,
int min_samples) {
int upper_limit = std::min(window_size, n);
SortedDeque<T, Comp> queue(window_size);
SortedDeque<T, Comp> sdeque(window_size);
for (int i = 0; i < upper_limit - 1; ++i) {
queue.Update(data[i]);
sdeque.Update(data[i]);
if (i + 1 < min_samples) {
out[i] = std::numeric_limits<T>::quiet_NaN();
} else {
out[i] = queue.Get();
out[i] = sdeque.Get();
}
}
for (int i = upper_limit - 1; i < n; ++i) {
queue.Update(data[i]);
out[i] = queue.Get();
sdeque.Update(data[i]);
out[i] = sdeque.Get();
}
}

Expand Down

0 comments on commit 55c7526

Please sign in to comment.