-
Notifications
You must be signed in to change notification settings - Fork 129
added deterministic option #550
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. 8000
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
Changes from all commits
ce7d140
9ecc238
177ea04
2df330e
7580590
33aa1ac
cfbd0c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,8 +119,8 @@ void CheckTopology(const std::vector<PolyEdge> &halfedges) { | |
return a.startVert < b.startVert || | ||
(a.startVert == b.startVert && a.endVert < b.endVert); | ||
}; | ||
std::sort(forward.begin(), forward.end(), cmp); | ||
std::sort(backward.begin(), backward.end(), cmp); | ||
std::stable_sort(forward.begin(), forward.end(), cmp); | ||
std::stable_sort(backward.begin(), backward.end(), cmp); | ||
for (int i = 0; i < n_edges; ++i) { | ||
ASSERT(forward[i].startVert == backward[i].startVert && | ||
forward[i].endVert == backward[i].endVert, | ||
|
@@ -838,9 +838,10 @@ class Monotones { | |
} | ||
#if MANIFOLD_PAR == 'T' && TBB_INTERFACE_VERSION >= 10000 && \ | ||
__has_include(<pstl/glue_execution_defs.h>) | ||
std::sort(std::execution::par_unseq, starts.begin(), starts.end(), cmp); | ||
std::stable_sort(std::execution::par_unseq, starts.begin(), starts.end(), | ||
cmp); | ||
#else | ||
std::sort(starts.begin(), starts.end(), cmp); | ||
std::stable_sort(starts.begin(), starts.end(), cmp); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these stable sorts make much difference? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably not, this is just in case. the performance of stable sort is not a lot different than sort from my testing (FYI: rust uses stable sort by default, and the c++ sort is named unstable sort in rust and we will only use it when profile shows it is beneficial) |
||
#endif | ||
|
||
std::vector<VertItr> skipped; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool - I hadn't heard of this before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I just know this after searching for numerically stable summation algorithm.