在\(O(n\log n)\)操作中计算格点矩形数量
Counting Lattice Rectangles in $O(n\log n)$ Operations
浏览论文内容
中文总结 AI 辅助
研究计算顶点属于\(n\times n\)格点正方形网格的矩形数量\(F(n)\)的问题,提出一种能在\(O(n\log n)\)操作中计算\(F(n)\)的精确算法,并通过实验将其C++实现与之前算法比较。
中文摘要 AI 辅助
设\(F(n)\)为顶点属于\(n\times n\)格点正方形网格的矩形数量(不一定与坐标轴平行)。我们给出一种精确算法,该算法能在\(O(n\log n)\)次算术运算和\(O(n^{3/4})\)个算术字的工作内存中计算一个规定值\(F(n)\)。算法将计数分解为莫比乌斯除数层,通过截断欧几里得系数锥递归对加权地板矩查询进行划分,并沿公共系数路径重用均匀标记网格。实验将报告输入范围内的精确128位C++实现与之前的\(O(n\log^2 n)\)算法进行了比较。
英文摘要
Let $F(n)$ be the number of rectangles, not necessarily axis-parallel, whose vertices belong to the $n\times n$ square grid of lattice points. We give an exact algorithm that computes one prescribed value $F(n)$ in $O(n\log n)$ arithmetic operations and $O(n^{3/4})$ arithmetic words of working memory. The algorithm decomposes the count into Möbius divisor layers, partitions weighted floor-moment queries by a truncated Euclidean coefficient-cone recursion, and reuses uniform marker grids along common coefficient paths. Each marker requires only its uniform cell and constant-size corrections at nearby boundaries, which select an exact precompiled cell operator. All integer operands have $O(\log n)$ bits. An exact 128-bit C++ implementation for the reported input range is compared experimentally with the previous $O(n\log^2 n)$ algorithm.