sets

package
v0.0.0-...-65468f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package sets provides functions for operations on sets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CartesianProduct

func CartesianProduct(setSizes []int) (<-chan []int, error)

CartesianProduct returns a channel that lists all the combinations of elements from the given setSizes to produce the Cartesian Product of all the values in the sets.

For example:

CartesianProduct([]int{3, 2})

Will produce the following int slices:

{2, 1},
{1, 1},
{0, 1},
{2, 0},
{1, 0},
{0, 0},

Each setSize must be greater than one.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL