UNPKG

ultra-mega-enumerator

Version:

Ultra Mega Enumerator is a lightweight library designed to enumerate various combinatorial objects.

21 lines (20 loc) 632 B
import { AbstractEnumeration } from './AbstractEnumeration'; export declare class WordPermutationEnumeration extends AbstractEnumeration<number[]> { private nonzeroIndices; private combis; private it; private n; /** * For example, to enumerate the permutations of MISSISSIPPI, * * rk would be {1,4,4,2} because it has 1 M, 4 Is, 4 Ss, and 2 Ps. * * In the enumerated arrays, the 0s represent the M, the 1s the I, * the 2s the S and the 3 the Ps. * * @param rk Integer[] */ constructor(rk: number[]); hasMoreElements(): boolean; nextElement(): number[]; }