cocycle.py uses vertex list, and does not make any assumptions about the vertex-simplex order dev
authorDmitriy Morozov <dmitriy@mrzv.org>
Wed, 19 Aug 2009 12:01:47 -0700
branchdev
changeset 165 c3c3c53dfc08
parent 164 f7244460f21f
child 166 1f3d54b2315b
cocycle.py uses vertex list, and does not make any assumptions about the vertex-simplex order
examples/cohomology/cocycle.py
--- a/examples/cohomology/cocycle.py	Thu Aug 13 13:16:15 2009 -0700
+++ b/examples/cohomology/cocycle.py	Wed Aug 19 12:01:47 2009 -0700
@@ -7,7 +7,6 @@
 import  os.path
 
 def smooth(boundary_list, cocycle_list, vertices):
-    vertices = [v[1] for v in vertices]
     dimension = max((max(d[1], d[2]) for d in boundary_list))
     dimension += 1
 
@@ -47,8 +46,8 @@
         print "Expected a harmonic cocycle:", sum((D*v)**2), sum((D.T*v)**2) 
 
     values = [None]*len(vertices)
-    for i in xrange(len(vertices)):
-        values[vertices[i]] = solution[0][i]
+    for i,v in vertices:
+        values[v] = solution[0][i]
     return values