mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
1.2 KiB
1.2 KiB
| layout |
|---|
| default |
Function setPowerset #
Create the powerset of a (multi)set. (The powerset contains very possible subsets of a (multi)set.) A multi-dimension array will be converted to a single-dimension array before the operation.
Syntax #
math.setPowerset(set)
Parameters #
| Parameter | Type | Description |
|---|---|---|
a |
Array | Matrix | A (multi)set |
Returns #
| Type | Description |
|---|---|
| Array | The powerset of the (multi)set |
Examples #
math.setPowerset([1, 2, 3]) // returns [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]