Hi Kshitij,
the "Array.apply(int, int, ....)" methods are essentially a convenient
shorthand for "Array.apply(Point(rank))" - and they're only defined up
to four dimensions.
You can access a 5D array using e.g.
val zeroPoint = Point.make([0, 0, 0, 0, 0]);
Console.OUT.println( t(zeroPoint) );
Cheers
Josh
Kshitij Mehta wrote:
> Hello
> I am trying to create a 5D array. Creating a 4D array works just fine,
> but creating a 5D array gives a compilation error.
> This works (creating 4D array):
>
> -------------------------------------------------------------
> public class Array5D {
> public static def main(args:Rail[String]): Void {
> val M = 5; val N = 5;
> val t = Array.make[Double]([0..4, 0..4, 0..4, 0..4]);
> Console.OUT.println( t(0,0,0,0,) );
> }
> }
> -----------------------------------------------------------------------------------------------------------
>
> But this doesnt work (creating 5D array):
>
> -------------------------------------------------------------------------------------------------------------------
> public class Array5D {
> public static def main(args:Rail[String]): Void {
> val M = 5; val N = 5;
> val t = Array.make[Double]([0..4, 0..4, 0..4, 0..4, 0..4]);
> Console.OUT.println( t(0,0,0,0,0) );
> }
> }
> -------------------------------------------------------------------
>
>
> It gives the following compilation error:
> Method t(x10.lang.Int{self==0}, x10.lang.Int{self==0}, x10.lang.Int
> {self==0}, x10.lang.Int{self==0}, x10.lang.Int{self==0}) not found.
>
> Is there another way to create a 5D array?
>
> Thanks,
> Kshitij Mehta
> Graduate Student
> Parallel Software Technologies Lab
> Dept. of Computer Science
> University of Houston
> USA
> www.cs.uh.edu/~kmehta
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> X10-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/x10-users
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users