public static void checkCache(double[] cache, double[] read) {
        boolean error = false;

        if (cache.length != read.length) {
            System.out.println("\tERROR: Cache array length difference : cache length = " + cache.length
                    + "\t obsval length = " + read.length);
            error = true;
        }
        for (int i = 0; i < cache.length; i++) {
            if (cache[i] != read[i]) {
                System.out.println("\tERROR: Data " + i + "mismatch: cache = " + cache[i] + "\t computed = " + read[i]);
                error = true;
            }
        }

        if (error == true) {
            throw new RuntimeException("\tERROR: !!!Check on validity of observed cache data check showed an Error!!!");
        }
        error = false;
        if (showCacheStats) {
            System.out.print("\n\tRandom cache data validity check passed.\t");
        }
    }