pub fn intervals_intersect(
a: &[(f64, f64)],
b: &[(f64, f64)],
) -> Result<Vec<(f64, f64)>, IoError>Expand description
Intersect two interval lists — e.g. pause == 0 ∩ beam_power > 1.5 MW.
Inputs may be unsorted/overlapping (each side is normalised by
sort-and-merge first, the same policy as
crate::nexus::load_nexus_bank_spectrum’s keep_intervals); every
pair must be finite with t_end > t_start. Output is sorted,
non-overlapping, and drops empty intersections.
§Errors
IoError::InvalidParameter on a non-finite or empty/inverted pair.