comb

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package comb contains combinatorics functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CartesianProduct

func CartesianProduct[T any](domains ...[]T) iter.Seq2[uint64, []T]

CartesianProduct creates an iterator for the Cartesian product of the given domains

func Factorial

func Factorial(n uint64) uint64

Factorial computes N!

func Permutations

func Permutations[T any](items []T) iter.Seq2[uint64, []T]

Permutations function creates an iterator for all possible permutations in lexicographic order This uses the Factoradic System to compute the Permutation based on the index

func RangeCartesianProduct

func RangeCartesianProduct[T any](start, end uint64, domains ...[]T) iter.Seq2[uint64, []T]

RangeCartesianProduct creates an iterator for the Cartesian product of the given domains from index [start, end)

func RangePermutations

func RangePermutations[T any](start, end uint64, items []T) iter.Seq2[uint64, []T]

RangePermutations function creates an iterator for permutations for the given range, in lexicographic order. This uses the Factoradic System to compute the Permutation based on the index

Types

This section is empty.

Jump to

Keyboard shortcuts

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