Changes between Version 11 and Version 12 of DataParallel/Replicate


Ignore:
Timestamp:
Aug 7, 2011 8:30:08 AM (4 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/Replicate

    v11 v12  
    7676In the `smvm` example, a replicated array is consumed by lifted indexing to extract matching elements of the vector for all non-zero elements of the matrix.  Using just an length array as a segment descriptor without overlapping segments, lifted indexing might be implemented as follows: 
    7777{{{ 
    78 (as_len, as_data) !:^ is = bpermute ((prescan (+) 0 as_len) +^ is) as_data 
     78(as_len, as_data) !:^ is = bpermute as_data ((prescan (+) 0 as_len) +^ is) 
    7979}}} 
    8080 
    8181With overlapping segments, we have 
    8282{{{ 
    83 (as_start, as_len, as_data) !:^ is = bpermute (as_start +^ is) as_data 
     83(as_start, as_len, as_data) !:^ is = bpermute as_data (as_start +^ is) 
    8484}}} 
    8585In the case of `smvm`, where the first argument is produced by `replicateP (length row) v`, we have `as_start = replicate (length row) 0` and `as-data = v`.  In other words, lifted indexing draws from a single copy of `v`, which is what we wanted.