Henry Adams' fixes to python/dionysus/zigzag.py + added CohomologyPersistence.show_cocycles method dev
authorDmitriy Morozov <dmitriy@mrzv.org>
Sat, 09 Jan 2010 15:03:52 -0800
branchdev
changeset 188 23cb832e035d
parent 187 25e468323d77
child 189 e867c6cf02ef
Henry Adams' fixes to python/dionysus/zigzag.py + added CohomologyPersistence.show_cocycles method
bindings/python/cohomology-persistence.cpp
bindings/python/dionysus/zigzag.py
--- 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