logical3s {hutilscpp}R Documentation

Complex logical expressions

Description

Performant implementations of & et or. Performance is high when the expressions are long (i.e. over 10M elements) and in particular when they are of the form lhs <op> rhs for binary <op>.

Usage

and3s(
  exprA,
  exprB = NULL,
  exprC = NULL,
  ...,
  nThread = getOption("hutilscpp.nThread", 1L),
  .parent_nframes = 1L,
  type = c("logical", "raw", "which")
)

or3s(
  exprA,
  exprB = NULL,
  exprC = NULL,
  ...,
  nThread = getOption("hutilscpp.nThread", 1L),
  .parent_nframes = 1L,
  type = c("logical", "raw", "which")
)

Arguments

exprA, exprB, exprC, ...

Expressions of the form x <op> y. with <op> one of the standard binary operators.

Only exprA is required, all following expressions are optional.

nThread
integer(1)

Number of threads to use.

.parent_nframes
integer(1)

For internal use. Passed to eval.parent.

type

The type of the result. which corresponds to the indices of TRUE in the result. Type raw is available for a memory-constrained result, though the result will not be interpreted as logical.

Value

and3s and or3s return exprA & exprB & exprC and exprA | exprB | exprC respectively. If any expression is missing it is considered TRUE for and3s and FALSE for or3s; in other words only the results of the other expressions count towards the result.


[Package hutilscpp version 0.10.4 Index]