--- jsr166/src/test/loops/CCJacobi.java 2012/05/05 17:09:23 1.2 +++ jsr166/src/test/loops/CCJacobi.java 2015/01/15 18:34:18 1.4 @@ -77,14 +77,12 @@ public class CCJacobi { } } - - abstract static class MatrixTree extends CountedCompleter { + abstract static class MatrixTree extends CountedCompleter { // maximum difference between old and new values double maxDiff; - MatrixTree(CountedCompleter p, int c) { super(p, c); } + MatrixTree(CountedCompleter p, int c) { super(p, c); } } - static final class LeafNode extends MatrixTree { final double[][] A; // matrix to get old values from final double[][] B; // matrix to put new values into @@ -95,7 +93,7 @@ public class CCJacobi { int steps = 0; // track even/odd steps - LeafNode(CountedCompleter p, + LeafNode(CountedCompleter p, double[][] A, double[][] B, int loRow, int hiRow, int loCol, int hiCol) { @@ -134,11 +132,11 @@ public class CCJacobi { MatrixTree q2; MatrixTree q3; MatrixTree q4; - FourNode(CountedCompleter p) { + FourNode(CountedCompleter p) { super(p, 3); } - public void onCompletion(CountedCompleter caller) { + public void onCompletion(CountedCompleter caller) { double md = q1.maxDiff, m; if ((m = q2.maxDiff) > md) md = m; @@ -158,16 +156,15 @@ public class CCJacobi { } } - static final class TwoNode extends MatrixTree { MatrixTree q1; MatrixTree q2; - TwoNode(CountedCompleter p) { + TwoNode(CountedCompleter p) { super(p, 1); } - public void onCompletion(CountedCompleter caller) { + public void onCompletion(CountedCompleter caller) { double md = q1.maxDiff, m; if ((m = q2.maxDiff) > md) md = m; @@ -260,6 +257,4 @@ public class CCJacobi { System.out.println("max diff after " + steps + " steps = " + md); } } - - }