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

Simplify populateNeighborhood by eliminating redundant operations #11

Open
2 tasks
erdenbatuhan opened this issue Feb 14, 2022 · 0 comments
Open
2 tasks
Assignees
Labels
enhancement New feature or request

Comments

@erdenbatuhan
Copy link
Owner

Please verify and fix the following:

  • Unless I'm missing a special case here, we don't need to check the duplicate neighbors because we iterate over all neighbors for each vertex, and each face is processed only once for each vertex. We can set the map entry directly instead.
    for (auto neighbor: allNeighbors) { // Iterate over all the found neighbors of the vertex
  • Since the innermost if-condition will only be true once per face, we can ideally exit the innermost loop when a match is found.
    if (faces(j, k) == i) {
@erdenbatuhan erdenbatuhan added the enhancement New feature or request label Feb 14, 2022
@erdenbatuhan erdenbatuhan changed the title Simplify "populateNeighborhood" by eliminating redundant operations Simplify populateNeighborhood by eliminating redundant operations Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants