def main(): parser = argparse.ArgumentParser(description=g_cmdline_message) parser.add_argument('--counterexamples', default='counterexamples.out', help='write counterexamples to this file') args = parser.parse_args() checker = TrackingChecker(args.counterexamples) print combobreaker.run_checker(checker, gen_trees())
def get_response_content(fs): # define the amount of time we will search nseconds = 5 # set up print options np.set_printoptions( linewidth=1000000, threshold=1000000, ) out = StringIO() # define the cut strategy if fs.min_cut: valuator = min_cut_valuator elif fs.fiedler_cut: valuator = fiedler_cut_valuator else: raise Exception # define the extension strategy if fs.harmonic_extension: extendor = harmonic_extension elif fs.combinatorial_extension: extendor = combinatorial_extension else: raise Exception # look for a tree for which the harmonic extension of the cut is bad ret = combobreaker.run_checker( functools.partial(check_generic_cut, valuator, extendor), gen_random_weighted_binary_trees(), nseconds=nseconds, niterations=None, ) print >> out, ret # show the result return out.getvalue()
print >> out, 'v:', self.v print >> out, 'M:', self.M print >> out, 'eigenvalues:', W print >> out, 'eigenvectors as columns:' print >> out, V else: print >> out, 'nothing interesting was observed' return out.getvalue().rstrip() def gen_uv_pairs(ndim): while True: u = np.array([1] + [0] * (ndim - 1)) v = np.random.randn(ndim) yield u, v if __name__ == '__main__': parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--n', type=int, default=6, help='use this many dimensions') parser.add_argument('--eps', type=float, default='1e-8', help='smaller eigenvalues are said to be zero') args = parser.parse_args() checker = TrackingChecker(args.eps) print combobreaker.run_checker(checker, gen_uv_pairs(args.n))