bindings/python/dionysus/zigzag.py
author Dmitriy Morozov <dmitriy@mrzv.org>
Fri May 11 17:06:55 2012 -0700 (2 weeks ago)
branchdev
changeset 251 870865d25958
parent 1322a737609b8bf
permissions -rw-r--r--
Merge
     1 def add_simplices(zz, simplices, complex, birth, report_local = False):
     2     deaths = []
     3     for s in simplices:
     4         i,d = zz.add([complex[sb] for sb in s.boundary], (s.dimension(), birth))
     5         complex[s] = i
     6         if d is not None:
     7             if report_local or not d[1] == birth:
     8                 deaths.append(d)
     9     return deaths
    10             
    11 
    12 def remove_simplices(zz, simplices, complex, birth, report_local = False):
    13     deaths = []
    14     for s in simplices:
    15         d = zz.remove(complex[s], (s.dimension() - 1, birth))
    16         complex[s] = None
    17         if d is not None:
    18             if report_local or not d[1] == birth:
    19                 deaths.append(d)
    20     return deaths