Categorygithub.com/xtgo/set
modulepackage
1.0.0
Repository: https://github.com/xtgo/set.git
Documentation: pkg.go.dev

# README

set GoDoc Coverage Status

Package set provides type-safe, polymorphic mathematical set operations that operate on any sort.Interface implementation.

Documentation: http://godoc.org/github.com/xtgo/set

Talk: https://go-talks.appspot.com/github.com/xtblog/gotalks/sets.slide

# Functions

Apply concurrently applies op to all the sets terminated by pivots.
Diff performs an in-place difference on the two sets [0:pivot] and [pivot:Len]; the resulting set will occupy [0:size].
Float64s sorts and deduplicates a slice of float64s in place, returning the resulting set.
Float64sChk compares s and t according to cmp.
Float64sDo applies op to the float64 sets, s and t, returning the result.
Inter performs an in-place intersection on the two sets [0:pivot] and [pivot:Len]; the resulting set will occupy [0:size].
Ints sorts and deduplicates a slice of ints in place, returning the resulting set.
IntsChk compares s and t according to cmp.
IntsDo applies op to the int sets, s and t, returning the result.
IsEqual returns true if the sets [0:pivot] and [pivot:Len] are equal.
IsInter returns true if any element in the range [0:pivot] is also present in the range [pivot:Len].
IsSub returns true only if all elements in the range [0:pivot] are also present in the range [pivot:Len].
IsSuper returns true only if all elements in the range [pivot:Len] are also present in the range [0:pivot].
Pivots transforms set-relative sizes into data-absolute pivots.
Strings sorts and deduplicates a slice of strings in place, returning the resulting set.
StringsChk compares s and t according to cmp.
StringsDo applies op to the string sets, s and t, returning the result.
SymDiff performs an in-place symmetric difference on the two sets [0:pivot] and [pivot:Len]; the resulting set will occupy [0:size].
Union performs an in-place union on the two sets [0:pivot] and [pivot:Len]; the resulting set will occupy [0:size].
Uniq swaps away duplicate elements in data, returning the size of the unique set.

# Type aliases

The Cmp type can be used to represent any of the comparison functions, such as IsInter.
The Op type can be used to represent any of the mutating functions, such as Inter.