def get_mc_trees_ben_slow(N): """ This is written much later in a way that I hope is clearer and slower. """ if N <= 3: raise ValueError('not enough states') all_splits = list(splitalg.get_informative_partial_splits(N)) mc_trees = [] for nsplits in range(N - 2): for splits in itertools.combinations(all_splits, nsplits): pass
def get_mc_trees_ben_slow(N): """ This is written much later in a way that I hope is clearer and slower. """ if N <= 3: raise ValueError('not enough states') all_splits = list(splitalg.get_informative_partial_splits(N)) mc_trees = [] for nsplits in range(N-2): for splits in itertools.combinations(all_splits, nsplits): pass
def get_mc_trees_ben(N): """ Use Ben's nine rules to generate the set of mc trees with a given number of leaves. """ assert N > 3 nsplits = N - 3 available_splits = list(splitalg.get_informative_partial_splits(N)) mc_trees = [] initial_split_set = set() initial_offset = 0 get_mc_trees_ben_helper(initial_split_set, initial_offset, N, available_splits, mc_trees) return mc_trees
def __init__(self, N): self.N = N self.all_quartets = list(splitalg.get_quartets(N)) self.all_splits = list(splitalg.get_informative_partial_splits(N))