Home Manual Reference Source

Function

Static Public Summary
public

powerset(set: Iterable): IterableIterator<Array>

Powerset operator.

Static Private Summary
private

_increment(bitset: Array): number

_increment.

private

* _powerset(source: Iterator): IterableIterator<Array>

_powerset.

Static Public

public powerset(set: Iterable): IterableIterator<Array> source

Powerset operator.

Params:

NameTypeAttributeDescription
set Iterable

Return:

IterableIterator<Array>

All subsets of the input set.

Static Private

private _increment(bitset: Array): number source

_increment.

Params:

NameTypeAttributeDescription
bitset Array

Return:

number

The index of the first bit flipped to 1. All preceding bits have been flipped to 0.

private * _powerset(source: Iterator): IterableIterator<Array> source

_powerset.

Params:

NameTypeAttributeDescription
source Iterator

Return:

IterableIterator<Array>