You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attached patch, taken from a discussion on ask.sagemath.org, speeds up remove_face for large simplicial complexes. For smaller ones, it is comparable, perhaps a little slower, but the speed-up for large ones is significant.
Before the patch:
sage: S = range(1,8)
sage: timeit('Z = SimplicialComplex(S, [S]); Z.remove_face([1,2,3])')
625 loops, best of 3: 767 µs per loop
sage: timeit('SimplicialComplex(10,[[0,1,2,3,4,5,6],[1,2,3,4,5,6,7],[0,1,2,4,5,6,7],[0,1,2,3,5,6,7],[0,1,2,3,4,5,7]]).remove_face(Simplex([1,2,5]))')
5 loops, best of 3: 42.2 ms per loop
After the patch:
sage: S = range(1,8)
sage: timeit('Z = SimplicialComplex(S, [S]); Z.remove_face([1,2,3])')
625 loops, best of 3: 835 µs per loop
sage: timeit('SimplicialComplex(10,[[0,1,2,3,4,5,6],[1,2,3,4,5,6,7],[0,1,2,4,5,6,7],[0,1,2,3,5,6,7],[0,1,2,3,4,5,7]]).remove_face2(Simplex([1,2,5]))')
125 loops, best of 3: 1.79 ms per loop
The original idea (from ask.sagemath.org) is by "EmersonL", and John Palmieri modified it and wrote the actual patch.
The attached patch, taken from a discussion on ask.sagemath.org, speeds up
remove_face
for large simplicial complexes. For smaller ones, it is comparable, perhaps a little slower, but the speed-up for large ones is significant.Before the patch:
After the patch:
The original idea (from ask.sagemath.org) is by "EmersonL", and John Palmieri modified it and wrote the actual patch.
Component: algebraic topology
Keywords: simplicial remove_face
Author: John Palmieri
Reviewer: Mike Hansen
Merged: sage-5.0.beta14
Issue created by migration from https://trac.sagemath.org/ticket/11625
The text was updated successfully, but these errors were encountered: