def get_simple_rd(test_data_id, N, samp, cap, logfilename=os.devnull):
    '\n    Use simple unique test: if max absolute coordinate-wise difference < 2**-32\n    Compute and save distances between pairs of points found by both solvers.\n    Computes for the samp^{th} sample network of size N in test_data_id.\n    test_data_id should be as in fxpt_experiments.generate_test_data (without file extension).\n    Only pairs within a random subset of points of size cap are inspected.\n    Saves pair-wise distance distribution in histogram with one bucket per integer power of 2\n    logfilename is a file name at which progress updates are written.\n    '
    logfile = open(logfilename, 'w')
    rfx.hardwrite(logfile, ('Running simple rd (%s,%d,%d)...\n' % (test_data_id, N, samp)))
    buckets = {}
    bins = np.arange((- 1025), 3)
    for method_key in ['traverse', 'baseline']:
        npz = fe.load_npz_file(('results/%s_%s_N_%d_s_%d.npz' % (method_key, test_data_id, N, samp)))
        fxV = npz['fxV_converged']
        buckets[method_key] = np.zeros((len(bins) - 1))
        if ((cap is not None) and (fxV.shape[1] > cap)):
            rfx.hardwrite(logfile, 'capping...\n')
            perm = np.random.permutation(fxV.shape[1])
            fxV = fxV[:, perm[:cap]]
        for j in range(fxV.shape[1]):
            rfx.hardwrite(logfile, ('disting %d of %d...\n' % (j, fxV.shape[1])))
            dists = np.fabs((fxV - fxV[:, [j]])).max(axis=0)
            dists[(dists == 0)] = (2.0 ** bins[0])
            logdists = np.log2(dists)
            logdists[(logdists < bins[0])] = bins[0]
            logdists[(logdists > bins[(- 1)])] = bins[(- 1)]
            (hist, _) = np.histogram(logdists, bins=bins)
            buckets[method_key] += hist
    npz = {'bins': bins, 'traverse_buckets': buckets['traverse'], 'baseline_buckets': buckets['baseline']}
    fe.save_npz_file(('results/simple_rd_%s_N_%d_s_%d.npz' % (test_data_id, N, samp)), **npz)
    rfx.hardwrite(logfile, 'Done.\n')
    logfile.close()
    print(('Done %s %d %d' % (test_data_id, N, samp)))
Use simple unique test: if max absolute coordinate-wise difference < 2**-32
Compute and save distances between pairs of points found by both solvers.
Computes for the samp^{th} sample network of size N in test_data_id.
test_data_id should be as in fxpt_experiments.generate_test_data (without file extension).
Only pairs within a random subset of points of size cap are inspected.
Saves pair-wise distance distribution in histogram with one bucket per integer power of 2
logfilename is a file name at which progress updates are written.
def get_simple_rd(test_data_id, N, samp, cap, logfilename=os.devnull):
    '\n    Use simple unique test: if max absolute coordinate-wise difference < 2**-32\n    Compute and save distances between pairs of points found by both solvers.\n    Computes for the samp^{th} sample network of size N in test_data_id.\n    test_data_id should be as in fxpt_experiments.generate_test_data (without file extension).\n    Only pairs within a random subset of points of size cap are inspected.\n    Saves pair-wise distance distribution in histogram with one bucket per integer power of 2\n    logfilename is a file name at which progress updates are written.\n    '
    logfile = open(logfilename, 'w')
    rfx.hardwrite(logfile, ('Running simple rd (%s,%d,%d)...\n' % (test_data_id, N, samp)))
    buckets = {}
    bins = np.arange((- 1025), 3)
    for method_key in ['traverse', 'baseline']:
        npz = fe.load_npz_file(('results/%s_%s_N_%d_s_%d.npz' % (method_key, test_data_id, N, samp)))
        fxV = npz['fxV_converged']
        buckets[method_key] = np.zeros((len(bins) - 1))
        if ((cap is not None) and (fxV.shape[1] > cap)):
            rfx.hardwrite(logfile, 'capping...\n')
            perm = np.random.permutation(fxV.shape[1])
            fxV = fxV[:, perm[:cap]]
        for j in range(fxV.shape[1]):
            rfx.hardwrite(logfile, ('disting %d of %d...\n' % (j, fxV.shape[1])))
            dists = np.fabs((fxV - fxV[:, [j]])).max(axis=0)
            dists[(dists == 0)] = (2.0 ** bins[0])
            logdists = np.log2(dists)
            logdists[(logdists < bins[0])] = bins[0]
            logdists[(logdists > bins[(- 1)])] = bins[(- 1)]
            (hist, _) = np.histogram(logdists, bins=bins)
            buckets[method_key] += hist
    npz = {'bins': bins, 'traverse_buckets': buckets['traverse'], 'baseline_buckets': buckets['baseline']}
    fe.save_npz_file(('results/simple_rd_%s_N_%d_s_%d.npz' % (test_data_id, N, samp)), **npz)
    rfx.hardwrite(logfile, 'Done.\n')
    logfile.close()
    print(('Done %s %d %d' % (test_data_id, N, samp)))