예제 #1
0
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
예제 #2
0
파일: MCTree.py 프로젝트: argriffing/xgcode
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
예제 #3
0
파일: MCTree.py 프로젝트: argriffing/xgcode
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
예제 #4
0
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
예제 #5
0
 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))
예제 #6
0
파일: MCTree.py 프로젝트: argriffing/xgcode
 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))