intset

package
v0.0.0-...-c4986e2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const UINTSIZE = 32 << (^uint(0) >> 63)

UINTSIZE represents size of uint.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntSet

type IntSet struct {
	// contains filtered or unexported fields
}

An IntSet is a set of small non-negative integers. Its zero value represents the empty set.

func (*IntSet) Add

func (s *IntSet) Add(x int)

Add adds the non-negative value x to the set.

func (*IntSet) AddAll

func (s *IntSet) AddAll(values ...int)

AddAll adds a given values to the set.

func (*IntSet) Clean

func (s *IntSet) Clean()

Clean removes all value from the set.

func (*IntSet) Copy

func (s *IntSet) Copy() *IntSet

Copy returns a new copy of the set.

func (*IntSet) DifferenceWith

func (s *IntSet) DifferenceWith(t *IntSet)

DifferenceWith sets s with elements in s but not in t.

func (*IntSet) Elems

func (s *IntSet) Elems() []int

Elems returns slice of values of the set.

func (*IntSet) Has

func (s *IntSet) Has(x int) bool

Has reports whether the set contains the non-negative value x.

func (*IntSet) IntersectWith

func (s *IntSet) IntersectWith(t *IntSet)

IntersectWith sets s with elements common to s and t

func (*IntSet) Len

func (s *IntSet) Len() int

Len returns the number of value in the set.

func (*IntSet) Remove

func (s *IntSet) Remove(x int)

Remove removes value from the set.

func (*IntSet) String

func (s *IntSet) String() string

String returns the set as a string of the form "{1 2 3}".

func (*IntSet) SymmetricDifference

func (s *IntSet) SymmetricDifference(t *IntSet)

SymmetricDifference sets s with elements in either s or t but not both.

func (*IntSet) UnionWith

func (s *IntSet) UnionWith(t *IntSet)

UnionWith sets s with elements from both s and t

Jump to

Keyboard shortcuts

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