nolin/permutations
Composer 安装命令:
composer require nolin/permutations
包简介
Generate permutations and combinations.
README 文档
README
This PHP package provides functionalities for generating combinations and permutations. Initially inspired by eoincampbell/combinatorics, this package is an adaptation for PHP environments. While translating, some comments may have been lost; however, you can refer to the original files for those details.
Installation
Install this package via Composer:
composer require nolin/permutations:dev-master
Usage
Once installed, you can use it in your PHP code as follows:
// Include the library use Nolin\Permutations\Permutations; // Create a permutations object with an array of elements $permutations = new Permutations([1, 2, 3, 4, 5]); // Iterate through the permutations foreach ($permutations as $permutation) { // Perform desired actions with each permutation // e.g., echo/print, store in an array, etc. }
Variations Feature
Variations have been transformed into VariationsWithRepetition and VariationsWithoutRepetition. The C# VariationsWithoutRepetition feature, originally from the source material, was not quite fitting the intended result. As a result, an upgrade has been made to the current() method.
Package Repository
Feel free to explore the codebase, report issues, or submit pull requests. Your contributions are welcomed and appreciated.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-27