--- jsr166/src/test/loops/ThreadPhaserJacobi.java 2009/10/30 14:15:04 1.3 +++ jsr166/src/test/loops/ThreadPhaserJacobi.java 2011/03/15 19:47:06 1.8 @@ -1,7 +1,7 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ */ // Barrier version of Jacobi iteration @@ -17,8 +17,7 @@ public class ThreadPhaserJacobi { /** * The maximum submatrix length (both row-wise and column-wise) * for any Segment - **/ - + */ static final double EPSILON = 0.0001; // convergence criterion static int dimGran; @@ -39,7 +38,7 @@ public class ThreadPhaserJacobi { } int granularity = n * n / nprocs; - dimGran = (int)(Math.sqrt(granularity)); + dimGran = (int) Math.sqrt(granularity); // allocate enough space for edges int dim = n+2; @@ -67,7 +66,7 @@ public class ThreadPhaserJacobi { driver.compute(); long time = System.currentTimeMillis() - startTime; - double secs = ((double)time) / 1000.0; + double secs = (double) time / 1000.0; System.out.println("Compute Time: " + secs); } @@ -113,7 +112,7 @@ public class ThreadPhaserJacobi { double[][] tmp = a; a = b; b = tmp; } } - catch(Exception ex) { + catch (Exception ex) { ex.printStackTrace(); return; } @@ -163,8 +162,8 @@ public class ThreadPhaserJacobi { int rows = hiRow - loRow + 1; int cols = hiCol - loCol + 1; - int rblocks = (int)(Math.round((float)rows / dimGran)); - int cblocks = (int)(Math.round((float)cols / dimGran)); + int rblocks = Math.round((float) rows / dimGran); + int cblocks = Math.round((float) cols / dimGran); int n = rblocks * cblocks;