Skip to content
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

Make number of vertex neighbors (eperv) compile-time variable #36

Open
raovgarimella opened this issue Mar 10, 2024 · 2 comments
Open

Comments

@raovgarimella
Copy link
Contributor

I am trying to ease the restriction of having only trivalent polyhedral vertices in R3D and seeing what effect that has on performance of the Portage code. Basically, we almost always give R3D polyhedra with non-trivalent vertices and it has to duplicate the vertices in r3d_init_poly. This seems to take a lot of time.

My thought is that if we make the number of edge-connected vertex neighbors a larger compile time variable (R3D_MAX_NBRS) so that the loops are of static length allowing the compiler to unroll the loops, then we won't be spending as much time in r3d_init_poly

I am able to refactor most of the code but am having the darndest time understanding what the duplicating vertices function is doing in r3d_init_poly. Any hints on how to expand this to rewrite this part?

@devonmpowell
Copy link
Owner

Hi Rao, thanks for your patience with me just now getting back to this issue.
It has been forever since I wrote this bit of code. But basically, it takes a group of four or more edges that meet at one vertex, and creates a "cluster" of trivalent vertices (with identical positions) in order to emulate a single vertex with the required number of edges. All the complicated logic in that function is to figure out how to connect all the length-zero dummy edges between those duplicate vertices, so that the three-connected-planar-graph criterion is still satisfied.
I would say that if you are relaxing the three-edges-per-vertex constraint, then you can ditch this bit of code entirely. You just need to make sure that the edges are ordered correctly around the vertex.
I hope that helps!

@raovgarimella
Copy link
Contributor Author

raovgarimella commented Mar 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants