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

Separate arcMap generation from writing to file #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

PetiteViking
Copy link
Contributor

@PetiteViking PetiteViking commented Nov 11, 2021

I separated the generation of the arcMap from writing it to file since writing to file might not be needed. One could instead directly work with the arcMap.

@PetiteViking
Copy link
Contributor Author

This should be backwards-compatible so no dependent projects would break due to this.

std::vector<int64_t> nodeids;
std::vector<scalar_t> nodefns;
std::vector<char> nodeTypes;
std::vector<int64_t> arcs;

arcMap.resize(nv, -1);

uint32_t arcNo = 0;
for (int64_t i = 0; i < nv; i++) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a nested loop here?

@@ -145,6 +145,7 @@ ContourTree::computeArcMap() {

return {arcNo, nodeids, nodefns, nodeTypes, arcs};
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this added because of the additional loop? Based in this, the return statement is anyway inside the second loop. Was the first loop a copy paste error?

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

Successfully merging this pull request may close these issues.

2 participants