08-cycle-chain.py
author Dmitriy Morozov <dmitriy@mrzv.org>
Sat, 16 Jun 2012 12:25:46 -0700
changeset 3 ef86268a3695
parent 2 4b3728f0d920
child 4 3315b6204a33
permissions -rw-r--r--
Fixed bugs in 08-extended-persistence.py

while True:
    pt = show_diagram(dgms)
    if not pt: break
    print pt
    i = pt[2]
    smap = persistence.make_simplex_map(f)
    chain = [smap[ii] for ii in i.chain]
    pair_cycle = [smap[ii] for ii in i.pair().cycle]
    pair_chain = [smap[ii] for ii in i.pair().chain]
    show_complex(elephant_points, subcomplex = chain)
    if pt[1] != float('inf'):
        show_complex(elephant_points, subcomplex = pair_cycle + pair_chain)
    #show_complex(elephant_points, [s for s in f if s.dimension() != 1], subcomplex = cycle)