On Monday 31 May 2010 07:52:20 pm Yoav Zibin wrote:
> The old Array was split into:
> DistArray - for distributed computation
> Array - for local usage (within the same place).
>
> The manual was not yet updated.
> You create the two differently:
> DistArray.make(...)
> vs.
> new Array[double](region, (p:Point)=>...)
>
> e.g.,
> new Array[int]([1..10, 1..10], (Point)=>0))
>
>
> On Mon, May 31, 2010 at 1:36 PM, Christoph Pospiech <
>
> [email protected]> wrote:
> > On Monday 31 May 2010, Christoph Pospiech wrote:
> > > Hi,
> > >
> > > I am using X10 v2.0.3 .
> > >
> > > What is wrong with the following code snippet ?
> >
> > I also tried a variant of the above code snippet.
> >
> > static type ArrayD = Array[double]{rank==1};
> >
> > global val v: ArrayD;
> >
> > val v_rail:Rail[double] =
> > Rail.make[double](n, (i:Int) => {(i*1.0) as double});
> >
> > v = Array.make[double](v_rail);
> >
> > The last line throws the following error messages.
> >
> > No valid method call found for make[x10.lang.Double]
> > (x10.lang.Rail[x10.lang.Double]{self==v_rail})
> > in x10.array.Array.
>
This brings me to a question of more philosophical or aesthetic nature.
Why is it
val v_rail:Rail[double] =
Rail.make[double](n, (i:Int) => {(i*1.0) as double});
but
val v:Array[double] =
new Array[double](n, (i:Int) => {(i*1.0) as double});
?
I would have expected that for every X10 class I could use "new <class_name>"
which internally may call "make.<classname>".
Anyone any explanation ?
--
Mit freundlichen Grüßen / Kind regards
Dr. Christoph Pospiech
High Performance & Parallel Computing
Phone: +49-351 86269826
Mobile: +49-171-765 5871
E-Mail: [email protected]
-------------------------------------
IBM Deutschland GmbH
Vorsitzender des Aufsichtsrats: Erich Clementi
Geschäftsführung: Martin Jetter (Vorsitzender),
Reinhard Reschke, Christoph Grandpierre,
Klaus Lintelmann, Michael Diemer, Martina Koederitz
Sitz der Gesellschaft: Ehningen / Registergericht: Amtsgericht Stuttgart, HRB
14562 WEEE-Reg.-Nr. DE 99369940
------------------------------------------------------------------------------
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users