Beispiel #1
0
def _cross(sd, start1, end1, start2, end2):
    """Cross the two strands (start1, end1) and (start2, end2) of the
    strand diagram on the given side of start_gen.

    """
    strand_lst = list(sd.strands)
    strand_lst.remove((start1, end1))
    strand_lst.remove((start2, end2))
    if start1 != end2:
        strand_lst.append((start1, end2))
    if start2 != end1:
        strand_lst.append((start2, end1))
    result_sd = StrandDiagram(sd.parent, sd.getLeftIdem(), strand_lst)
    assert sd in result_sd.diff()
    return result_sd