Documentation ¶
Overview ¶
Package set provides integer and graph.Node sets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
Equal reports set equality between the parameters. Sets are equal if and only if they have the same elements.
func Int64sEqual ¶
Int64sEqual reports set equality between the parameters. Sets are equal if and only if they have the same elements.
Types ¶
type Int64s ¶
type Int64s map[int64]struct{}
Int64s is a set of int64 identifiers.
type Ints ¶
type Ints map[int]struct{}
Ints is a set of int identifiers.
type Nodes ¶
Nodes is a set of nodes keyed in their integer identifiers.
func IntersectionOfNodes ¶
IntersectionOfNodes returns the intersection of a and b.
The intersection of two sets, a and b, is the set containing all the elements shared between the two sets, for instance:
{a,b,c} INTERSECT {b,c,d} = {b,c}
The intersection between a set and itself is itself, and thus effectively a copy operation:
{a,b,c} INTERSECT {a,b,c} = {a,b,c}
The intersection between two sets that share no elements is the empty set:
{a,b,c} INTERSECT {d,e,f} = {}
func NewNodesSize ¶
NewNodes returns a new Nodes with the given size hint, n.
func UnionOfNodes ¶
UnionOfNodes returns the union of a and b.
The union of two sets, a and b, is the set containing all the elements of each, for instance:
{a,b,c} UNION {d,e,f} = {a,b,c,d,e,f}
Since sets may not have repetition, unions of two sets that overlap do not contain repeat elements, that is:
{a,b,c} UNION {b,c,d} = {a,b,c,d}