summaryrefslogtreecommitdiff
path: root/datastructures/dynamicConvexHull.cpp
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-03-15 01:25:09 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-03-15 01:25:09 +0100
commit7e24d9d392aff890981f13c299b283189d94a75d (patch)
tree6e608a59fc2887240145d678f8be2f8a0356393d /datastructures/dynamicConvexHull.cpp
parent8bad05892517601c7161b34a5ab775290d254938 (diff)
too many changes for one commit
- simplify envelope code - add more files as optional - allow compiling optional without editing tcr.tex - formatting changes
Diffstat (limited to 'datastructures/dynamicConvexHull.cpp')
-rw-r--r--datastructures/dynamicConvexHull.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/datastructures/dynamicConvexHull.cpp b/datastructures/dynamicConvexHull.cpp
index d669847..2bd67a6 100644
--- a/datastructures/dynamicConvexHull.cpp
+++ b/datastructures/dynamicConvexHull.cpp
@@ -19,13 +19,11 @@ struct HullDynamic : multiset<Line, less<>> {
auto x = insert({m, b, 0});
while (isect(x, next(x))) erase(next(x));
if (x != begin()) {
- x--;
- if (isect(x, next(x))) {
- erase(next(x));
- isect(x, next(x));
- }}
+ --x;
+ while (isect(x, next(x))) erase(next(x));
+ }
while (x != begin() && prev(x)->p >= x->p) {
- x--;
+ --x;
isect(x, erase(next(x)));
}}