-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Triangulation_data_structure (dim d) speed enhancements #8842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Concerning the |
Is the queue better than a stack because it will be less filled? |
Stack is faster, because it is easier to add and remove elements at the same extremity of the container, than it is to add elements on one side and remove them on the other. Plus, it allows changing deque to vector, which is faster. I am not familiar enough with the algorithm to know if the order of queue or stack ends up filling more/less, or has more memory locality, or some other advantage. This is kind of like BFS vs DFS for a graph traversal. Best I can suggest is benchmarking, and on the only example I tried stack was faster... |
That's a possibility. Depending on what else is in the object (mirror index?), it may or not increase the size. Since we still need to check quickly if a cell has been visited, we would need
I was thinking of adding a member |
I gave it a try with a thread local static variable. A data member is probably better, as one can then offer a clear function. |
Note that the queue could also be replaced by a local variable to avoid the allocations |
Concerning"try to avoid calling is_infinite on a cell" : Can we not add logic to |
We could probably store a boolean in each cell saying if it is infinite (though it may require some changes because TDS itself doesn't know anything about infinite vertices). That's starting to look rather specialized though, enlarging all cells for something which may only benefit people abusing Triangulation to compute convex hulls (but maybe there is extra space in cells that can be used without increasing the size, and maybe it also benefits "normal" uses of Triangulation, I don't know). |
Maybe to start with, how and where did you observe the expensive or too many is infinite tests of full cells? |
Probably by profiling (linux perf) a benchmark that did the same thing as yours. Sorry, I don't have anything more precise to say. It could also be related to the last item, testing if we are on the boundary probably involves looking for the infinite vertex. |
Building a triangulation (for instance Triangulation for points on a sphere in dim 5, where every insertion is outside the convex hull) spends a lot of time in TDS operations, even when the dimension is fixed at compile-time (for dynamic dimension, see #8044). This issue is here to list ideas to speed it up (the list may evolve).
queue<T>
bystack<T>
, or evenstack<T,vector<T>>
(most places don't seem to care about the order)while (!is_boundary_facet(rot))
androtate_rotor
. A comment says this is the "easy" way, so maybe there is a faster way?The text was updated successfully, but these errors were encountered: