I have the following:
var reg: Region{rank==2};
var dist: Dist{rank==2};
var array: Array[Double](dist);
reg = [0..4, 0..6];
dist = Dist.makeBlock(reg, 0);
array = Array.makeVar[Double] (dist,
((p):Point) => 0.0);
Console.OUT.println("printing the i,j loop");
for (i = 0; i < 5; i++)
for (j = 0; j < 7; j++)
Console.OUT.println( array(i,j) );
which produces:
x10.lang.BadPlaceException: point (2,0) not defined at (Place 0)
at x10.array.BaseArray$23.apply(BaseArray.java:1330)
at x10.array.BaseArray$23.apply(BaseArray.java:1)
at x10.array.RectRegion.check(RectRegion.java:709)
at x10.array.BaseArray.checkPlace(BaseArray.java:715)
at x10.array.DistArray.apply(DistArray.java:126)
at ArrayReader.main(ArrayReader.java:195)
at ArrayReader$Main$1.apply(ArrayReader.java:48)
at x10.runtime.Activity.now(Activity.java:222)
at x10.runtime.Activity.run(Activity.java:127)
at x10.runtime.Worker$3.apply(Worker.java:330)
at x10.runtime.impl.java.Runtime.runAt(Runtime.java:96)
at x10.runtime.Worker.loop(Worker.java:317)
at x10.runtime.Runtime.start(Runtime.java:143)
at ArrayReader$Main.main(ArrayReader.java:35)
at x10.runtime.impl.java.Runtime.run(Runtime.java:46)
at java.lang.Thread.run(Thread.java:613)
Can someone explain this?
Also, if the nested loop is replaced with
Console.OUT.println("printing the p loop");
for (p:Point in dist)
Console.OUT.println( array(p) );
I get this:
/Users/jlagrone/GradSchool/Research/workspace/X10-code/tests/
ArrayReader.x10:28: Method array(x10.lang.Point{self==p}) not found.
I thought I could iterate through the array with points. I thought
this had to do with a method guard, but this is a concept I still
don't understand but thought I had employed.
Thanks.
Jim
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users