KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
interval-map
★ 9
Open GitHub ↗
No description available.
Download README (.md)
Explore Similar Repositories
TCIT_thermo
:
Taffi component increment theory used to predict enthalpy of formation, standard entropy and heat capacity.
lenovo-powershell
:
Powershell scripts for Lenovo
adguard-home-filters-blocklists
:
adguard-blocklist adguard home 搜集现存网上所有规则 接近两百万条 DNS 拦截率达50%以上
denote
:
No description available.
MoneyFromMobs
:
A Spigot plugin that makes mobs drop money with customizable visuals and a looting enchantment multiplier
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
interval-map
?
Download (.md)
# interval-map [](https://github.com/dgllghr/interval-map/actions) [Documentation](https://dgllghr.github.io/interval-map/interval-map/index.html) An immutable interval map data structure implemented as an interval tree. Based on [jgblight/im_interval_tree](https://github.com/jgblight/im_interval_tree). Interval maps are great for finding intervals and their associated values which overlap a given interval. This interval map supports intervals with excluded, included, and unbounded bound ends. Multiple values may be associated with the same interval. ## Installation ```bash opam install interval-map ``` ## Usage ```ocaml let module Ivl_map = Interval_map.Make (Int) in let module Ivl = Ivl_map.Interval in (* Build the map *) let map = Ivl_map.empty |> Ivl_map.add (Ivl.create (Included 0) (Excluded 10)) "foo" |> Ivl_map.add (Ivl.create (Included 0) (Excluded 10)) "foo2" |> Ivl_map.add (Ivl.create (Excluded 0) (Included 10)) "bar" |> Ivl_map.add (Ivl.create (Included 5) (Included 10)) "baz" |> Ivl_map.add (Ivl.create (Excluded 4) (Excluded 10)) "oof" |> Ivl_map.add (Ivl.create Unbounded (Excluded 4)) "zab" in (* Query the map *) let query = Ivl.create Unbounded (Included 4) in Ivl_map.query_interval query map |> Ivl_map.Query_results.to_list (* Results: [({Ivl_map.Interval.low = Ivl_map.Bound.Unbounded; high = Ivl_map.Bound.Excluded 4}, ["zab"]); ({Ivl_map.Interval.low = Ivl_map.Bound.Included 0; high = Ivl_map.Bound.Excluded 10}, ["foo2", "foo"]); ({Ivl_map.Interval.low = Ivl_map.Bound.Excluded 0; high = Ivl_map.Bound.Included 10}, ["bar"])] *) ```