Learn R Programming

dti (version 1.2-0.1)

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 = setCores(,reprt=FALSE))
plmatrix(x, FUN, ..., mc.cores = setCores(,reprt=FALSE))

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
number of threads to use. Defaults to number of threads specified for openMP, see documentation of package awsMethods.

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.