sarat poluri wrote:
> Hi,
>
> How to declare a generic Array? Im using x10 2.0.
>
Does this (2.0) code segment help ...?
// the region with points (x,y), where x ranges from 1 to 100, and y
from 1 to 10
val R = [1..100, 1..10] as Region(2);
// the distribution which block distributes these points across the
given places in the 0'th dimension
val D = Dist.makeBlock(R, 0);
// An array of Int distributed according to D, with A(x,y)
initialized to x+y
val A = Array.make[Int](D, ((x,y):Point)=> x+y);
If you really meant to ask how to declare a generic array, perhaps this
is what you had in mind...
class Matrix[T] {
val A:Array[T]; // field of type Array of T, where T is a type
parameter of the class
...
}
Best,
Vijay
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users