Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
sherhut 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

this An element from the ParallelArray

Optional arguments Same as the optional arguments passed to map

Result An element to be placed in the result at the same offset we found “this”

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