sparse_set

package
v0.0.0-...-6a307ac Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Range

type Range[V constraints.Integer] struct {
	Start, End V // inclusive
}

sparseRange is an internal structure for storing range details.

func NewRange

func NewRange[V constraints.Integer](start, end V) *Range[V]

func (*Range[V]) Contains

func (s *Range[V]) Contains(val V) bool

func (*Range[V]) Valid

func (s *Range[V]) Valid() bool

type Set

type Set[V constraints.Integer] []Range[V]

sparseSet is an ordered series of disjoint sparseRange items. overlapping ranges are coalesced.

func (*Set[V]) Insert

func (s *Set[V]) Insert(val V) bool

func (*Set[V]) Remove

func (s *Set[V]) Remove(val V) bool

Jump to

Keyboard shortcuts

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