예제 #1
0
 private static void applyLhs(final float[][][] x, final float[][][] y) {
   final int n3 = x.length;
   Parallel.loop(
       1,
       n3,
       2,
       new Parallel.LoopInt() { // i3 = 1, 3, 5, ...
         public void compute(int i3) {
           applyLhsSlice3(i3, x, y);
         }
       });
   Parallel.loop(
       2,
       n3,
       2,
       new Parallel.LoopInt() { // i3 = 2, 4, 6, ...
         public void compute(int i3) {
           applyLhsSlice3(i3, x, y);
         }
       });
 }
예제 #2
0
 public float[][][] findScreenPoints(
     final float smin,
     final float[][][] ss,
     final float[][][] u1,
     final float[][][] u2,
     final float[][][] u3) {
   final int n3 = ss.length;
   final int n2 = ss[0].length;
   final int n1 = ss[0][0].length;
   final Sampling s1 = new Sampling(n1);
   final Sampling s2 = new Sampling(n2);
   final Sampling s3 = new Sampling(n3);
   final float[][][] mk = new float[n3][n2][n1];
   final SincInterpolator si = new SincInterpolator();
   si.setExtrapolation(SincInterpolator.Extrapolation.CONSTANT);
   Parallel.loop(
       1,
       n3 - 1,
       new Parallel.LoopInt() {
         public void compute(int i3) {
           for (int i2 = 1; i2 < n2 - 1; ++i2) {
             for (int i1 = 1; i1 < n1 - 1; ++i1) {
               float sxi = ss[i3][i2][i1];
               float u1i = u1[i3][i2][i1] * 2f;
               float u2i = u2[i3][i2][i1] * 2f;
               float u3i = u3[i3][i2][i1] * 2f;
               float x1m = i1 - u1i;
               float x2m = i2 - u2i;
               float x3m = i3 - u3i;
               float x1p = i1 + u1i;
               float x2p = i2 + u2i;
               float x3p = i3 + u3i;
               float sxm = si.interpolate(s1, s2, s3, ss, x1m, x2m, x3m);
               float sxp = si.interpolate(s1, s2, s3, ss, x1p, x2p, x3p);
               if (sxi > sxm && sxi > sxp && sxi > smin) mk[i3][i2][i1] = sxi;
             }
           }
         }
       });
   return mk;
 }