Henry Adams' fixes to python/dionysus/zigzag.py + added CohomologyPersistence.show_cocycles method
--- a/bindings/python/cohomology-persistence.cpp Thu Jan 07 10:27:18 2010 -0800
+++ b/bindings/python/cohomology-persistence.cpp Sat Jan 09 15:03:52 2010 -0800
@@ -85,6 +85,7 @@
.def("add", &chp_add, (bp::arg("bdry"), bp::arg("birth"), bp::arg("store")=true, bp::arg("image")=true, bp::arg("coefficients")=false))
.def("__iter__", bp::range(&dp::CohomPersistence::begin, &dp::CohomPersistence::end))
+ .def("show_cocycles", &dp::CohomPersistence::show_cocycles)
;
bp::class_<dp::CohomPersistence::Cocycle>("Cocycle", bp::no_init)
--- a/bindings/python/dionysus/zigzag.py Thu Jan 07 10:27:18 2010 -0800
+++ b/bindings/python/dionysus/zigzag.py Sat Jan 09 15:03:52 2010 -0800
@@ -4,7 +4,7 @@
i,d = zz.add([complex[sb] for sb in s.boundary], (s.dimension(), birth))
complex[s] = i
if d is not None:
- if report_local or not d == birth:
+ if report_local or not d[1] == birth:
deaths.append(d)
return deaths
@@ -12,9 +12,9 @@
def remove_simplices(zz, simplices, complex, birth, report_local = False):
deaths = []
for s in simplices:
- d = zz.remove(complex[s], (s.dimension(), birth))
+ d = zz.remove(complex[s], (s.dimension() - 1, birth))
complex[s] = None
if d is not None:
- if report_local or not d == birth:
+ if report_local or not d[1] == birth:
deaths.append(d)
return deaths