Learn R Programming

dti (version 1.1-0)

pmatrix: Parallelize columnwise computations on a matrix using forking (generalizes function 'pvec' from package 'parallel')

Description

parellelizes the execution of a function on matrix elements by splitting the matrix by columns and submitting each part to one core. The function must take a matrix argument, with computations depending on row entries. It creates a matrix with same number of columns as on input, but possibly different number of rows.

Usage

pmatrix(x, FUN, ..., mc.cores = getOption("mc.cores", 2L))
plmatrix(x, FUN, ..., mc.cores = getOption("mc.cores", 2L))

Arguments

x
matrix to operate on.
FUN
function depending on a matrix argument, and providing a matrix valued result.
...
see documentation for function pvec
mc.cores
see documentation for function pvec

Value

  • Returns a matrix containing the results for the individual colums of x as columns.

Details

this functions are wrappers to functions parCapply and parLapply from parallel.