intervals

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interval

type Interval[T constraints.Ordered] interface {
	Min() T
	Max() T
	IncludeLR() (bool, bool)

	IsEmpty() bool
	IsSingleton() bool

	Enumerate(step T) []T
	Intervals() []Interval[T]

	Contains(value T) bool
	Overlaps(other Interval[T]) bool
	Equals(other Interval[T]) bool

	Union(other Interval[T]) Interval[T]
	Intersection(other Interval[T]) Interval[T]
	Difference(other Interval[T]) Interval[T]
}

func NewClosed

func NewClosed[T constraints.Ordered](min, max T) Interval[T]

func NewInterval

func NewInterval[T constraints.Ordered](min T, includeMin bool, max T, includeMax bool) Interval[T]

func NewLOpen

func NewLOpen[T constraints.Ordered](min, max T) Interval[T]

func NewMerged

func NewMerged[T constraints.Ordered](intervals ...Interval[T]) Interval[T]

func NewNull

func NewNull[T constraints.Ordered]() Interval[T]

func NewOpen

func NewOpen[T constraints.Ordered](min, max T) Interval[T]

func NewROpen

func NewROpen[T constraints.Ordered](min, max T) Interval[T]

func NewSingleton

func NewSingleton[T constraints.Ordered](v T) Interval[T]

type LOpenInterval

type LOpenInterval[T constraints.Ordered] [2]T

func (LOpenInterval[T]) Contains

func (loi LOpenInterval[T]) Contains(value T) bool

func (LOpenInterval[T]) Difference

func (loi LOpenInterval[T]) Difference(other Interval[T]) Interval[T]

func (LOpenInterval[T]) Enumerate

func (loi LOpenInterval[T]) Enumerate(step T) []T

func (LOpenInterval[T]) Equals

func (loi LOpenInterval[T]) Equals(other Interval[T]) bool

func (LOpenInterval[T]) IncludeLR

func (loi LOpenInterval[T]) IncludeLR() (bool, bool)

func (LOpenInterval[T]) Intersection

func (loi LOpenInterval[T]) Intersection(other Interval[T]) Interval[T]

func (LOpenInterval[T]) Intervals

func (loi LOpenInterval[T]) Intervals() []Interval[T]

func (LOpenInterval[T]) IsEmpty

func (loi LOpenInterval[T]) IsEmpty() bool

func (LOpenInterval[T]) IsSingleton

func (loi LOpenInterval[T]) IsSingleton() bool

func (LOpenInterval[T]) Max

func (loi LOpenInterval[T]) Max() T

func (LOpenInterval[T]) Min

func (loi LOpenInterval[T]) Min() T

func (LOpenInterval[T]) Overlaps

func (loi LOpenInterval[T]) Overlaps(other Interval[T]) bool

func (LOpenInterval[T]) Union

func (loi LOpenInterval[T]) Union(other Interval[T]) Interval[T]

type MergedIntervals

type MergedIntervals[T constraints.Ordered] []Interval[T]

func (MergedIntervals[T]) Boundaries

func (ni MergedIntervals[T]) Boundaries() []T

func (MergedIntervals[T]) Contains

func (ni MergedIntervals[T]) Contains(value T) bool

func (MergedIntervals[T]) Difference

func (ni MergedIntervals[T]) Difference(other Interval[T]) Interval[T]

func (MergedIntervals[T]) Enumerate

func (ni MergedIntervals[T]) Enumerate(step T) []T

func (MergedIntervals[T]) Equals

func (ni MergedIntervals[T]) Equals(other Interval[T]) bool

func (MergedIntervals[T]) IncludeLR

func (ni MergedIntervals[T]) IncludeLR() (bool, bool)

func (MergedIntervals[T]) Intersection

func (ni MergedIntervals[T]) Intersection(other Interval[T]) Interval[T]

func (MergedIntervals[T]) Intervals

