Fast in-place accumulation

IF 0.9 4区 数学 Q4 COMPUTER SCIENCE, THEORY & METHODS
Journal of Symbolic Computation Pub Date : 2026-05-01 Epub Date: 2025-10-15 DOI:10.1016/j.jsc.2025.102523
Jean-Guillaume Dumas, Bruno Grenet
{"title":"Fast in-place accumulation","authors":"Jean-Guillaume Dumas,&nbsp;Bruno Grenet","doi":"10.1016/j.jsc.2025.102523","DOIUrl":null,"url":null,"abstract":"<div><div>This paper deals with simultaneously fast and in-place algorithms for formulae where the result has to be linearly accumulated: some output variables are also input variables, linked by a linear dependency. Fundamental examples include the in-place accumulated multiplication of polynomials or matrices, <span><math><mi>C</mi><mo>+</mo><mo>=</mo><mi>A</mi><mi>B</mi></math></span> (that is with only <span><math><mi>O</mi><mo>(</mo><mn>1</mn><mo>)</mo></math></span> extra space). The difficulty is to combine in-place computations with fast algorithms: those usually come at the expense of (potentially large) extra temporary space, but with accumulation the output variables are not even available to store intermediate values. We first propose a novel automatic design of fast and in-place accumulating algorithms for any bilinear formulae (and thus for polynomial and matrix multiplication) and then extend it to any linear accumulation of a collection of functions. For this, we relax the in-place model to any algorithm allowed to modify its inputs, provided that those are restored to their initial state afterwards. This allows us to ultimately derive unprecedented in-place accumulating algorithms for fast polynomial multiplications and for Strassen-like matrix multiplications.</div><div>We then consider the simultaneously fast and in-place computation of the Euclidean polynomial modular remainder <span><math><mi>R</mi><mo>(</mo><mi>X</mi><mo>)</mo><mo>≡</mo><mi>A</mi><mo>(</mo><mi>X</mi><mo>)</mo><mspace></mspace><mrow><mi>mod</mi></mrow><mspace></mspace><mi>B</mi><mo>(</mo><mi>X</mi><mo>)</mo></math></span>. Fast algorithms for this usually also come at the expense of a linear amount of extra temporary space. In particular, they require one to first compute and store the whole quotient <span><math><mi>Q</mi><mo>(</mo><mi>X</mi><mo>)</mo></math></span> such that <span><math><mi>A</mi><mo>=</mo><mi>B</mi><mi>Q</mi><mo>+</mo><mi>R</mi></math></span>. We here propose an <em>in-place</em> algorithm to compute the remainder only. If <em>A</em> and <em>B</em> have respective degree <span><math><mi>m</mi><mo>+</mo><mi>n</mi></math></span> and <em>n</em>, and <span><math><mi>M</mi><mo>(</mo><mi>k</mi><mo>)</mo></math></span> denotes the complexity of a (not-in-place) algorithm to multiply two degree-<em>k</em> polynomials, our algorithm uses at most <span><math><mi>O</mi><mrow><mo>(</mo><mfrac><mrow><mi>m</mi></mrow><mrow><mi>n</mi></mrow></mfrac><mi>M</mi><mo>(</mo><mi>n</mi><mo>)</mo><mi>log</mi><mo>⁡</mo><mo>(</mo><mi>n</mi><mo>)</mo><mo>)</mo></mrow></math></span> arithmetic operations. In this particular case this is a factor <span><math><mi>log</mi><mo>⁡</mo><mo>(</mo><mi>n</mi><mo>)</mo></math></span> more than the not-in-place algorithm. But if <span><math><mi>M</mi><mo>(</mo><mi>n</mi><mo>)</mo><mo>=</mo><mi>Θ</mi><mo>(</mo><msup><mrow><mi>n</mi></mrow><mrow><mn>1</mn><mo>+</mo><mi>ϵ</mi></mrow></msup><mo>)</mo></math></span> for some <span><math><mi>ϵ</mi><mo>&gt;</mo><mn>0</mn></math></span>, then our algorithms do match the not-in-place complexity bound of <span><math><mi>O</mi><mrow><mo>(</mo><mfrac><mrow><mi>m</mi></mrow><mrow><mi>n</mi></mrow></mfrac><mi>M</mi><mo>(</mo><mi>n</mi><mo>)</mo><mo>)</mo></mrow></math></span>. We also propose variants that compute – still in-place and with the same kind of complexity bounds – the over-place remainder <span><math><mi>A</mi><mo>(</mo><mi>X</mi><mo>)</mo><mo>≡</mo><mi>A</mi><mo>(</mo><mi>X</mi><mo>)</mo><mspace></mspace><mrow><mi>mod</mi></mrow><mspace></mspace><mi>B</mi><mo>(</mo><mi>X</mi><mo>)</mo></math></span>, the accumulated remainder <span><math><mi>R</mi><mo>(</mo><mi>X</mi><mo>)</mo><mo>+</mo><mo>=</mo><mi>A</mi><mo>(</mo><mi>X</mi><mo>)</mo><mspace></mspace><mrow><mi>mod</mi></mrow><mspace></mspace><mi>B</mi><mo>(</mo><mi>X</mi><mo>)</mo></math></span> and the accumulated modular multiplication <span><math><mi>R</mi><mo>(</mo><mi>X</mi><mo>)</mo><mo>+</mo><mo>=</mo><mi>A</mi><mo>(</mo><mi>X</mi><mo>)</mo><mi>C</mi><mo>(</mo><mi>X</mi><mo>)</mo><mspace></mspace><mrow><mi>mod</mi></mrow><mspace></mspace><mi>B</mi><mo>(</mo><mi>X</mi><mo>)</mo></math></span>, that is multiplication in a polynomial extension of a finite field.</div><div>To achieve this, we develop techniques for Toeplitz matrix operations, for generalized convolutions, short product and power series division and remainder whose output is also part of the input.</div></div>","PeriodicalId":50031,"journal":{"name":"Journal of Symbolic Computation","volume":"134 ","pages":"Article 102523"},"PeriodicalIF":0.9000,"publicationDate":"2026-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Symbolic Computation","FirstCategoryId":"100","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0747717125001051","RegionNum":4,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2025/10/15 0:00:00","PubModel":"Epub","JCR":"Q4","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0

Abstract

This paper deals with simultaneously fast and in-place algorithms for formulae where the result has to be linearly accumulated: some output variables are also input variables, linked by a linear dependency. Fundamental examples include the in-place accumulated multiplication of polynomials or matrices, C+=AB (that is with only O(1) extra space). The difficulty is to combine in-place computations with fast algorithms: those usually come at the expense of (potentially large) extra temporary space, but with accumulation the output variables are not even available to store intermediate values. We first propose a novel automatic design of fast and in-place accumulating algorithms for any bilinear formulae (and thus for polynomial and matrix multiplication) and then extend it to any linear accumulation of a collection of functions. For this, we relax the in-place model to any algorithm allowed to modify its inputs, provided that those are restored to their initial state afterwards. This allows us to ultimately derive unprecedented in-place accumulating algorithms for fast polynomial multiplications and for Strassen-like matrix multiplications.
We then consider the simultaneously fast and in-place computation of the Euclidean polynomial modular remainder R(X)≡A(X)modB(X). Fast algorithms for this usually also come at the expense of a linear amount of extra temporary space. In particular, they require one to first compute and store the whole quotient Q(X) such that A=BQ+R. We here propose an in-place algorithm to compute the remainder only. If A and B have respective degree m+n and n, and M(k) denotes the complexity of a (not-in-place) algorithm to multiply two degree-k polynomials, our algorithm uses at most O(mnM(n)log⁡(n)) arithmetic operations. In this particular case this is a factor log⁡(n) more than the not-in-place algorithm. But if M(n)=Θ(n1+ϵ) for some ϵ>0, then our algorithms do match the not-in-place complexity bound of O(mnM(n)). We also propose variants that compute – still in-place and with the same kind of complexity bounds – the over-place remainder A(X)≡A(X)modB(X), the accumulated remainder R(X)+=A(X)modB(X) and the accumulated modular multiplication R(X)+=A(X)C(X)modB(X), that is multiplication in a polynomial extension of a finite field.
To achieve this, we develop techniques for Toeplitz matrix operations, for generalized convolutions, short product and power series division and remainder whose output is also part of the input.
就地快速堆积
本文同时处理公式的快速和就地算法,其中结果必须是线性累积的:一些输出变量也是输入变量,通过线性依赖关系连接。基本的例子包括多项式或矩阵的就地累积乘法,C+=AB(即只有O(1)个额外空间)。困难之处在于将就地计算与快速算法结合起来:这些计算通常以(可能很大的)额外临时空间为代价,但是随着累积,输出变量甚至无法用于存储中间值。我们首先提出了一种新的快速和就地积累算法的自动设计,适用于任何双线性公式(从而适用于多项式和矩阵乘法),然后将其扩展到函数集合的任何线性积累。为此,我们将就地模型放宽为允许修改其输入的任何算法,前提是这些输入随后恢复到初始状态。这使我们最终能够为快速多项式乘法和Strassen-like矩阵乘法推导出前所未有的就地累积算法。然后我们考虑欧几里得多项式模余数R(X)≡A(X)modB(X)的同时快速就地计算。快速算法通常也以额外的线性临时空间为代价。特别是,它们要求首先计算并存储整个商Q(X),使A=BQ+R。我们在此提出一种只计算余数的就地算法。如果A和B的阶分别为m+n和n, m (k)表示两个k阶多项式相乘的(非原位)算法的复杂度,则我们的算法最多使用O(mnM(n)log (n))个算术运算。在这种特殊情况下,它比非原地算法大log (n)个因子。但是,如果M(n)=Θ(n1+ λ)对于某些ϵ>;0,那么我们的算法确实符合O(mnM(n))的非原位复杂性界限。我们还提出了计算变体-仍然在原地并且具有相同类型的复杂性界限-过位余数A(X)≡A(X)modB(X),累积余数R(X)+=A(X)modB(X)和累积模乘法R(X)+=A(X)C(X)modB(X),即在有限域的多项式扩展中的乘法。为了实现这一点,我们开发了Toeplitz矩阵运算,广义卷积,短乘积和幂级数除法和余数的技术,其输出也是输入的一部分。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Journal of Symbolic Computation
Journal of Symbolic Computation 工程技术-计算机:理论方法
CiteScore
2.10
自引率
14.30%
发文量
75
审稿时长
142 days
期刊介绍: An international journal, the Journal of Symbolic Computation, founded by Bruno Buchberger in 1985, is directed to mathematicians and computer scientists who have a particular interest in symbolic computation. The journal provides a forum for research in the algorithmic treatment of all types of symbolic objects: objects in formal languages (terms, formulas, programs); algebraic objects (elements in basic number domains, polynomials, residue classes, etc.); and geometrical objects. It is the explicit goal of the journal to promote the integration of symbolic computation by establishing one common avenue of communication for researchers working in the different subareas. It is also important that the algorithmic achievements of these areas should be made available to the human problem-solver in integrated software systems for symbolic computation. To help this integration, the journal publishes invited tutorial surveys as well as Applications Letters and System Descriptions.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书