|
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) |
| Finds the extreme edges of a point set (edges that form the convex hull). | |
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 5045 of file geom_algorithms.H.
|
private |
Definition at line 5073 of file geom_algorithms.H.
Definition at line 5072 of file geom_algorithms.H.
|
inlinestaticprivate |
Checks if all points in a list lie to the left of a segment.
Definition at line 5078 of file geom_algorithms.H.
References Aleph::HTList::Iterator::has_curr(), and l.
Referenced by extreme_edges().
|
inlinestaticprivate |
Finds the extreme edges of a point set (edges that form the convex hull).
| point_set | The input set of points. |
Definition at line 5093 of file geom_algorithms.H.
References are_all_points_on_left(), Aleph::blossom_maximum_cardinality_matching(), 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 5123 of file geom_algorithms.H.
References ah_domain_error_if, Aleph::blossom_maximum_cardinality_matching(), extreme_edges(), Aleph::Segment::get_src_point(), and Aleph::Segment::get_tgt_point().