本文整理汇总了Java中edu.mines.jtk.util.Parallel.loop方法的典型用法代码示例。如果您正苦于以下问题:Java Parallel.loop方法的具体用法?Java Parallel.loop怎么用?Java Parallel.loop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.mines.jtk.util.Parallel
的用法示例。
在下文中一共展示了Parallel.loop方法的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);
}
}
});
}
示例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);
}
});
}
示例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]);
}
});
}
}
示例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);
}
});
}
示例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]);
}
});
}
示例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]);
}
});
}
示例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;
}
示例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]);
}
});
}
示例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]);
}
});
}
示例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]);
}
});
}
示例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]);
}});
}
示例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]);
}});
}
示例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]);
}});
}
示例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]);
}});
}
示例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;
}
}
}
});
}