sparse_range.cr
SparseRange
Manage a set of ranges of Int32 or Float64.
Installation
-
Add the dependency to your
shard.yml:dependencies: sparse_range: github: your-github-user/sparse_range -
Run
shards install
Usage
require "sparse_range"
TODO: Write usage instructions here
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/your-github-user/sparse_range/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Paul M. Lambert - creator and maintainer
Test: r.begin >= range_to_add_begin.pred Test: r.begin >= range_to_add_end.succ
Given: [10..12, 20..22, 30..32]
Add: [ 0..2 ] insert before 0 (10..12) [0..2, 10..12, 20..22, 30..32] 0,0
Add: [ 0..11] merge into 0 (10..12) [0..12, 20..22, 30..32] 0,1
Add: [ 0..19] merge into 0,1 (10..12, 20..22) [0..22, 30..32] 0,1
Add: [10..15] merge into 0 (10..12) [10..15, 20..22, 30..32] 0,1
Add: [15..17] insert before 1 (20..22) [10..12, 15..17, 20..22, 30..32] 1,1
Add: [15..19] merge into 1 (20..22) [10..12, 15..22, 30..32] 1,
Add: [21..25] merge into 1 (20..22) [10..12, 20..25, 30..32]
Add: [11..31] merge into 0,1,2 (10..12, 20..25, 30..32) [10..32]
Add: [25..29] merge into 2 (30..32) [10..12, 20..22, 25..32]
Add: [25..31] merge into 2 (30..32) [10..12, 20..22, 25..32]
Add: [30..35] merge into 2 (30..32) [10..12, 20..22, 30..35]
Add: [33..33] merge into 2 (30..32) [10..12, 20..22, 30..33]
Add: [35..39] append after 2 (30..32) [10..12, 20..22, 30..32, 35..39]
sparse_range.cr
- 0
- 0
- 0
- 0
- 0
- about 5 hours ago
- March 21, 2026
MIT License
Sat, 21 Mar 2026 04:33:24 GMT