Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Stephan Herhut edited this page Sep 14, 2011 · 13 revisions

Synopsis

myArray.map(depth, elementalFunction, arg1, arg2, ...)

Current Status

Currently this API is invoked using map to get the JavaScript library version and mapOCL to get the optimized version. This is a temporary situation as we undergo some reworking of the API.

Arguments

depth the number of dimensions used to implicitly access this.

elementalFunction described below

arg1, arg2, ... passed unchanged to elemental function

Elemental Function

function (arg1, arg2, ...)

this An element from the ParallelArray

arg1, arg2, ... Same as the optional arguments passed to map

The result of the function will be used as an element to be placed in the result at the same offset we found this in the source array.

Returns

A freshly minted ParallelArray

Elements are the results of applying the elemental function to the elements in the original ParallelArray plus any optional arguments.

Example: an identity function

pa.map(function(){return this;})

Clone this wiki locally