當前位置: 首頁>>代碼示例>>Java>>正文


Java Parallel類代碼示例

本文整理匯總了Java中edu.mines.jtk.util.Parallel的典型用法代碼示例。如果您正苦於以下問題:Java Parallel類的具體用法?Java Parallel怎麽用?Java Parallel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Parallel類屬於edu.mines.jtk.util包,在下文中一共展示了Parallel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: apply1

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
/**
 * Applies this filter along the 1st array dimension.
 * Input and output arrays can be the same array.
 * @param x input array.
 * @param y output array.
 */
public void apply1(float[][][] x, float[][][] y) {
  final float[][][] xx = x;
  final float[][][] yy = y;
  final int n2 = x[0].length;
  final int n3 = x.length;
  Parallel.loop(n3,new Parallel.LoopInt() {
    public void compute(int i3) {
      for (int i2=0; i2<n2; ++i2) {
        float[] x32 = xx[i3][i2];
        float[] y32 = yy[i3][i2];
        smooth1(_ei,_zs,_a1,x32,y32);
      }
    }
  });
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:22,代碼來源:RecursiveExponentialFilter.java

示例2: apply3

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
/**
 * Applies this filter along the 3rd array dimension.
 * Input and output arrays can be the same array.
 * @param x input array.
 * @param y output array.
 */
public void apply3(float[][][] x, float[][][] y) {
  final float[][][] xx = x;
  final float[][][] yy = y;
  final int n2 = x[0].length;
  final int n3 = x.length;
  Parallel.loop(n2,new Parallel.LoopInt() {
    public void compute(int i2) {
      float[][] x2 = new float[n3][];
      float[][] y2 = new float[n3][];
      for (int i3=0; i3<n3; ++i3) {
        x2[i3] = xx[i3][i2];
        y2[i3] = yy[i3][i2];
      }
      smooth2(_ei,_zs,_a3,x2,y2);
    }
  });
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:24,代碼來源:RecursiveExponentialFilter.java

示例3: marchParallel

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
/**
 * Performs an adapted version of marching cubes whereby the precomputed
 * edge-intersections are employed.
 * Parallel version.
 */
private void marchParallel(float[][][] array, float c) {
  final float[][][] farray = array;
  final float fc = c;
  final int i3step = 2;
  int i3start = 0;
  final int i3stop = _n3-1;
  for (int i3pass=0; i3pass<i3step; ++i3pass,++i3start) {
    Parallel.loop(i3start,i3stop,i3step,new Parallel.LoopInt() {
      public void compute(int i3) {
        _tlist[i3] = new IntList();
        _stlist[i3] = new IntList();
        _xlist[i3] = new FloatList();
        march(farray,fc,i3,_xlist[i3],_tlist[i3],_stlist[i3]);
      }
    });
  }
}
 
開發者ID:chrisengelsma,項目名稱:3d-painting,代碼行數:23,代碼來源:Painting3.java

示例4: apply2

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
/**
 * Applies this filter along the 2nd array dimension.
 * Input and output arrays can be the same array.
 * @param x input array.
 * @param y output array.
 */
public void apply2(float[][][] x, float[][][] y) {
  final float[][][] xx = x;
  final float[][][] yy = y;
  final int n3 = x.length;
  Parallel.loop(n3,new Parallel.LoopInt() {
    public void compute(int i3) {
      float[][] x3 = xx[i3];
      float[][] y3 = yy[i3];
      smooth2(_ei,_zs,_a2,x3,y3);
    }
  });
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:19,代碼來源:RecursiveExponentialFilter.java

示例5: szero

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
private static void szero(final float[][][] x) {
  final int n3 = x.length;
  Parallel.loop(n3,new Parallel.LoopInt() {
    public void compute(int i3) {
      szero(x[i3]);
    }
  });
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:9,代碼來源:LocalSmoothingFilter.java

示例6: scopy

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
private static void scopy(final float[][][] x, final float[][][] y) {
  final int n3 = x.length;
  Parallel.loop(n3,new Parallel.LoopInt() {
    public void compute(int i3) {
      scopy(x[i3],y[i3]);
    }
  });
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:9,代碼來源:LocalSmoothingFilter.java

示例7: sdot

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
private static float sdot(final float[][][] x, final float[][][] y) {
  final int n3 = x.length;
  final float[] d3 = new float[n3];
  Parallel.loop(n3,new Parallel.LoopInt() {
    public void compute(int i3) {
      d3[i3] = sdot(x[i3],y[i3]);
    }
  });
  float d = 0.0f;
  for (int i3=0; i3<n3; ++i3)
    d += d3[i3];
  return d;
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:14,代碼來源:LocalSmoothingFilter.java

示例8: saxpy

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
private static void saxpy(
  final float a, final float[][][] x, final float[][][] y)
{
  final int n3 = x.length;
  Parallel.loop(n3,new Parallel.LoopInt() {
    public void compute(int i3) {
      saxpy(a,x[i3],y[i3]);
    }
  });
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:11,代碼來源:LocalSmoothingFilter.java

示例9: sxpay

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
private static void sxpay(
  final float a, final float[][][] x, final float[][][] y)
{
  final int n3 = x.length;
  Parallel.loop(n3,new Parallel.LoopInt() {
    public void compute(int i3) {
      sxpay(a,x[i3],y[i3]);
    }
  });
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:11,代碼來源:LocalSmoothingFilter.java

示例10: sxy

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
private static void sxy(
  final float[][][] x, final float[][][] y, final float[][][] z) 
{
  final int n3 = x.length;
  Parallel.loop(n3,new Parallel.LoopInt() {
    public void compute(int i3) {
      sxy(x[i3],y[i3],z[i3]);
    }
  });
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:11,代碼來源:LocalSmoothingFilter.java

示例11: apply1

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
/**
 * Applies this filter along the 1st dimension of a 2D array.
 * @param x input array x; may be the same as the output array y.
 * @param y output array y; may be the same as the input array x.
 */
public void apply1(final float[][] x, final float[][] y) {
  int n = x.length;
  Parallel.loop(n,new Parallel.LoopInt() {
  public void compute(int i) {
    apply(x[i],y[i]);
  }});
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:13,代碼來源:SymmetricTridiagonalFilter.java

示例12: apply2

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
/**
 * Applies this filter along the 2nd dimension of a 3D array.
 * @param x input array x; may be the same as the output array y.
 * @param y output array y; may be the same as the input array x.
 */
public void apply2(final float[][][] x, final float[][][] y) {
  int n = x.length;
  Parallel.loop(n,new Parallel.LoopInt() {
  public void compute(int i) {
    apply2(x[i],y[i]);
  }});
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:13,代碼來源:SymmetricTridiagonalFilter.java

示例13: applyInverse1

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
/**
 * Applies the inverse of this filter along the 1st dimension of a 2D array.
 * @param x input array x; may be the same as the output array y.
 * @param y output array y; may be the same as the input array x.
 */
public void applyInverse1(final float[][] x, final float[][] y) {
  int n = x.length;
  Parallel.loop(n,new Parallel.LoopInt() {
  public void compute(int i) {
    applyInverse(x[i],y[i]);
  }});
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:13,代碼來源:SymmetricTridiagonalFilter.java

示例14: applyInverse2

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
/**
 * Applies the inverse of this filter along the 2nd dimension of a 3D array.
 * @param x input array x; may be the same as the output array y.
 * @param y output array y; may be the same as the input array x.
 */
public void applyInverse2(final float[][][] x, final float[][][] y) {
  int n = x.length;
  Parallel.loop(n,new Parallel.LoopInt() {
  public void compute(int i) {
    applyInverse2(x[i],y[i]);
  }});
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:13,代碼來源:SymmetricTridiagonalFilter.java

示例15: computeGradientProducts

import edu.mines.jtk.util.Parallel; //導入依賴的package包/類
private void computeGradientProducts(
  final float[][][] g1, final float[][][] g2, final float[][][] g3,
  final float[][][] g11, final float[][][] g12, final float[][][] g13,
  final float[][][] g22, final float[][][] g23, final float[][][] g33)
{
  final int n1 = g1[0][0].length;
  final int n2 = g1[0].length;
  final int n3 = g1.length;
  Parallel.loop(n3,new Parallel.LoopInt() {
    public void compute(int i3) {
      for (int i2=0; i2<n2; ++i2) {
        float[] g1i = g1[i3][i2];
        float[] g2i = g2[i3][i2];
        float[] g3i = g3[i3][i2];
        float[] g11i = g11[i3][i2];
        float[] g12i = g12[i3][i2];
        float[] g13i = g13[i3][i2];
        float[] g22i = g22[i3][i2];
        float[] g23i = g23[i3][i2];
        float[] g33i = g33[i3][i2];
        for (int i1=0; i1<n1; ++i1) {
          float g1ii = g1i[i1];
          float g2ii = g2i[i1];
          float g3ii = g3i[i1];
          g11i[i1] = g1ii*g1ii;
          g22i[i1] = g2ii*g2ii;
          g33i[i1] = g3ii*g3ii;
          g12i[i1] = g1ii*g2ii;
          g13i[i1] = g1ii*g3ii;
          g23i[i1] = g2ii*g3ii;
        }
      }
    }
  });
}
 
開發者ID:MinesJTK,項目名稱:jtk,代碼行數:36,代碼來源:LocalOrientFilter.java


注:本文中的edu.mines.jtk.util.Parallel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。