diff --git a/include/expanding.h b/include/expanding.h index 2c579a0..d8b1008 100644 --- a/include/expanding.h +++ b/include/expanding.h @@ -21,13 +21,13 @@ inline void ExpandingStdTransform(const T *data, int n, T *out, T *agg) { template struct ExpandingMinTransform { void operator()(const T *data, int n, T *out) { - RollingCompTransform>(data, n, out, n, 1); + RollingMinTransform()(data, n, out, n, 1); } }; template struct ExpandingMaxTransform { void operator()(const T *data, int n, T *out) { - RollingCompTransform>(data, n, out, n, 1); + RollingMaxTransform()(data, n, out, n, 1); } }; diff --git a/include/rolling.h b/include/rolling.h index cc3e055..7eb6484 100644 --- a/include/rolling.h +++ b/include/rolling.h @@ -77,7 +77,7 @@ template struct ValWithIdx { template class SortedDeque { public: SortedDeque(int window_size, Comp comp = Comp()) - : window_size_(window_size), i_(-1), comp_(comp) {} + : window_size_(window_size), comp_(comp) {} void Update(T x) { while (!buffer_.empty() && comp_(buffer_.back().val, x)) { buffer_.pop_back(); @@ -93,7 +93,7 @@ template class SortedDeque { private: std::deque> buffer_; int window_size_; - int i_; + int i_ = -1; Comp comp_; };