intervalccl

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Covering

type Covering []Range

Covering represents a non-overlapping, but possibly non-contiguous, set of intervals.

func (Covering) Len

func (c Covering) Len() int

func (Covering) Less

func (c Covering) Less(i, j int) bool

func (Covering) Swap

func (c Covering) Swap(i, j int)

type Range

type Range struct {
	Start   []byte
	End     []byte
	Payload interface{}
}

Range is an interval with a payload.

func OverlapCoveringMerge

func OverlapCoveringMerge(coverings []Covering) []Range

OverlapCoveringMerge returns the set of intervals covering every range in the input such that no output range crosses an input endpoint. The payloads are returned as a `[]interface{}` and in the same order as they are in coverings.

Example:

covering 1: [1, 2) -> 'a', [3, 4) -> 'b', [6, 7) -> 'c'
covering 2: [1, 5) -> 'd'
output: [1, 2) -> 'ad', [2, 3) -> `d`, [3, 4) -> 'bd', [4, 5) -> 'd', [6, 7) -> 'c'

The input is mutated (sorted). It is also assumed (and not checked) to be valid (e.g. non-overlapping intervals in each covering).

Jump to

Keyboard shortcuts

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