bpvectorize | R Documentation |
This transforms a vectorized function into a parallel, vectorized
function. Any function FUN
can be used, provided its
parallelized argument (by default, the first argument) has a
length
and [
method defined, and the return value of
FUN
can be concatenated with c
.
bpvectorize(FUN, ..., BPREDO=list(), BPPARAM=bpparam(), BPOPTIONS = bpoptions())
## S4 method for signature 'ANY,ANY'
bpvectorize(FUN, ..., BPREDO=list(), BPPARAM=bpparam(), BPOPTIONS = bpoptions())
## S4 method for signature 'ANY,missing'
bpvectorize(FUN, ..., BPREDO=list(),
BPPARAM=bpparam(), BPOPTIONS = bpoptions())
FUN |
A function whose first argument has a |
... |
Additional arguments to parallization, unused. |
BPPARAM |
An optional |
BPREDO |
A |
BPOPTIONS |
Additional options to control the behavior of the parallel evaluation, see |
The result of bpvectorize
is a function with signature
...
; arguments to the returned function are the original
arguments FUN
. BPPARAM
is used for parallel evaluation.
When BPPARAM
is a class for which no method is defined (e.g.,
SerialParam
), FUN(X)
is used.
See methods{bpvectorize}
for additional methods, if any.
A function taking the same arguments as FUN
, but evaluated
using bpvec
for parallel evaluation across available
cores.
Ryan Thompson mailto:rct@thompsonclan.org
bpvec
psqrt <- bpvectorize(sqrt) ## default parallelization
psqrt(1:10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.