#monoid #arithmetic #congruence #factorization #integer #factor #progression

nightly bin+lib acm

Rust 中的算术同余半群实现

5 个版本

0.1.4 2021 年 4 月 12 日
0.1.3 2019 年 5 月 24 日
0.1.2 2019 年 5 月 24 日
0.1.1 2019 年 5 月 24 日
0.1.0 2019 年 5 月 23 日

1164数学

每月下载 40

MIT 许可证

30KB
361

算术同余半群

Latest version Documentation

在 Rust 中实现 算术同余半群 (ACM)。

简而言之,ACM 是一个具有乘法结构的算术级数,具体来说是一个半群

通过 我们得到一个希尔伯特半群

在 ACM 上,我们可以将整数分解为 ACM 的元素。这与简单的质因数分解类似,但每个因子必须属于 ACM。我们称不能表示为较小 ACM 元素乘积的元素为 原子

最终,这个库的目的是研究不同 ACM 的原子密度,即原子的距离。在某些 ACM 中,原子密度在整体上是可证明的恒定的,但在其他情况下则未知;这与所有整数集中质整数的密度或缺乏密度类似。

该项目最初是一个 acm-sage 的 C++ 端口,但对我 Rust 的兴趣使我重写了该项目。

命令行界面 (CLI)

首次构建

cargo b

提供了一个命令行程序 acm-cli,它包含子命令来测试主 ACM 模块和除数/因式分解子模块。

> ./target/debug/acm-cli acm 3 6 factorize 225
[[15, 15], [3, 75]]

> ./target/debug/acm-cli acm 1 4 atomic_density 100
16-||
   |
12-|                ●                ●  ●      ●        ●  ●              ●           ● ●                 ● ●         ●
   |
   |
 8-|   ●    ●   ●        ● ●●    ●●         ●       ●    ●   ●●   ● ● ● ●  ●●    ●           ●  ●  ●● ●●         ●
   |
   |
 4-|● ● ●●●  ●●●  ●● ●●●  ●  ● ●●  ●  ●● ● ● ●●  ●●● ● ●  ●    ●●●   ● ●     ●● ● ●●●  ● ●● ● ●   ●  ●   ● ● ● ●● ●● ● ●
   |
   |
 0+---------------------------------------------------------------------------------------------------------------------
                         |                       |                      |                       |
                        20                      40                     60                      80

有关完整的使用列表,请尝试使用 -h 标志运行任何子命令

> ./target/debug/acm-cli -h
acm-cli 0.1
nilsso <nilso@enosis.net>

USAGE:
    acm-cli <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    acm          ArithmeticCongruenceMonoid subcommand
    divisors     Integer divisors subcommand
    factorize    Integer factorization subcommand
    help         Prints this message or the help of the given subcommand(s)

文档

在本地构建所有文档并在浏览器中打开

RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps --open

测试

cargo t

依赖关系

~1.5MB
~23K SLoC