intervals

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Empty = Interval{Empty: true}

Functions

This section is empty.

Types

type BoundType

type BoundType *int64
var (
	Infinity BoundType = nil
)

func Bound

func Bound(v int64) BoundType

type Interval

type Interval struct {
	// Lower is the lower bound of the interval; can be a concrete number or the special constant
	// Infinity (interpreted as -infinity)
	Lower BoundType
	// Upper is the upper bound of the interval; can be a concrete number or the special constant
	// Infinity
	Upper BoundType
	// Empty indicates that this interval is empty
	Empty bool
}

Interval is a structure representing an interval of integer numbers, [Lower, Upper]

func NewInterval

func NewInterval(lower, upper BoundType) Interval

func (Interval) Intersect

func (i Interval) Intersect(o Interval) Interval

func (Interval) Overlaps

func (i Interval) Overlaps(o Interval) bool

func (Interval) String

func (i Interval) String() string

Jump to

Keyboard shortcuts

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