This package has been deprecated

Author message:

This package has moved to @combinatorics/set-partition.

@aureooms/js-set-partition

0.0.1 • Public • Published

🍱 @aureooms/js-set-partition

The Zahlen symbol
User:Watchduck / CC BY 3.0

Set partition algorithms for JavaScript. See docs.

🏗️ Caveat emptor! This is work in progress. Code may be working. Documentation may be present. Coherence may be. Maybe.

⚠️ The code requires regeneratorRuntime to be defined, for instance by importing regenerator-runtime/runtime.

import {
	enumerate,
	count,
	_count,
	sequence,
	_sequence,
	isPartition
} from '@aureooms/js-set-partition';

import {range, map} from '@aureooms/js-itertools';

enumerate(range(0)); // []
enumerate(range(1)); // [[0]]
enumerate(range(2)); // [[0], [1]] [[0, 1]]

count(0); // 1n
count(1); // 1n
count(2); // 2n
count(3); // 5n
count(4); // 15n
count(5); // 52n
count(6); // 203n
count(26); // 49631246523618756274n

_count(1,6); // 203
_count(1,26); // ???

sequence(); // 1n 1n 2n 3n 5n 15n 52n 203n ...
_sequence(1); // 1 1 2 3 5 15 52 203 ...

isPartition(range(5), [range(5)]); // true
isPartition(range(5), map(x => [x], range(5))); // true
isPartition(range(5), map(x => (function* () {yield x;})(), range(5))); // true
isPartition(range(5), [[0], [1], [2], [3], [4]]); // true
isPartition(range(5), [[0, 1], [2], [3], [4]]); // true
isPartition(range(5), [[2, 1], [3], [0, 4]]); // true

isPartition(range(5), [[], [0], [1], [2], [3], [4]]); // false
isPartition(range(5), [[0], [0], [1], [2], [3], [4]]); // false
isPartition(range(5), [[5], [0], [1], [2], [3], [4]]); // false

License Version Build Dependencies Dev dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

Readme

Keywords

Package Sidebar

Install

npm i @aureooms/js-set-partition

Weekly Downloads

2

Version

0.0.1

License

AGPL-3.0

Unpacked Size

427 kB

Total Files

14

Last publish

Collaborators

  • aureooms