From 7e24d9d392aff890981f13c299b283189d94a75d Mon Sep 17 00:00:00 2001 From: Gloria Mundi Date: Fri, 15 Mar 2024 01:25:09 +0100 Subject: too many changes for one commit - simplify envelope code - add more files as optional - allow compiling optional without editing tcr.tex - formatting changes --- datastructures/dynamicConvexHull.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'datastructures/dynamicConvexHull.cpp') 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> { 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))); }} -- cgit v1.2.3