Expand description
§simd-intervaltree
A SIMD-accelerated interval tree with zero-allocation queries.
§Features
- Zero-allocation queries: Iterator and callback-based APIs that don’t allocate
- SIMD acceleration: Uses AVX2/AVX-512 on x86_64, NEON on ARM for fast scans
- Generic bounds: Works with any
Ordtype, with fast paths for primitives - Immutable after construction:
Send + Syncby default no_stdcompatible: Only requiresalloc
§Example
use simd_intervaltree::IntervalTree;
let tree = IntervalTree::builder()
.insert(0..10, "first")
.insert(5..15, "second")
.insert(20..30, "third")
.build();
// Zero-allocation iteration
for entry in tree.query(3..12) {
println!("{:?} => {}", entry.interval, entry.value);
}
// Early termination with callback
use std::ops::ControlFlow;
tree.query_with(3..12, |interval, value| {
println!("{interval:?} => {value}");
ControlFlow::<()>::Continue(())
});Structs§
- Interval
- A half-open interval
[start, end). - Interval
Id - A stable identifier for an interval in the collection.
- Interval
Set - A mutable interval collection with stable identifiers.
- Interval
Tree - An immutable interval tree optimized for overlap queries.
- Interval
Tree Builder - Builder for constructing an
IntervalTree. - Query
Entry - An entry returned by query iteration.
- Query
Iter - Iterator over intervals overlapping a query range.