1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
use ;
use crate::;
use Box;
/// Gives [`SortedDisjoint`] iterators a uniform type. Used by the [`union_dyn`], etc. macros to give all
/// their input iterators the same type.
///
/// [`SortedDisjoint`]: crate::SortedDisjoint.html#table-of-contents
/// [`union_dyn`]: crate::union_dyn
/// [`intersection_dyn`]: crate::intersection_dyn
///
/// # Example
/// ```
/// use range_set_blaze::prelude::*;
///
/// let a = RangeSetBlaze::from_iter([1..=6, 8..=9, 11..=15]);
/// let b = CheckSortedDisjoint::new([5..=13, 18..=29]);
/// let c = RangeSetBlaze::from_iter([38..=42]);
/// let union = [
/// DynSortedDisjoint::new(a.ranges()),
/// DynSortedDisjoint::new(b),
/// DynSortedDisjoint::new(c.ranges()),
/// ]
/// .union();
/// assert_eq!(union.into_string(), "1..=15, 18..=29, 38..=42");
/// ```
/// Intersects zero or more [`SortedDisjoint`] iterators, creating a new [`SortedDisjoint`] iterator.
/// The input iterators need not be of the same type.
///
/// For input iterators of the same type, [`intersection`] may be slightly faster.
///
/// # Performance
/// All work is done on demand, in one pass through the input iterators. Minimal memory is used.
///
/// [`SortedDisjoint`]: crate::SortedDisjoint.html#table-of-contents
/// [`intersection`]: crate::MultiwaySortedDisjoint::intersection
/// # Examples
/// ```
/// use range_set_blaze::prelude::*;
///
/// let a = RangeSetBlaze::from_iter([1u8..=6, 8..=9, 11..=15]);
/// let b = CheckSortedDisjoint::new([5..=13, 18..=29]);
/// let c = RangeSetBlaze::from_iter([38..=42]);
/// let not_c = !c.ranges();
///
/// let intersection = intersection_dyn!(a.ranges(), b, not_c);
/// assert_eq!(intersection.into_string(), "5..=6, 8..=9, 11..=13");
/// ```
/// Unions zero or more [`SortedDisjoint`] iterators, creating a new [`SortedDisjoint`] iterator.
/// The input iterators need not be of the same type.
///
/// For input iterators of the same type, [`union`] may be slightly faster.
///
/// # Performance
/// All work is done on demand, in one pass through the input iterators. Minimal memory is used.
///
/// [`SortedDisjoint`]: crate::SortedDisjoint.html#table-of-contents
/// [`union`]: crate::MultiwaySortedDisjoint::union
/// # Examples
/// ```
/// use range_set_blaze::prelude::*;
///
/// let a = RangeSetBlaze::from_iter([1..=6, 8..=9, 11..=15]);
/// let b = CheckSortedDisjoint::new([5..=13, 18..=29]);
/// let c = RangeSetBlaze::from_iter([38..=42]);
/// let union = union_dyn!(a.ranges(), b, c.ranges());
/// assert_eq!(union.into_string(), "1..=15, 18..=29, 38..=42");
/// ```
/// Computes the symmetric difference of zero or more [`SortedDisjoint`] iterators, creating a new [`SortedDisjoint`] iterator.
/// The input iterators need not be of the same type.
///
/// For input iterators of the same type, [`symmetric_difference`] may be slightly faster.
///
/// # Performance
/// All work is done on demand, in one pass through the input iterators. Minimal memory is used.
///
/// [`SortedDisjoint`]: crate::SortedDisjoint.html#table-of-contents
/// [`symmetric_difference`]: crate::MultiwaySortedDisjoint::symmetric_difference
/// # Examples
/// ```
/// use range_set_blaze::prelude::*;
///
/// let a = RangeSetBlaze::from_iter([1..=6, 8..=9, 11..=15]);
/// let b = CheckSortedDisjoint::new([5..=13, 18..=29]);
/// let c = RangeSetBlaze::from_iter([38..=42]);
/// let sym_diff = symmetric_difference_dyn!(a.ranges(), b, c.ranges());
/// assert_eq!(sym_diff.into_string(), "1..=4, 7..=7, 10..=10, 14..=15, 18..=29, 38..=42");
/// ```