sets

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChooseSet

func ChooseSet[T any](start, stopInclusive int, kind func(pair propcheck.SimpleRNG) (T, propcheck.SimpleRNG), lt func(l, r T) bool, eq func(l, r T) bool) func(propcheck.SimpleRNG) ([]T, propcheck.SimpleRNG)

Generates a set with A size in the indicated range using the given Gen lt - a predicate function that returns true if l is lexically less than r eq - a predicate function that returns true if l is equal to r Note that the returned set may not meet the minimum size requirement after de-duplication. This is impossible to handle in any general way(i.e. the set of bools with cardinality == 3).

func ToSet

func ToSet[T any](a []T, lt func(l, r T) bool, eq func(l, r T) bool) []T

Makes a "real" set from an array. A "real" set is an array without duplicates based upon the given equality predicate. Note the set operations in arrays package do not depend on the array being "real". Making a set is expensive because it requires sorting and de-duplication. lt - a predicate function that returns true if l is lexically less than r eq - a predicate function that returns true if l is equal to r

Types

This section is empty.

Jump to

Keyboard shortcuts

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