Changes between Version 5 and Version 6 of DataParallel/Regular
 Timestamp:
 May 13, 2009 8:20:31 AM (8 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

DataParallel/Regular
v5 v6 63 63 fromScalar:: U.Elt r => r > Array DIM0 r 64 64 }}} 65 '''SLPJ: whoa! What are `DIM1`, `DIM0`? '''65 '''SLPJ: whoa! What are `DIM1`, `DIM0`? Presumably you mean 1dimensional etc. But indexed by what? Always `Int`? Maybe that's ok; but say so.''' 66 66 and bpermuteR, which creates a new array of new shape, using values of the argument array. 67 67 {{{ 68 68 bpermuteR:: Array dim e > Shape dim' > (Shape dim' > Shape dim) > Array dim' 69 69 }}} 70 '''SLPJ: I'd call it `reshape` like APL.'''71 70 For example, transposition of a two dimensional array can be defined in terms of mkArray as follows '''SLPJ: in terms of `bpermuteR` perhaps?''': 72 71 {{{ … … 75 74 where (n,m) = shape arr 76 75 }}} 77 '''SLPJ: presumably `shape :: Array dim a > Shape dim`? '''.76 '''SLPJ: presumably `shape :: Array dim a > Shape dim`? Or perhaps rather `shape :: Array dim a > dim`?'''. '''SLPJ: did you mean `bpermuteR arr (m,n)`?''' 78 77 Or cutting a 3 x 3 tile starting at indices (0,0) out of a two dimensional matrix: 79 78 {{{ … … 81 80 tile arr = bpermuteR arr (3,3) id 82 81 }}} 82 83 '''SLPJ: Does the `Shape` stuff need to be exposed at this level. Could we not work just in terms of the `(Int,Int)` indices the programmer expects, and hide the shapery?''' 83 84 84 85 === Manipulating array values === … … 98 99 > (Array dim a, Array (dim, Int) a) 99 100 }}} 100 Manipulating the shape of arrays:101 '''SLPJ: didn't understand scan'''. Manipulating the shape of arrays: 101 102 {{{ 102 103  size of both shapes have to be the same, otherwise runtime error … … 106 107 > Array dim a 107 108 }}} 109 '''SLPJ: why doesn't `reshape` need the size of the result array, as `bpermuteR` did.''' 108 110 109 111 === Changing the dimensionality of an array ===