|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Brute force convex hull algorithm. More...
#include <geom_algorithms.H>
Classes | |
| struct | CmpSegment |
| Comparator for segments to ensure strict weak ordering in sets. More... | |
Public Member Functions | |
| Polygon | operator() (const DynList< Point > &point_set) const |
| Compute the convex hull of a point set. | |
Private Types | |
| using | SegmentSet = DynSetTree< Segment, Treap_Rk, CmpSegment > |
| using | PointIt = DynList< Point >::Iterator |
Static Private Member Functions | |
| static bool | are_all_points_on_left (const DynList< Point > &l, const Segment &s) |
| Checks if all points in a list lie to the left of a segment. | |
| static SegmentSet | extreme_edges (const DynList< Point > &point_set) |
Brute force convex hull algorithm.
Computes the convex hull by testing all pairs of points to find extreme edges (edges where all other points are on one side).
For each pair of points (p, q): If all other points are to the left of segment (p, q), then (p, q) is an edge of the convex hull.
Definition at line 5064 of file geom_algorithms.H.
|
private |
Definition at line 5092 of file geom_algorithms.H.
Definition at line 5091 of file geom_algorithms.H.
|
inlinestaticprivate |
Checks if all points in a list lie to the left of a segment.
Definition at line 5097 of file geom_algorithms.H.
References Aleph::HTList::Iterator::has_curr(), and l.
Referenced by extreme_edges().
|
inlinestaticprivate |
Definition at line 5106 of file geom_algorithms.H.
References are_all_points_on_left(), Aleph::divide_and_conquer_partition_dp(), and Aleph::HTList::Iterator::has_curr().
Referenced by operator()().
Compute the convex hull of a point set.
| point_set | The input points. |
Definition at line 5136 of file geom_algorithms.H.
References ah_domain_error_if, Aleph::divide_and_conquer_partition_dp(), extreme_edges(), Aleph::Segment::get_src_point(), and Aleph::Segment::get_tgt_point().