# NOT RUN {
# intersection of two sets
Set$new(-2:4) & Set$new(2:5)
setintersect(Set$new(1, 4, "a"), Set$new("a", 6))
Set$new(1:4) & Set$new(5:7)
# intersection of two intervals
Interval$new(1, 10) & Interval$new(5, 15)
Interval$new(1, 2) & Interval$new(2, 3)
Interval$new(1, 5, class = "integer") &
Interval$new(2, 7, class = "integer")
# intersection of mixed set types
Set$new(1:10) & Interval$new(5, 15)
Set$new(5, 7) & Tuple$new(6, 8, 7)
# Ignores membership of FuzzySet
FuzzySet$new(1, 0.1, 2, 0.5) & Set$new(2:5)
# intersection of conditional sets
ConditionalSet$new(function(x, y) x >= y) &
ConditionalSet$new(function(x, y) x == y)
ConditionalSet$new(function(x) x == 2) &
ConditionalSet$new(function(y) y == 3)
# But be careful not to make an empty set
ConditionalSet$new(function(x) x == 2) &
ConditionalSet$new(function(x) x == 3)
# }
Run the code above in your browser using DataLab