π 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 intervalsspan()- Get convex hullmeasure()- Calculate total length/area/volumedensity()- 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.