All Projects → JuliaMath → IntervalSets.jl

JuliaMath / IntervalSets.jl

Licence: other
Interval Sets for Julia

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to IntervalSets.jl

Afnetworking Retrypolicy
Nice category that adds the ability to set the retry interval, retry count and progressiveness.
Stars: ✭ 197 (+217.74%)
Mutual labels:  interval
chronoman
Utility class to simplify use of timers created by setTimeout
Stars: ✭ 15 (-75.81%)
Mutual labels:  interval
candlestick-convert
[NPM] OHLCV Candlestick Batcher/Converter
Stars: ✭ 39 (-37.1%)
Mutual labels:  interval
executor
Gnome Shell Extension - Execute multiple shell commands periodically with separate intervals and display the output in gnome top bar.
Stars: ✭ 45 (-27.42%)
Mutual labels:  interval
interval-tree
A C++ header only interval tree implementation.
Stars: ✭ 38 (-38.71%)
Mutual labels:  interval
MOTE
Magnitude of the Effect - An Effect Size and CI calculator
Stars: ✭ 17 (-72.58%)
Mutual labels:  interval
Worker Timers
A replacement for setInterval() and setTimeout() which works in unfocused windows.
Stars: ✭ 162 (+161.29%)
Mutual labels:  interval
audio-context-timers
A replacement for setInterval() and setTimeout() which works in unfocused windows.
Stars: ✭ 12 (-80.65%)
Mutual labels:  interval
rust-lapper
Rust implementation of a fast, easy, interval tree library nim-lapper
Stars: ✭ 39 (-37.1%)
Mutual labels:  interval
fluent-plugin-http-pull
The input plugin of fluentd to pull log from rest api.
Stars: ✭ 19 (-69.35%)
Mutual labels:  interval
animate
👾 Create and manage animation functions with AnimationFrame API.
Stars: ✭ 11 (-82.26%)
Mutual labels:  interval
task-bundle
Scheduling of tasks for symfony made simple
Stars: ✭ 33 (-46.77%)
Mutual labels:  interval
irsync
rsync on interval, via command line binary or docker container. Server and IOT builds for pull or push based device content management.
Stars: ✭ 19 (-69.35%)
Mutual labels:  interval
Fastrange
A fast alternative to the modulo reduction
Stars: ✭ 230 (+270.97%)
Mutual labels:  interval
dlock
Interval Lock
Stars: ✭ 19 (-69.35%)
Mutual labels:  interval
Tonal
A functional music theory library for Javascript
Stars: ✭ 2,156 (+3377.42%)
Mutual labels:  interval
interval
This PHP library provides some tools to handle intervals. For instance, you can compute the union or intersection of two intervals.
Stars: ✭ 25 (-59.68%)
Mutual labels:  interval
UniRate
Unity plugin to easily manage the application frame rate and rendering interval. Preventing battery power consumption and device heat, especially on mobile platforms.
Stars: ✭ 26 (-58.06%)
Mutual labels:  interval
mahler.c
Western music theory library in C99
Stars: ✭ 13 (-79.03%)
Mutual labels:  interval
AdvancedTimer
AdvancedTimer implementation for Xamarin.Forms This repo is no longer maintained. New repo available.
Stars: ✭ 40 (-35.48%)
Mutual labels:  interval

IntervalSets.jl

Interval Sets for Julia

Build Status Coverage

This package represents intervals of an ordered set. For an interval spanning from a to b, all values x that lie between a and b are defined as being members of the interval.

This package is intended to implement a "minimal" foundation for intervals upon which other packages might build. In particular, we encourage type-piracy for the reason that only one interval package can unambiguously define the .. and ± operators (see below).

Currently this package defines one concrete type, Interval. These define the set spanning from a to b, meaning the interval is defined as the set {x} satisfying a ≤ x ≤ b. This is sometimes written [a,b] (mathematics syntax, not Julia syntax) or a..b.

Optionally, Interval{L,R} can represent open and half-open intervals. The type parameters L and R correspond to the left and right endpoint respectively. The notation ClosedInterval is short for Interval{:closed,:closed}, while OpenInterval is short for Interval{:open,:open}. For example, the interval Interval{:open,:closed} corresponds to the set {x} satisfying a < x ≤ b.

Usage

You can construct ClosedIntervals in a variety of ways:

julia> using IntervalSets

julia> ClosedInterval{Float64}(1,3)
1.0..3.0

julia> 0.5..2.5
0.5..2.5

julia> 1.5±1
0.5..2.5

Similarly, you can construct OpenIntervals and Interval{:open,:closed}s, and Interval{:closed,:open}:

julia> OpenInterval{Float64}(1,3)
1.0..3.0 (open)

julia> OpenInterval(0.5..2.5)
0.5..2.5 (open)

julia> Interval{:open,:closed}(1,3)
1..3 (open–closed)

The ± operator may be typed as \pm<TAB> (using Julia's LaTeX syntax tab-completion).

Intervals also support the expected set operations:

julia> 1.75  1.5±1  # \in<TAB>; can also use `in`
true

julia> 0  1.5±1
false

julia> 1  OpenInterval(0..1)
false

julia> intersect(1..5, 3..7)   # can also use `a ∩ b`, where the symbol is \cap<TAB>
3..5

julia> isempty(intersect(1..5, 10..11))
true

julia> (0.25..5)  (3..7.4)    # \cup<TAB>; can also use union()
0.25..7.4

julia> isclosedset(0.5..2.0)
true

julia> isopenset(OpenInterval(0.5..2.5))
true

julia> isleftopen(2..3)
false

When computing the union, the result must also be an interval:

julia> (0.25..5)  (6..7.4)
------ ArgumentError ------------------- Stacktrace (most recent call last)

 [1] — union(::IntervalSets.ClosedInterval{Float64}, ::IntervalSets.ClosedInterval{Float64}) at closed.jl:34

ArgumentError: Cannot construct union of disjoint sets.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].