A class that extends CartesianProduct and allows access to combinations via an array index.

This class supports retrieving combinations using numeric indices, and provides a proxy to enable access via an array-like index as well as string keys.

Type Parameters

  • T extends InputArrays

    The type of the input arrays.

Hierarchy (View Summary)

Indexable

Constructors

Methods

  • Retrieves the combination (tuple) at a specific index in the Cartesian product.

    The index is computed based on the total number of possible combinations (the product of the sizes of the input arrays). If the provided index is outside the valid range (from 0 to total - 1), null is returned.

    Mathematical Calculation: The total number of combinations is calculated as the product of the lengths of all input arrays:

    total = size_1 * size_2 * ... * size_n
    

    Parameters

    • index: number

      The index of the combination to retrieve, between 0 and total - 1.

    Returns null | CartesianProductTuple<T>

    The combination at the specified index, or null if the index is out of bounds.