Handbook
Glossary
<interval-and> ( set1 set2 -- set )
Interval sets
Prev:
<interval-not> ( set maximum -- set' )
Next:
<interval-or> ( set1 set2 -- set )
Vocabulary
interval-sets
Inputs
set1
an
interval-set
set2
an
interval-set
Outputs
set
an
interval-set
Word description
Calculates the intersection of two interval sets. This takes O(n+m) time, where the input interval maps have n and m intervals in them.
Definition
USING:
interval-sets.private
kernel
;
IN:
interval-sets
:
<interval-and>
( set1 set2 -- set )
2dup
interval-max
[
[
<interval-not>
]
curry
bi@
<interval-or>
]
keep
<interval-not>
;