func (ni MergedIntervals[T]) Intervals() []Interval[T]

func (MergedIntervals[T]) IsEmpty

func (ni MergedIntervals[T]) IsEmpty() bool

func (MergedIntervals[T]) IsSingleton

func (ni MergedIntervals[T]) IsSingleton() bool

func (MergedIntervals[T]) Max

func (ni MergedIntervals[T]) Max() T

func (MergedIntervals[T]) Min

func (ni MergedIntervals[T]) Min() T

func (MergedIntervals[T]) Overlaps

func (ni MergedIntervals[T]) Overlaps(other Interval[T]) bool

func (MergedIntervals[T]) Union

func (ni MergedIntervals[T]) Union(other Interval[T]) Interval[T]

type OpenInterval

type OpenInterval[T constraints.Ordered] [2]T

func (OpenInterval[T]) Contains

func (oi OpenInterval[T]) Contains(value T) bool

func (OpenInterval[T]) Difference

func (oi OpenInterval[T]) Difference(other Interval[T]) Interval[T]

func (OpenInterval[T]) Enumerate

func (oi OpenInterval[T]) Enumerate(step T) []T

func (OpenInterval[T]) Equals

func (oi OpenInterval[T]) Equals(other Interval[T]) bool

func (OpenInterval[T]) IncludeLR

func (oi OpenInterval[T]) IncludeLR() (bool, bool)

func (OpenInterval[T]) Intersection

func (oi OpenInterval[T]) Intersection(other Interval[T]) Interval[T]

func (OpenInterval[T]) Intervals

func (oi OpenInterval[T]) Intervals() []Interval[T]

func (OpenInterval[T]) IsEmpty

func (oi OpenInterval[T]) IsEmpty() bool

func (OpenInterval[T]) IsSingleton

func (oi OpenInterval[T]) IsSingleton() bool

func (OpenInterval[T]) Max

func (oi OpenInterval[T]) Max() T

func (OpenInterval[T]) Min

func (oi OpenInterval[T]) Min() T

func (OpenInterval[T]) Overlaps

func (oi OpenInterval[T]) Overlaps(other Interval[T]) bool

func (OpenInterval[T]) Union

func (oi OpenInterval[T]) Union(other Interval[T]) Interval[T]

type ROpenInterval

type ROpenInterval[T constraints.Ordered] [2]T

func (ROpenInterval[T]) Contains

func (roi ROpenInterval[T]) Contains(value T) bool

func (ROpenInterval[T]) Difference

func (roi ROpenInterval[T]) Difference(other Interval[T]) Interval[T]

func (ROpenInterval[T]) Enumerate

func (roi ROpenInterval[T]) Enumerate(step T) []T

func (ROpenInterval[T]) Equals

func (roi ROpenInterval[T]) Equals(other Interval[T]) bool

func (ROpenInterval[T]) IncludeLR

func (roi ROpenInterval[T]) IncludeLR() (bool, bool)

func (ROpenInterval[T]) Intersection

func (roi ROpenInterval[T]) Intersection(other Interval[T]) Interval[T]

func (ROpenInterval[T]) Intervals

func (roi ROpenInterval[T]) Intervals() []Interval[T]

func (ROpenInterval[T]) IsEmpty

func (roi ROpenInterval[T]) IsEmpty() bool

func (ROpenInterval[T]) IsSingleton

func (roi ROpenInterval[T]) IsSingleton() bool

func (ROpenInterval[T]) Max

func (roi ROpenInterval[T]) Max() T

func (ROpenInterval[T]) Min

func (roi ROpenInterval[T]) Min() T

func (ROpenInterval[T]) Overlaps

func (roi ROpenInterval[T]) Overlaps(other Interval[T]) bool

func (ROpenInterval[T]) Union

func (roi ROpenInterval[T]) Union(other Interval[T]) Interval[T]

Jump to

Keyboard shortcuts

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