We study the exact counting problem for all lattice rectangles contained in the square $[0,n)\times[0,n)$, including non-axis-parallel ones. Starting from the standard parametrization by a primitive direction $(u,v)$ and two side lengths, we derive several exact algorithms: the classical $O(n^2)$ sweep, decompositions of complexity $O(n^{3/2}\log n)$ and $O(n^{4/3}\log n)$, a ten-moment weighted-floor-sum reduction of complexity $O(n\log^3 n)$, and a divisor-layer algorithm with the complexity $O(n\log^2 n)$. We also give an all-values algorithm that computes $F(1),\ldots,F(N)$ in $O(N^{3/2})$ arithmetic operations. The main idea behind the near-linear one-value algorithms is to reduce the geometric summation to constant-size families of weighted floor sums closed under Euclidean-style affine and reciprocal transformations. Besides the exact algorithmic results, we derive a two-term asymptotic expansion, $F(n)=\frac{4\log 2-1}{π^2}n^4\log n+B\,n^4+o(n^4)$ with the explicit formula for $B$, which provides an independent consistency check for the large-$n$ numerical data produced by the algorithms.


翻译:我们研究包含在正方形 $[0,n)\times[0,n)$ 中所有格点矩形(包括非轴对齐矩形)的精确计数问题。从基于原始方向 $(u,v)$ 和两个边长的标准参数化出发,我们推导出多种精确算法:经典的 $O(n^2)$ 扫描算法、复杂度为 $O(n^{3/2}\log n)$ 和 $O(n^{4/3}\log n)$ 的分解算法、复杂度为 $O(n\log^3 n)$ 的十矩加权下取整求和归约算法,以及复杂度为 $O(n\log^2 n)$ 的除数分层算法。我们还给出一种全值算法,可在 $O(N^{3/2})$ 次算术运算内计算 $F(1),\ldots,F(N)$。近线性单值算法的主要思想是将几何求和归约为常数大小的加权下取整求和族,该族在欧几里得式仿射和互反变换下保持封闭性。除精确算法结果外,我们推导出两项渐近展开式 $F(n)=\frac{4\log 2-1}{\pi^2}n^4\log n+B\,n^4+o(n^4)$,其中 $B$ 具有显式公式,这为算法产生的大 $n$ 数值数据提供了独立的自洽性验证。

0
下载
关闭预览

相关内容

在数学和计算机科学之中,算法(Algorithm)为一个计算的具体步骤,常用于计算、数据处理和自动推理。精确而言,算法是一个表示为有限长列表的有效方法。算法应包含清晰定义的指令用于计算函数。 来自维基百科: 算法
专知会员服务
42+阅读 · 2021年4月2日
【经典书】线性代数,Linear Algebra,525页pdf
专知会员服务
79+阅读 · 2021年1月29日
【硬核书】矩阵代数基础,248页pdf
专知
16+阅读 · 2021年12月9日
【干货】​深度学习中的线性代数
专知
21+阅读 · 2018年3月30日
【干货】理解深度学习中的矩阵运算
专知
12+阅读 · 2018年2月12日
Spark机器学习:矩阵及推荐算法
LibRec智能推荐
16+阅读 · 2017年8月3日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
美国从乌克兰无人机战争中学习经验
专知会员服务
5+阅读 · 6月21日
ICML 2026 | 面向视觉语言模型的语义鲁棒性认证
专知会员服务
2+阅读 · 6月21日
学习数据的几何:形状空间分析数学综述
专知会员服务
8+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
10+阅读 · 6月17日
相关VIP内容
专知会员服务
42+阅读 · 2021年4月2日
【经典书】线性代数,Linear Algebra,525页pdf
专知会员服务
79+阅读 · 2021年1月29日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员