public void test3Random() {
   java.util.Random r = new java.util.Random();
   int ntest = 1000;
   for (int itest = 0; itest < ntest; ++itest) {
     SymmetricTridiagonalFilter stf = makeRandomFilter();
     boolean inplace = r.nextBoolean(); // apply in-place?
     int n1 = 2 + r.nextInt(11);
     int n2 = 2 + r.nextInt(12);
     int n3 = 2 + r.nextInt(13);
     float[][][] t = randfloat(r, n1, n2, n3);
     float[][][] x = copy(t);
     float[][][] y = inplace ? x : zerofloat(n1, n2, n3);
     float[][][] z = inplace ? x : zerofloat(n1, n2, n3);
     stf.apply1(x, y);
     stf.applyInverse1(y, z);
     assertEqual(t, x);
     assertEqual(t, z);
     stf.apply2(x, y);
     stf.applyInverse2(y, z);
     assertEqual(t, x);
     assertEqual(t, z);
     stf.apply3(x, y);
     stf.applyInverse3(y, z);
     assertEqual(t, x);
     assertEqual(t, z);
   }
 }
 public void test3Simple() {
   int n1 = 11;
   int n2 = 12;
   int n3 = 13;
   float[][][] r = randfloat(n1, n2, n3);
   float[][][] x = copy(r);
   float[][][] y = copy(r);
   SymmetricTridiagonalFilter stf = new SymmetricTridiagonalFilter(2.6, 2.5, 2.7, 1.2);
   stf.apply1(x, x);
   stf.apply2(x, x);
   stf.apply3(x, x);
   stf.apply1(y, y);
   y = transpose12(y);
   stf.apply1(y, y);
   y = transpose12(y);
   y = transpose23(y);
   stf.apply2(y, y);
   y = transpose23(y);
   assertEqual(x, y);
 }