Changes between Version 16 and Version 17 of DataParallel/Regular


Ignore:
Timestamp:
Jan 13, 2010 5:01:23 AM (5 years ago)
Author:
gckeller
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/Regular

    v16 v17  
    8383The method `addDim` adds the sizes of two shapes (or positions of two indices). If `sh'` is a strict subshape of 
    8484`sh`, the fields of `sh` are copied when no corresponding fields of `sh'` exist, accordingly for `modDim` 
     85 
     86 
     87=== Representation, Order of Elements, and Lifted Values ===  
     88 
     89As mentioned when introducing the functions `toIndex` and `range`, the following relationship should hold: 
     90{{{ 
     91map (toIndex sh) (range sh) = [:0..(size sh)-1:] 
     92}}} 
     93this means that, for example 
     94{{{ 
     95range (() :*: 2 :*: 3) = 
     96   [() :*: 0 :*: 0, () :*: 0 :*: 1,  ..... 
     97}}} 
     98 
     99A scalar value `c`is isomorphic to a zero-dimensional array 
     100{{{ 
     101  DArray () (\_ -> c) 
     102}}} 
     103Lifting a scalar value over a shape `dim': 
     104{{{ 
     105Shape dim => DArray dim (\_ -> c) 
     106}}} 
    85107 
    86108 
     
    248270 
    249271 
    250 Even though the index type serves well to express the relationship 
     272Even though the index type is well suited to express the relationship 
    251273between the selector/multiplicator and the dimensionality of the 
    252274argument and the result array, it is inconvenient to use, as the 
     
    258280to be done at run time using assertions. 
    259281 
    260  
    261 === Reordering, Shifting, Tiling === 
    262  
    263 Backpermute and default backpermute are two very versatile operations which allow  
    264 the programmer to express all structural operations which reorder or extract 
    265 elements based on their position in the argument array: 
    266 {{{ 
    267 backpermute:: (U.Elt e, A.Shape dim, A.Shape dim') =>    
    268   DArray dim e -> dim' -> (dim' -> dim) -> DArray dim' e 
    269 backpermuteDft::(U.Elt e, A.Shape dim, A.Shape dim') =>  
    270   DArray dim e -> e -> dim' -> (dim' -> Maybe dim) -> DArray dim' e 
    271 }}} 
    272 The function `backpermute` gets a source array, the shape of the new array, and 
    273 a function which maps each index of the new array to an index of the source array (and  
    274 thus indirectly provides a value for each index in the new array). Default backpermute  is 
    275 additionally provided with a default value which is inserted in the array in cases where the 
    276 index function returns `Nothing`. (Remark: should probably be replaced by a default array instead of 
    277 default value for more generality) 
    278  
    279 `reshape arr newShape` returns a new array with the same value as the argument array, but a new shape. The 
    280 new shape has to have the same size as the original shape. 
    281 {{{ 
    282 reshape:: (Shape dim', Shape dim, U.Elt e) => DArray dim e -> dim' -> DArray dim' e 
    283 }}} 
    284  
     282== Open Questions == 
     283 
     284=== Do we need array comprehension on DArrays? === 
     285 
     286=== Wave computations === 
     287 
     288==== Generalised Stencil Operation === 
     289 
     290MapStencil is currently not lifted, and doesn't run in parallel. Need to come up with a generalised version.