More edit

This commit is contained in:
Abastro 2025-03-25 22:57:59 +09:00
parent e9b06b766e
commit 3c39a7e58f

View file

@ -109,7 +109,7 @@ template <typename R> void poly_mult_basic_span(span<R> &a, span<R> &b, span<R>
} }
} }
// Basic polynomial multiplication // Basic polynomial multiplication.
template <typename R> vector<R> poly_mult_basic(vector<R> &a, vector<R> &b) { template <typename R> vector<R> poly_mult_basic(vector<R> &a, vector<R> &b) {
if (a.empty() && b.empty()) if (a.empty() && b.empty())
return vector<R>(0); return vector<R>(0);
@ -123,10 +123,14 @@ template <typename R> vector<R> poly_mult_basic(vector<R> &a, vector<R> &b) {
return result; return result;
} }
#define THRESHOLD 32 #define THRESHOLD 16
/** /**
* A step of the Karatsuba function. * A step of the Karatsuba function.
*
* NOTE: interestingly, the basic case is quite a performance bottleneck.
* Hence, the basic case needs to be implemented well.
*
* @param deg_bnd power-of-2 degree bound * @param deg_bnd power-of-2 degree bound
* @param buffer the buffer which is used only throughout the invocation * @param buffer the buffer which is used only throughout the invocation
*/ */