private byte[] randomByteArray(int len) { byte t[] = new byte[len]; random.nextBytes(t); in1DAlloc.copyFrom(t); in2DAlloc.copyFrom(t); in3DAlloc.copyFrom(t); return t; }
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; }
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; }
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; }
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; }
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; }
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); }