예제 #1
0
 private byte[] randomByteArray(int len) {
   byte t[] = new byte[len];
   random.nextBytes(t);
   in1DAlloc.copyFrom(t);
   in2DAlloc.copyFrom(t);
   in3DAlloc.copyFrom(t);
   return t;
 }
예제 #2
0
 private double[] randomDoubleArray(int len) {
   double t[] = new double[len];
   for (int i = 0; i < t.length; i++) {
     t[i] = random.nextDouble();
   }
   in1DAlloc.copyFrom(t);
   in2DAlloc.copyFrom(t);
   in3DAlloc.copyFrom(t);
   return t;
 }
예제 #3
0
 private float[] randomFloatArray(int len) {
   float t[] = new float[len];
   for (int i = 0; i < t.length; i++) {
     t[i] = random.nextFloat();
   }
   in1DAlloc.copyFrom(t);
   in2DAlloc.copyFrom(t);
   in3DAlloc.copyFrom(t);
   return t;
 }
예제 #4
0
 private long[] randomLongArray(int len) {
   long t[] = new long[len];
   for (int i = 0; i < t.length; i++) {
     t[i] = random.nextLong();
   }
   in1DAlloc.copyFrom(t);
   in2DAlloc.copyFrom(t);
   in3DAlloc.copyFrom(t);
   return t;
 }
예제 #5
0
 private int[] randomIntArray(int len) {
   int t[] = new int[len];
   for (int i = 0; i < t.length; i++) {
     t[i] = random.nextInt();
   }
   in1DAlloc.copyFrom(t);
   in2DAlloc.copyFrom(t);
   in3DAlloc.copyFrom(t);
   return t;
 }
예제 #6
0
 private short[] randomShortArray(int len) {
   short t[] = new short[len];
   for (int i = 0; i < t.length; i++) {
     t[i] = (short) (random.nextInt() & 0xffff);
   }
   in1DAlloc.copyFrom(t);
   in2DAlloc.copyFrom(t);
   in3DAlloc.copyFrom(t);
   return t;
 }
예제 #7
0
 private void verify(double[] a1, double[] a2, Allocation alloc, String s, int vsize) {
   alloc.copyTo(a2);
   for (int i = 0; i < gWidth; i++) {
     if (a1[i] != a2[i]) {
       if ((vsize == 3) && ((i % 4) == 3)) {
         continue;
       }
       throw new RSRuntimeException(s + a1[i] + ", " + a2[i] + ", at " + i);
     }
     a2[i] = 0;
   }
   alloc.copyFrom(a2);
 }