File: bit_setops.Rd

package info (click to toggle)
r-cran-bit 4.0.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 996 kB
  • sloc: ansic: 5,083; makefile: 6
file content (64 lines) | stat: -rw-r--r-- 1,388 bytes parent folder | download | duplicates (2)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bitsort.R
\name{bit_setops}
\alias{bit_setops}
\alias{bit_union}
\alias{bit_intersect}
\alias{bit_setdiff}
\alias{bit_symdiff}
\alias{bit_setequal}
\title{bit set operations}
\usage{
bit_union(x, y)

bit_intersect(x, y)

bit_setdiff(x, y)

bit_symdiff(x, y)

bit_setequal(x, y)
}
\arguments{
\item{x}{an integer vector}

\item{y}{an integer vector}
}
\value{
an integer vector
}
\description{
Fast versions of \code{\link{union}}, \code{\link{intersect}}, 
\code{\link{setdiff}}, symmetric difference and \code{\link{setequal}}
for integers.
}
\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 \code{\link{union}}, \code{\link{intersect}},
\code{\link{setdiff}}, \code{union(setdiff(x,y),setdiff(y,x))} and \code{\link{setequal}}
}
\section{Functions}{
\itemize{
\item \code{bit_union}: union

\item \code{bit_intersect}: intersection

\item \code{bit_setdiff}: asymmetric difference

\item \code{bit_symdiff}: symmetricx difference

\item \code{bit_setequal}: equality
}}

\examples{
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)
}
\seealso{
\code{\link{bit_in}}, \code{\link{bit_rangediff}}
}