Changes between Version 31 and Version 32 of DataParallel/Regular


Ignore:
Timestamp:
Jan 20, 2010 4:14:55 AM (4 years ago)
Author:
gckeller
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/Regular

    v31 v32  
    312312 map f = f 
    313313}}} 
     314The 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{{{ 
     316fold :: (U.Elt e, A.Shape dim) =>  
     317 (e -> e-> e) -> e -> DArray (dim :*: Int)  e  -> DArray dim e 
     318}}} 
     319 
    314320So, for example, we can write a mappable function which takes an array and selects every data element with  
    315321an even index: