combins

package
v0.72.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinationsInt

func CombinationsInt(list []int, length int) (c chan []int)

combinations([]int{1, 2, 3, 4}, 2) => [1 2] [1 3] [1 4] [2 3] [2 4] [3 4]

func CombinationsInterface

func CombinationsInterface(list []interface{}, length int) (c chan []interface{})

func CombinsSliceInterface

func CombinsSliceInterface(c chan []interface{}, combin []interface{}, data [][]interface{})

example: [[1 2 3 4] [5 6 7 8]] ==> [[1 5] [1 6] [1 7] [1 8] [2 5] [2 6] [2 7] [2 8] [3 5] [3 6] [3 7] [3 8] [4 5] [4 6] [4 7] [4 8]]

func GenerateProductInt

func GenerateProductInt(data []int, length int) <-chan []int

GenerateCombinationsInt([]int{1,2,3,4}, 2) ==> [1 1][1 2][1 3][1 4][2 1][2 2][2 3][2 4][3 1][3 2][3 3][3 4][4 1][4 2][4 3][4 4]

func GenerateProductString

func GenerateProductString(data []string, length int) <-chan []string

[a b c d] ==> [[a a] [a b] [a c] [a d] [b a] [b b] [b c] [b d] [c a] [c b] [c c] [c d] [d a] [d b] [d c] [d d]]

func ProductInt

func ProductInt(c chan []int, combin []int, data []int, length int)

func ProductString

func ProductString(c chan []string, combin []string, data []string, length int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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