Changes between Version 31 and Version 32 of DataParallel/Regular
 Timestamp:
 Jan 20, 2010 4:14:55 AM (7 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

DataParallel/Regular
v31 v32 312 312 map f = f 313 313 }}} 314 The function `fold`, which we introduced earlier, is an example of a mappable library function. Applied to a matrix, `fold (+) 0` will calculate the sum of all rows. If run in parallel, `fold` itself is run in parallel, and all the rows are processed in parallel. 315 {{{ 316 fold :: (U.Elt e, A.Shape dim) => 317 (e > e> e) > e > DArray (dim :*: Int) e > DArray dim e 318 }}} 319 314 320 So, for example, we can write a mappable function which takes an array and selects every data element with 315 321 an even index: