bit_setops: bit set operations

Description Usage Arguments Details Value Functions See Also Examples

Description

Fast versions of union, intersect, setdiff, symmetric difference and setequal for integers.

Usage

1
2
3
4
5
6
7
8
9

Arguments

x

an integer vector

y

an integer vector

Details

determines the range of the integers and checks if the density justifies use of a bit vector; if yes, uses a bit vector for finding duplicates; if no, falls back to union, intersect, setdiff, union(setdiff(x,y),setdiff(y,x)) and setequal

Value

an integer vector

Functions

See Also

bit_in, bit_rangediff

Examples

1
2
3
4
5
6
bit_union(1:2, 2:3)
bit_intersect(1:2, 2:3)
bit_setdiff(1:2, 2:3)
bit_symdiff(1:2, 2:3)
bit_setequal(1:2, 2:3)
bit_setequal(1:2, 2:1)

bit documentation built on Aug. 4, 2020, 9:06 a.m.