Esempio n. 1
0
def assert_splits(blocks, split_sets, mut_splits, mut_pos):

    i = 0

    # are splits in split_sets mutually compatiable?
    for block, splits in izip(blocks, split_sets):
        for i in xrange(len(splits)):
            for j in xrange(i + 1, len(splits)):
                assert arglib.is_split_compatible(splits[i], splits[j]), (splits[i], splits[j])

    # are splits in split_sets compatible with mutation splits?
    for block, splits in izip(blocks, split_sets):
        while i < len(mut_pos) and mut_pos[i] < block[1]:
            for split in splits:
                assert arglib.is_split_compatible(mut_splits[i], split), (mut_splits[i], split)
            i += 1
Esempio n. 2
0
def assert_splits(blocks, split_sets, mut_splits, mut_pos):

    i = 0

    # are splits in split_sets mutually compatiable?
    for block, splits in zip(blocks, split_sets):
        for i in range(len(splits)):
            for j in range(i+1, len(splits)):
                assert arglib.is_split_compatible(splits[i], splits[j]), \
                    (splits[i], splits[j])

    # are splits in split_sets compatible with mutation splits?
    for block, splits in zip(blocks, split_sets):
        while i < len(mut_pos) and mut_pos[i] < block[1]:
            for split in splits:
                assert arglib.is_split_compatible(mut_splits[i], split), \
                    (mut_splits[i], split)
            i += 1
Esempio n. 3
0
def get_conflicts(splits):
    n = len(splits)
    conflicts = []

    for i in range(n):
        for j in range(i+1, n):
            if not arglib.is_split_compatible(splits[i], splits[j]):
                conflicts.append((i, j))

    return conflicts
Esempio n. 4
0
def get_conflicts(splits):
    n = len(splits)
    conflicts = []

    for i in range(n):
        for j in range(i + 1, n):
            if not arglib.is_split_compatible(splits[i], splits[j]):
                conflicts.append((i, j))

    return conflicts
Esempio n. 5
0
def get_unique_conflicts(splits):
    """Ignore redundant conflicts"""

    n = len(splits)
    conflicts = []
    right = [n] * n  # nearest conflict to right
    left = [-1] * n  # nearest conflict to left

    # visit conflict edges in increase itervals
    for k in range(1, n):
        for i in range(n - k):
            j = i + k
            if right[i] < left[j]:
                # redundant, skip
                continue
            if not arglib.is_split_compatible(splits[i], splits[j]):
                # conflict
                conflicts.append((i, j))
                right[i] = min(right[i], j)
                left[j] = max(left[j], i)

    return conflicts, left, right
Esempio n. 6
0
def get_unique_conflicts(splits):
    """Ignore redundant conflicts"""

    n = len(splits)
    conflicts = []
    right = [n] * n  # nearest conflict to right
    left = [-1] * n  # nearest conflict to left

    # visit conflict edges in increase itervals
    for k in range(1, n):
        for i in range(n - k):
            j = i + k
            if right[i] < left[j]:
                # redundant, skip
                continue
            if not arglib.is_split_compatible(splits[i], splits[j]):
                # conflict
                conflicts.append((i, j))
                right[i] = min(right[i], j)
                left[j] = max(left[j], i)

    return conflicts, left, right