class HelloWorld { public static void read_write_1d2d(double [1d][2d] z) { System.out.print("writing: "); foreach (j within z.domain()) { foreach (k within z[j].domain()) { Point<3> i = [k[1], j[1], j[2]]; System.out.print("["); System.out.print(i[1]); System.out.print(", "); System.out.print(i[2]); System.out.print(", "); System.out.print(i[3]); System.out.print("] "); z[j][k] = i[1] * 17 + i[2] * 533 - i[3] * 991.342; } } System.out.print("reading: "); foreach (j within z.domain()) { foreach (k within z[j].domain()) { Point<3> i = [k[1], j[1], j[2]]; System.out.print("["); System.out.print(i[1]); System.out.print(", "); System.out.print(i[2]); System.out.print(", "); System.out.print(i[3]); System.out.print("] "); if (z[j][k] != i[1] * 17 + i[2] * 533 - i[3] * 991.342) System.out.println("\n\nFailure!!\n"); } } System.out.println(""); } public static void main( String[] argv ) { int j; double [1d][2d] z; z = new double [[1 : 10 : 3, -8 : 11 : 2]][1d]; foreach (j within z.domain()) z[j] = new double[[1 : 5]]; read_write_1d2d(z); } }