closure() in Python can handle simplex data dev
authorDmitriy Morozov <dmitriy@mrzv.org>
Fri, 07 Jan 2011 23:11:46 -0800
branchdev
changeset 240 ae6319bfb53d
parent 239 cda36c58ef98
child 241 2ca64ce7d57c
closure() in Python can handle simplex data
bindings/python/dionysus/__init__.py
--- a/bindings/python/dionysus/__init__.py	Mon Dec 20 11:21:57 2010 -0800
+++ b/bindings/python/dionysus/__init__.py	Fri Jan 07 23:11:46 2011 -0800
@@ -28,6 +28,9 @@
 def data_dim_cmp(s1,s2):
     return cmp(s1.dimension(), s2.dimension()) or data_cmp(s1,s2)
 
+def dim_data_cmp(s1,s2):
+    return data_cmp(s1,s2) or cmp(s1.dimension(), s2.dimension())
+
 def vertex_dim_cmp(s1, s2):
     return cmp(s1.dimension(), s2.dimension()) or vertex_cmp(s1, s2)
 
@@ -50,6 +53,6 @@
     for s in simplices:
         for kk in xrange(1, k+2):
             for face in combinations(s.vertices, kk):
-                res.add(Simplex(face))
+                res.add(Simplex(face, s.data))
 
     return list(res)