private float[][][] slice23() { float[][][] x = new float[_nc][][]; float[][] xic = new float[_n3][_n2]; for (int ic=0; ic<_nc; ++ic) { _f3[ic].get23(_n2,_n3,_k1,0,0,xic); x[ic] = (_transpose23)?transpose(xic):copy(xic); } return x; }
public void testSymmetric22() { int nrand = 10000; double[][] v = new double[2][2]; double[] d = new double[2]; for (int irand=0; irand<nrand; ++irand) { double[][] a = randdouble(2,2); a = add(a, transpose(a)); Eigen.solveSymmetric22(a,v,d); check(a,v,d); } }
public void test2Transpose() { int n1 = 4; int n2 = 5; double af,ai,al,b; //af = al = 0.50; // zero-value af = al = 0.76; // nearly zero-slope, but invertible ai = 0.52; b = 0.24; SymmetricTridiagonalFilter f = new SymmetricTridiagonalFilter(af,ai,al,b); float[][] x = randfloat(n1,n2); float[][] y = zerofloat(n1,n2); float[][] z = zerofloat(n2,n1); f.apply1(x,y); x = transpose(x); f.apply2(x,z); z = transpose(z); //dump(y); dump(z); assertEqual(y,z); }
public void test2(float b0, float b1, float b2, float a1, float a2) { int n = 20; float[][] x,y1,y2; x = randfloat(n,n); Recursive2ndOrderFilter rf = new Recursive2ndOrderFilter(b0,b1,b2,a1,a2); y1 = copy(x); rf.apply1Forward(y1,y1); rf.accumulate1Forward(y1,y1); y2 = transpose(x); rf.apply2Forward(y2,y2); rf.accumulate2Forward(y2,y2); y2 = transpose(y2); assertEqual(y1,y2); y1 = copy(x); rf.apply1Reverse(y1,y1); rf.accumulate1Reverse(y1,y1); y2 = transpose(x); rf.apply2Reverse(y2,y2); rf.accumulate2Reverse(y2,y2); y2 = transpose(y2); assertEqual(y1,y2); }
for (int irand=0; irand<nrand; ++irand) { a[irand] = randdouble(3,3); a[irand] = add(a[irand],transpose(a[irand]));