Iterates over all combinations of the cartesian product and invokes the provided callback for each combination.
The function to be called for each combination, with the combination and its index as arguments.
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
The index of the combination to retrieve, between 0 and total - 1.
The combination at the specified index, or null if the index is out of bounds.
Returns an iterator for iterating over the combinations in the cartesian product.
An iterator for the cartesian product.
A class that extends
CartesianProductand 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.