Crate simd_intervaltree

Crate simd_intervaltree 

Source
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 Ord type, with fast paths for primitives
  • Immutable after construction: Send + Sync by default
  • no_std compatible: Only requires alloc

§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).
IntervalId
A stable identifier for an interval in the collection.
IntervalSet
A mutable interval collection with stable identifiers.
IntervalTree
An immutable interval tree optimized for overlap queries.
IntervalTreeBuilder
Builder for constructing an IntervalTree.
QueryEntry
An entry returned by query iteration.
QueryIter
Iterator over intervals overlapping a query range.