gonum: gonum.org/v1/gonum/graph/internal/set Index | Files

package set

import "gonum.org/v1/gonum/graph/internal/set"

Package set provides integer and graph.Node sets.

Index

Package Files

doc.go same.go set.go

func Equal Uses

func Equal(a, b Nodes) bool

Equal reports set equality between the parameters. Sets are equal if and only if they have the same elements.

func Int64sEqual Uses

func Int64sEqual(a, b Int64s) bool

Int64sEqual reports set equality between the parameters. Sets are equal if and only if they have the same elements.

func IntsEqual Uses

func IntsEqual(a, b Ints) bool

IntsEqual reports set equality between the parameters. Sets are equal if and only if they have the same elements.

type Int64s Uses

type Int64s map[int64]struct{}

Int64s is a set of int64 identifiers.

func (Int64s) Add Uses

func (s Int64s) Add(e int64)

Add inserts an element into the set.

func (Int64s) Count Uses

func (s Int64s) Count() int

Count reports the number of elements stored in the set.

func (Int64s) Has Uses

func (s Int64s) Has(e int64) bool

Has reports the existence of the element in the set.

func (Int64s) Remove Uses

func (s Int64s) Remove(e int64)

Remove deletes the specified element from the set.

type Ints Uses

type Ints map[int]struct{}

Ints is a set of int identifiers.

func (Ints) Add Uses

func (s Ints) Add(e int)

Add inserts an element into the set.

func (Ints) Count Uses

func (s Ints) Count() int

Count reports the number of elements stored in the set.

func (Ints) Has Uses

func (s Ints) Has(e int) bool

Has reports the existence of the element in the set.

func (Ints) Remove Uses

func (s Ints) Remove(e int)

Remove deletes the specified element from the set.

type Nodes Uses

type Nodes map[int64]graph.Node

Nodes is a set of nodes keyed in their integer identifiers.

func CloneNodes Uses

func CloneNodes(src Nodes) Nodes

CloneNodes returns a clone of src.

func IntersectionOfNodes Uses

func IntersectionOfNodes(a, b Nodes) Nodes

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 NewNodes Uses

func NewNodes() Nodes

NewNodes returns a new Nodes.

func NewNodesSize Uses

func NewNodesSize(n int) Nodes

NewNodes returns a new Nodes with the given size hint, n.

func UnionOfNodes Uses

func UnionOfNodes(a, b Nodes) Nodes

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}

func (Nodes) Add Uses

func (s Nodes) Add(n graph.Node)

Add inserts an element into the set.

func (Nodes) Count Uses

func (s Nodes) Count() int

Count returns the number of element in the set.

func (Nodes) Has Uses

func (s Nodes) Has(n graph.Node) bool

Has reports the existence of the elements in the set.

func (Nodes) Remove Uses

func (s Nodes) Remove(e graph.Node)

Remove deletes the specified element from the set.

Package set imports 2 packages (graph) and is imported by 7 packages. Updated 2019-03-20. Refresh now. Tools for package owners.