Documentation
¶
Index ¶
- type Endpoint
- type Entry
- type Intersect
- func (m *Intersect[K, V]) Contiguous(values bool) iter.Seq[Entry[K, []V]]
- func (m *Intersect[K, V]) Entries() iter.Seq[Entry[K, []V]]
- func (m *Intersect[K, V]) Format(s fmt.State, v rune)
- func (m *Intersect[K, V]) Get(point K) Entry[K, []V]
- func (m *Intersect[K, V]) Insert(start, end K, value V) (disjoint bool)
- type Nesting
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint = constraints.Integer
Endpoint is a type that may be used as an interval endpoint.
type Entry ¶
Entry is an entry in a Intersect. This means that it is the intersection of all intervals which contain a particular point.
type Intersect ¶
Intersection is an interval intersection map: a collection of intervals, such that given a point in K, one can query for the intersection of all intervals in the collection which contain it, along with the values associated with each of those intervals.
A zero value is ready to use.
func (*Intersect[K, V]) Contiguous ¶
Ranges returns an iterator over the contiguous ranges in this map.
If values is true, the yielded entries will include all of the values that fall within those contiguous ranges.
func (*Intersect[K, V]) Entries ¶
Entries returns an iterator over the entries in this map.
There exists one entry per maximal subset of the map with non-empty intersection. Entries are yielded in order, and are pairwise disjoint.
func (*Intersect[K, V]) Format ¶
Format implements fmt.Formatter.
type Nesting ¶
Nesting is a collection of intervals (and associated values) arranged in such a way that splits the collection into strictly nesting sets: a strictly nesting set of intervals is one such that no intervals in it overlap, except when one set is a strict subset of another.
Inserting n intervals into this set is worst-case O(n^2 log n). Insertion order matters: larger intervals should be inserted first. To prevent nesting, insert *shorter* intervals first, instead.
func (*Nesting[K, V]) Clear ¶
func (n *Nesting[K, V]) Clear()
Clear resets this collection without discarding allocated memory (where possible).