src/geo2d/argsort/lib.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "../ds/p/lib.hpp" | ||
| 4 | |||
| 5 | namespace tifa_libs { | ||
| 6 | |||
| 7 | // sort in counterclockwise | ||
| 8 | template <class FP> | ||
| 9 | 21 | CEXP void argsort(vec<point<FP>>& vp, u32 quad_start = 6) NE { | |
| 10 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 21 times.
|
21 | assert(quad_start < 9); |
| 11 |
2/2✓ Branch 3 taken 59130535 times.
✓ Branch 4 taken 6240461 times.
|
65371017 | sort(vp, [ofs = 9 - quad_start](point<FP> CR l, point<FP> CR r) NE { retif_((l.quad() == r.quad()), is_pos(l ^ r), (l.quad() + ofs) % 9 < (r.quad() + ofs) % 9); }); |
| 12 | 21 | } | |
| 13 | |||
| 14 | } // namespace tifa_libs | ||
| 15 |