cocycle.py uses vertex list, and does not make any assumptions about the vertex-simplex order
--- 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