hoi.core.combinations

Contents

hoi.core.combinations#

hoi.core.combinations(n, minsize, maxsize=None, astype='iterator', order=False, fill_value=-1, target=None)[source]#

Get combinations.

Parameters:
nint

Represents the total number of elements in the set

minsizeint

Minimum size of the multiplets

maxsizeint | None

Maximum size of the multiplets. If None, minsize is used.

astype{‘jax’, ‘numpy’, ‘iterator’}

Specify the output type. Use either ‘jax’ get the data as a jax array [default], ‘numpy’ for NumPy array or ‘iterator’.

orderbool, optional

If True, return the order of each multiplet. Default is False.

fill_valueint | -1

Value to use to fill missing values of multiplets.

targetlist | None

List of indices to use as targets.

Returns:
combsjnp.array

An array of shape (n_combinations, k) representing all possible combinations of k elements.