Changes between Version 40 and Version 41 of DataParallel/Regular


Ignore:
Timestamp:
Jan 20, 2010 1:11:31 PM (6 years ago)
Author:
gckeller
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/Regular

    v40 v41  
    9494{{{
    9595range (() :*: 2 :*: 3) =
    96    [() :*: 0 :*: 0, () :*: 0 :*: 1,  .....
    97 }}}
    98 
    99 A scalar value `c`is isomorphic to a zero-dimensional array
    100 {{{
    101   DArray () (\_ -> c)
    102 }}}
    103 Lifting a scalar value over a shape `dim':
    104 {{{
    105 Shape dim => DArray dim (\_ -> c)
    106 }}}
     96   [() :*: 0 :*: 0, () :*: 0 :*: 1,  ....., () :*: 0 :*: 2, () :*: 1 :*: 0,....
     97}}}
     98
    10799
    108100
     
    146138one using the following function:
    147139{{{
    148 toScalar:: U.Elt e  => DArray () e -> DArray () e
     140toScalar:: U.Elt e  => DArray () e -> e
    149141}}}
    150142Note that in contrast to all the previous operations, `toScalar` requires the array to be of a particular
     
    245237between the selector/multiplicator and the dimensionality of the
    246238argument and the result array, it is inconvenient to use, as the
    247 examples demonstrate. We therefore do need to add another layer to
    248 improve the usability of the library.
     239examples demonstrate. We therefore need some syntactic sugar to improve
     240the usability of the library.  In the following, the use a SAC-like notation for
     241values of Index-type in comments to improve the readability of the examples.
    249242
    250243
     
    255248
    256249arr' :: () :*: Int :*: Int
    257 arr' = select arr (IndexFixed 3 (IndexAll (IndexAll IndexNil)))
     250arr' = select arr (IndexFixed 3 (IndexAll (IndexAll IndexNil))) -- (3,.,.)
    258251}}}
    259252We could generalise this further, to extract from any array `arr` which is at least one dimensional
     
    263256
    264257arr' :: Array dim Double
    265 arr' = select arr (IndexFixed 3 IndexNil)
     258arr' = select arr (IndexFixed 3 IndexNil)   -- (3,*)
    266259}}}
    267260
     
    289282
    290283Note that the library provides no way to statically check the pre- and
    291 postconditions on the actual size of arguments and results. This has
    292 to be done at run time using assertions.
     284postconditions on the actual size of arguments. This has
     285to be done during run time using assertions.
    293286
    294287== `Nesting' Array Functions ==
     
    451444}}}
    452445
     446== Example 2: Red-Black Relaxation ==
     447== Example 3: 3D Fast Fourier Transformation ==
    453448== Open Questions ==
    454449