Changes between Version 5 and Version 6 of DataParallel/Regular


Ignore:
Timestamp:
May 13, 2009 8:20:31 AM (5 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/Regular

    v5 v6  
    6363fromScalar::  U.Elt r => r -> Array DIM0 r 
    6464}}} 
    65 '''SLPJ: whoa!  What are `DIM1`, `DIM0`?''' 
     65'''SLPJ: whoa!  What are `DIM1`, `DIM0`?  Presumably you mean 1-dimensional etc.  But indexed by what?  Always `Int`?  Maybe that's ok; but say so.''' 
    6666and  bpermuteR, which creates a new array of new shape, using values of the argument array. 
    6767{{{ 
    6868bpermuteR:: Array dim e -> Shape dim' -> (Shape dim' -> Shape dim) -> Array dim' 
    6969}}} 
    70 '''SLPJ: I'd call it `reshape` like APL.''' 
    7170For example, transposition of a two dimensional array can be defined in terms of mkArray as follows '''SLPJ: in terms of `bpermuteR` perhaps?''': 
    7271{{{ 
     
    7574  where (n,m) = shape arr 
    7675}}} 
    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)`?''' 
    7877Or cutting a 3 x 3 tile starting at indices (0,0) out of a two dimensional matrix: 
    7978{{{ 
     
    8180tile arr = bpermuteR arr (3,3) id 
    8281}}} 
     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?''' 
    8384 
    8485=== Manipulating array values === 
     
    9899              -> (Array dim a, Array (dim, Int) a) 
    99100}}} 
    100 Manipulating the shape of arrays: 
     101'''SLPJ: didn't understand scan'''.  Manipulating the shape of arrays: 
    101102{{{ 
    102103-- size of both shapes have to be the same, otherwise runtime error 
     
    106107              -> Array dim a 
    107108}}} 
     109'''SLPJ: why doesn't `reshape` need the size of the result array, as `bpermuteR` did.''' 
    108110 
    109111=== Changing the dimensionality of an array ===