2个不稳定版本
使用旧Rust 2015
0.2.0 | 2016年9月18日 |
---|---|
0.1.0 | 2015年11月16日 |
在机器学习中排名第582
56KB
1K SLoC
pcp,一个暴力破解pcp解决方案搜索器
这是一个暴力破解pcp解决方案搜索器的Rust实现。问题从标准输入或命令行中指定的文件读取(有关更多详细信息,请参阅使用说明)。
问题文件由任意数量的(utf-8编码)行组成,每行非空行代表一对单词,由两个由空格分隔的字段组成,每个字段代表这对单词中的一个单词。
单词可以由任意数量的非空白Unicode字符组成,每个唯一字符将替换为唯一的固定宽度位模式。每个单词的位数总数不得超过56。
请参阅根目录中的*.pcp
文件中的示例问题规范。来自德国维基百科的wiki*.pcp
文件,(自首次发布此存储库以来已删除homework.pcp
来自我的理论计算机科学课程的一次练习homework.pcp
)。
使用方法
pcp 0.1.0
Tim Neumann <[email protected]>
A brute-force pcp solution searcher
USAGE:
pcp [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-f <file> Read the problem from the specified file instead of stdin
-n <max_iter> The maximum number of iterations to perform
示例运行
pcp < homework.pcp
Found 2 symbols.
Using 1 bit(s) to encode each symbol.
Running with 8 threads.
Now starting iteration 183
Now starting iteration 197
Now starting iteration 207
Now starting iteration 213
success! n: 216, s: 396
-- Statistics --
chunk size: 64 MB
chunks allocated: 39
chunks deallocated: 0
chunks total memory: 2.4 GB
chunks in current working set: 32
pairs applied: 1.1 billion
pairs applied successfully: 403.4 million
number of iterations: 217
total iteration time: 5.7 seconds
operations: 196.0 thousand ops/ms
安装
您需要一个最新的nightly版本的rust来编译此crate。然后,您可以使用cargo install pcp
安装它。如果从源安装,请确保使用--release
编译!
依赖关系
~2.5MB
~35K SLoC