Skip to content

Releases: queelius/disjoint_interval_set

v2.0.0: Elegant API with Compile-Time and Multi-Dimensional Support

23 Sep 01:37

Choose a tag to compare

🎉 Disjoint Interval Set v2.0.0

Major release introducing an elegant new API, compile-time interval arithmetic, and multi-dimensional support.

✨ New Features

Elegant Fluent API

  • Chainable operations for intuitive set manipulation
  • Mathematical operators (| for union, & for intersection, ~ for complement)
  • Named factory methods (closed(), open(), singleton())

String DSL with Mathematical Notation

auto set = dis::parse("[0,10) U [20,30] U {15}");

Compile-Time Interval Arithmetic

  • Zero-overhead static intervals
  • Compile-time range validation
  • Template metaprogramming support

Multi-Dimensional Interval Sets

  • 2D rectangles, 3D boxes, N-dimensional hyperrectangles
  • Spatial indexing and collision detection
  • Time-space scheduling applications

Advanced Queries

  • gaps() - Find gaps between intervals
  • span() - Get convex hull
  • measure() - Calculate total length/area/volume
  • density() - Measure how "full" the span is

📊 Quality Metrics

  • 90.32% overall test coverage
  • 97.46% core implementation coverage
  • 94 comprehensive unit tests
  • Production-ready code

🛠️ Technical Improvements

  • Fixed all compilation errors in base library
  • Added move semantics for efficiency
  • Implemented efficient O(n log n) algorithms
  • Clean separation between core and extensions
  • C++20 support with backwards compatibility

📚 Documentation

  • Comprehensive README with mathematical foundations
  • API documentation with examples
  • Real-world usage demonstrations
  • Comparison with alternatives (Boost.ICL)

🚀 Getting Started

#include <dis/dis.hpp>

// Create intervals with elegant API
auto work_hours = dis::interval<double>::closed(9, 17);
auto lunch = dis::interval<double>::closed(12, 13);

// Build sets with fluent interface
auto available = dis::set<double>()
    .insert(work_hours)
    .subtract(lunch)
    .subtract(meetings);

// Or parse from mathematical notation
auto schedule = dis::parse("[9,12) U [13,17]");

📦 Installation

Header-only library - just include and use:

git clone https://github.com/queelius/disjoint_interval_set.git
g++ -std=c++20 -I disjoint_interval_set/include your_code.cpp

🙏 Acknowledgments

This release represents a complete redesign of the library with a focus on elegance, mathematical rigor, and practical utility. The API is now intuitive enough for beginners while providing the power needed for advanced applications.

📖 Full Changelog

See commit ba5d458 for detailed changes.