We consider the computation of the euclidean polynomial modular remainder $R(X)\equiv{A(X)}\mod{B(X)}$ with $A$ and $B$ of respective degrees $n$ and $m\leq{n}$. If the multiplication of two polynomials of degree $k$ can be performed with $\mathfrak{M}(k)$ operations and $\mathcal{O}(k)$ extra space, then standard algorithms for the remainder require $\mathcal{O}(\frac{n}{m}\mathfrak{M}(m))$ arithmetic operations and, apart from that of $A$ and $B$, O(n) extra memory. This extra space is notably usually used to store the whole quotient $Q(X)$ such that $A=BQ+R$ with $\deg{R}<\deg{B}$. We avoid the storage of the whole of this quotient, and propose an algorithm still using $\mathcal{O}(\frac{n}{m}\mathfrak{M}(m))$ arithmetic operations but only $\mathcal{O}(m)$ extra space. When the divisor $B$ is sparse with a constant number of non-zero terms, the arithmetic complexity bound reduces to $\mathcal{O}(n)$. When it is allowed to use the input space of $A$ or $B$ for intermediate computations, but putting $A$ and $B$ back to their initial states after the completion of the remainder computation, we further propose an in-place algorithm (that is with its extra required space reduced to $\mathcal{O}(1)$ only) using $\mathcal{O}(n^{\log_2(3)})$ arithmetic operations over any field of zero or odd characteristic and over most of the characteristic two ones. To achieve this, we develop techniques for Toeplitz matrix operations which output is also part of the input.
翻译:我们考虑计算欧几里得多项式模余$R(X)\equiv{A(X)}\mod{B(X)}$,其中$A$与$B$的次数分别为$n$和$m\leq{n}$。若次数为$k$的两个多项式相乘需$\mathfrak{M}(k)$次运算及$\mathcal{O}(k)$额外空间,则标准求余算法需$\mathcal{O}(\frac{n}{m}\mathfrak{M}(m))$次算术运算,且除$A$与$B$的存储外,还需$\mathcal{O}(n)$额外内存。该额外空间通常用于存储满足$A=BQ+R$(其中$\deg{R}<\deg{B}$)的完整商式$Q(X)$。本文避免存储完整商式,提出一种仍使用$\mathcal{O}(\frac{n}{m}\mathfrak{M}(m))$次算术运算但仅需$\mathcal{O}(m)$额外空间的算法。当除式$B$为稀疏多项式(非零项数为常数时),算术复杂度界可降至$\mathcal{O}(n)$。若允许使用$A$或$B$的输入空间进行中间计算,并在余式计算完成后将$A$与$B$恢复至初始状态,我们进一步提出一种原位算法(即额外所需空间仅缩减至$\mathcal{O}(1)$),该算法在零特征或奇特征域以及大部分二特征域上仅需$\mathcal{O}(n^{\log_2(3)})$次算术运算。为实现此目标,我们发展了输出同时作为输入的Toeplitz矩阵运算技术。