Here's my solution for assignment 0. Both functions generate a (partial) adjacency matrix for the mesh, and compute the solutions from there. The matrix is just the lower half of the proper adjacency matrix, to avoid duplicates. From this, the number of edges is just the number of non-zero entries, and the number of vertices is the number of non-zero rows.
I did reimplement (read: copy and paste) the adjacency matrix code in each file, since I didn't feel like separating it out into a function. This means that the euler_characteristic function doesn't call edges(), since I'm generating the adjacency matrix anyways and I only care about the number of edges, not the individual edges.
Here's my solution for assignment 0. Both functions generate a (partial) adjacency matrix for the mesh, and compute the solutions from there. The matrix is just the lower half of the proper adjacency matrix, to avoid duplicates. From this, the number of edges is just the number of non-zero entries, and the number of vertices is the number of non-zero rows.
I did reimplement (read: copy and paste) the adjacency matrix code in each file, since I didn't feel like separating it out into a function. This means that the euler_characteristic function doesn't call edges(), since I'm generating the adjacency matrix anyways and I only care about the number of edges, not the individual edges.