Russel Winder wrote:
> "Pi by Quadrature" again (sorry), but this time trying to use
> parallelism via partitioning the problem using an parallel array.  As a
> first step I thought of using the Array[T] class -- or should that be
> Array<T> the API page uses both notations, cf.
> http://dist.codehaus.org/x10/xdoc/2.0.3/
>
> I had thought that something along the lines of:
>
>     val computeSlice = ( p : Point ) => {
>       val id : int = p(0) ;
>       val start : long = 1 + id * sliceSize ;
>       val end : long = ( id + 1 ) * sliceSize ;
>       var sum : double = 0.0 ;
>       for ( var i : long = start ; i < end ; ++i ) {
>         val x : double = ( i - 0.5 ) * delta ;
>         sum += 1.0 / ( 1.0 + x * x ) ;
>       }
>       sum
>     } ;
>     val sums = ( new Array[Double] ( numberOfTasks) ).lift
> ( computeSlice ) ;
>
>
> <<<< I am not convinced this operation labelled "lift" is actually a
> "lift" operation, it is actually "map" isn't it? >>>>
>   
Yes,  this method should be called map.



------------------------------------------------------------------------------

_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to