From a8c8b589b95ea02d7c8c2e666d16c1100b00deba Mon Sep 17 00:00:00 2001 From: hitonanode <32937551+hitonanode@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:07:49 +0900 Subject: [PATCH] fix hadamard.hpp --- convolution/hadamard.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/convolution/hadamard.hpp b/convolution/hadamard.hpp index 8b428f72..91579bf3 100644 --- a/convolution/hadamard.hpp +++ b/convolution/hadamard.hpp @@ -10,7 +10,7 @@ template void abstract_fwht(std::vector &seq, F f) { assert(__builtin_popcount(n) == 1); for (int w = 1; w < n; w *= 2) { for (int i = 0; i < n; i += w * 2) { - for (int j = 0; j < w; j++) { f(seq[i + j], seq[i + j + w]); } + for (int j = 0; j < w; j++) f(seq.at(i + j), seq.at(i + j + w)); } } } @@ -25,7 +25,7 @@ std::vector bitwise_conv(std::vector x, std::vector y, F1 f, F2 finv) { } else { abstract_fwht(x, f), abstract_fwht(y, f); } - for (size_t i = 0; i < x.size(); i++) { x[i] *= y[i]; } + for (int i = 0; i < (int)x.size(); i++) x.at(i) *= y.at(i); abstract_fwht(x, finv); return x; }