ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/LU.java
(Generate patch)

Comparing jsr166/src/test/loops/LU.java (file contents):
Revision 1.4 by jsr166, Mon Nov 29 20:58:07 2010 UTC vs.
Revision 1.8 by jsr166, Thu Jan 15 18:34:19 2015 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   //import jsr166y.*;
8   import java.util.concurrent.*;
9 import java.util.concurrent.TimeUnit;
10
9  
10   /**
11   * LU matrix decomposition demo
# Line 74 | Line 72 | public final class LU {
72          pool.shutdown();
73      }
74  
77
75      static void randomInit(double[][] M, int n) {
76          java.util.Random rng = new java.util.Random();
77          for (int i = 0; i < n; ++i)
# Line 105 | Line 102 | public final class LU {
102          System.out.println("Max difference = " + maxDiff);
103      }
104  
108
105      // Blocks record underlying matrix, and offsets into current block
106      static final class Block {
107          final double[][] m;
# Line 218 | Line 214 | public final class LU {
214                  Block L10 = new Block(L.m, L.loRow+h, L.loCol);
215                  Block L11 = new Block(L.m, L.loRow+h, L.loCol+h);
216  
221
217                  Seq3 s1 =
218                      seq(new Lower(h, L00, M00),
219                          new Schur(h, L10, M00, M10),
# Line 234 | Line 229 | public final class LU {
229          }
230      }
231  
237
232      static final class Upper extends RecursiveAction {
233          final int size;
234          final Block U;
# Line 258 | Line 252 | public final class LU {
252              }
253          }
254  
261
255          public void compute() {
256              if (size == BLOCK_SIZE) {
257                  upper();
# Line 291 | Line 284 | public final class LU {
284          }
285      }
286  
294
287      static final class LowerUpper extends RecursiveAction {
288          final int size;
289          final Block M;
# Line 379 | Line 371 | public final class LU {
371              thr.invoke();
372          }
373      }
382
383
384
374   }
386

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines