Changes between Version 40 and Version 41 of DataParallel/Regular
 Timestamp:
 Jan 20, 2010 1:11:31 PM (5 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

DataParallel/Regular
v40 v41 94 94 {{{ 95 95 range (() :*: 2 :*: 3) = 96 [() :*: 0 :*: 0, () :*: 0 :*: 1, ..... 97 }}} 98 99 A scalar value `c`is isomorphic to a zerodimensional 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 107 99 108 100 … … 146 138 one using the following function: 147 139 {{{ 148 toScalar:: U.Elt e => DArray () e > DArray ()e140 toScalar:: U.Elt e => DArray () e > e 149 141 }}} 150 142 Note that in contrast to all the previous operations, `toScalar` requires the array to be of a particular … … 245 237 between the selector/multiplicator and the dimensionality of the 246 238 argument 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. 239 examples demonstrate. We therefore need some syntactic sugar to improve 240 the usability of the library. In the following, the use a SAClike notation for 241 values of Indextype in comments to improve the readability of the examples. 249 242 250 243 … … 255 248 256 249 arr' :: () :*: Int :*: Int 257 arr' = select arr (IndexFixed 3 (IndexAll (IndexAll IndexNil))) 250 arr' = select arr (IndexFixed 3 (IndexAll (IndexAll IndexNil)))  (3,.,.) 258 251 }}} 259 252 We could generalise this further, to extract from any array `arr` which is at least one dimensional … … 263 256 264 257 arr' :: Array dim Double 265 arr' = select arr (IndexFixed 3 IndexNil) 258 arr' = select arr (IndexFixed 3 IndexNil)  (3,*) 266 259 }}} 267 260 … … 289 282 290 283 Note that the library provides no way to statically check the pre and 291 postconditions on the actual size of arguments and results. This has292 to be done atrun time using assertions.284 postconditions on the actual size of arguments. This has 285 to be done during run time using assertions. 293 286 294 287 == `Nesting' Array Functions == … … 451 444 }}} 452 445 446 == Example 2: RedBlack Relaxation == 447 == Example 3: 3D Fast Fourier Transformation == 453 448 == Open Questions == 454 449