/** * Constructs a local smoothing filter with specified iteration parameters. * Uses a default 2x2 stencil for the derivatives in the operator G. * @param small stop when norm of residuals is less than this factor * times the norm of the input array. * @param niter stop when number of iterations exceeds this limit. */ public LocalSmoothingFilter(double small, int niter) { _small = (float)small; _niter = niter; _ldk = new LocalDiffusionKernel(LocalDiffusionKernel.Stencil.D22); }
public void testD21() { LocalDiffusionKernel ldk = new LocalDiffusionKernel(LocalDiffusionKernel.Stencil.D21); testSpd2(ldk); testSpd3(ldk); /* float[][] s = fillfloat(1.0f,5,5); float[][] x = zerofloat(5,5); float[][] y = zerofloat(5,5); //s[1][1] = 2.0f; s[1][2] = 2.0f; s[1][3] = 2.0f; //s[2][1] = 2.0f; s[2][2] = 2.0f; s[2][3] = 2.0f; //s[3][1] = 2.0f; s[3][2] = 2.0f; s[3][3] = 2.0f; s[2][2] = 2.0f; x[0][0] = 1.0f; x[0][4] = 1.0f; x[4][0] = 1.0f; x[4][4] = 1.0f; x[2][2] = 1.0f; ldk.apply(1.0f,s,x,y); dump(x); dump(y); */ } public void testD22() {
public void testD22() { LocalDiffusionKernel ldk = new LocalDiffusionKernel(LocalDiffusionKernel.Stencil.D22); testSpd2(ldk); testSpd3(ldk); testSpd2RandomTensors(ldk); }
for (int i=0; i<stencils.length; ++i) { System.out.println(stencilNames[i]); LocalDiffusionKernel ldf = new LocalDiffusionKernel(stencils[i]); int niter; double maxtime = 5.0;
for (int i=0; i<stencils.length; ++i) { System.out.println(stencilNames[i]); LocalDiffusionKernel ldf = new LocalDiffusionKernel(stencils[i]); int niter; double maxtime = 5.0;