kevinsimard/combinatorics
Composer 安装命令:
composer require kevinsimard/combinatorics
包简介
Mathematical algorithms concerning the study of finite or countable discrete structures.
README 文档
README
Usage
You may add new elements to the list by using the add method:
$instance = new Combinatorics(["foo", "bar"]); $instance->add("baz"); $instance->add("qux"); // ["foo", "bar", "baz", "qux"]
You may also want to reset the list of elements by calling the reset method:
$instance = new Combinatorics(["foo", "bar"]); $instance->reset(); // []
Permutations
$elements = ["foo", "bar", "baz"]; $instance = new Combinatorics($elements); foreach ($instance->permutations() as $value) { ... } // OR foreach (Combinatorics::permutations($elements) as $value) { ... } // [ // ["foo", "bar", "baz"], // ["bar", "foo", "baz"], // ["bar", "baz", "foo"], // ["foo", "baz", "bar"], // ["baz", "foo", "bar"], // ["baz", "bar", "foo"] // ]
Structure
├── src
│ └── Combinatorics.php
├── tests
│ └── CombinatoricsTest.php
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .travis.yml
├── LICENSE.md
├── README.md
├── composer.json
├── composer.lock
└── phpunit.xml
License
This package is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-18