File: bit_rangediff.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 (37 lines) | stat: -rw-r--r-- 1,143 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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bitsort.R
\name{bit_rangediff}
\alias{bit_rangediff}
\title{bit range difference}
\usage{
bit_rangediff(rx, y, revx = FALSE, revy = FALSE)
}
\arguments{
\item{rx}{range of integers given as \code{\link{ri}} or as a two-element \code{\link{integer}}}

\item{y}{an integer vector of elements to exclude}

\item{revx}{\code{FALSE} as is, \code{TRUE} to reverse the direction and sign of \code{rx}}

\item{revy}{\code{FALSE} as is, \code{TRUE} to reverse the direction and sign of \code{y}}
}
\value{
an integer vector
}
\description{
Fast version of \code{setdiff(rx[1]:rx[2], y)}.
}
\details{
determines the range of the integers \code{y} and checks if the density justifies use 
of a bit vector; if yes, uses a bit vector for the set operation; if no, 
falls back to a quicksort and \code{\link{merge_rangediff}}
}
\examples{
bit_rangediff(c(1L,6L), c(3L,4L))
bit_rangediff(c(6L,1L), c(3L,4L))
bit_rangediff(c(6L,1L), c(3L,4L), revx=TRUE)
bit_rangediff(c(6L,1L), c(3L,4L), revx=TRUE, revy=TRUE)
}
\seealso{
\code{\link{bit_setdiff}}, \code{\link{merge_rangediff}}
}