56 cout <<
"Aleph-w RTree Example" <<
endl;
57 cout <<
"=====================" <<
endl;
62 map.
insert(
box(0, 0, 10, 10),
"downtown");
64 map.
insert(
box(30, 30, 40, 40),
"airport");
65 map.
insert(
box(5, 5, 6, 6),
"central-park");
67 cout <<
"Indexed " << map.
size() <<
" regions, tree height "
71 cout <<
"Regions intersecting (7,7)-(9,9):";
73 [](
const Rectangle &,
const string &name) { cout <<
' ' << name; });
78 cout <<
"Region(s) containing point (35,35):";
79 for (
size_t i = 0; i <
here.size(); ++i)
80 cout <<
' ' <<
here(i);
94 cout <<
"After removing 'airport': " << map.
size()
95 <<
" regions, all invariants valid." <<
endl;
102 rstar.insert(
box(8, 8, 20, 20),
"b");
103 rstar.insert(
box(30, 30, 40, 40),
"c");
106 cout <<
"RStarTree indexed " <<
rstar.size()
107 <<
" regions with the same API." <<
endl;
Simple dynamic array with automatic resizing and functional operations.
Represents a point with rectangular coordinates in a 2D plane.
Dynamic R-tree indexing axis-aligned rectangles by payload.
void insert(const Rectangle &bbox, const Payload &value)
Insert a (bbox, value) entry, copying value.
bool erase(const Rectangle &bbox, const Payload &value)
Remove one entry equal to (bbox, value).
size_t height() const noexcept
Return the number of node levels (0 when empty, 1 for a lone leaf).
Array< Payload > search_intersects(const Rectangle &rect) const
Return the payloads of every entry whose bbox intersects rect.
Array< Payload > search_contains(const Point &p) const
Return the payloads of every entry whose bbox contains p.
size_t size() const noexcept
Return the number of stored entries.
void for_each_intersecting(const Rectangle &rect, F &&f) const
Invoke f for every entry whose bbox intersects rect.
bool verify() const
Verify the R-tree structural invariants.
An axis-aligned rectangle.
__gmp_expr< T, __gmp_unary_expr< __gmp_expr< T, U >, __gmp_y1_function > > y1(const __gmp_expr< T, U > &expr)
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
size_t size(Node *root) noexcept
mpq_class Geom_Number
Numeric type used by the geometry module.
static Rectangle box(const int x1, const int y1, const int x2, const int y2)
R*-tree: an R-tree tuned with the Beckmann-Kriegel-Schneider-Seeger heuristics.
Dynamic R-tree spatial index over axis-aligned rectangles.