35#ifndef TESTS_R_TREE_DEBUG_SNAPSHOT_TEST_HELPERS_H
36#define TESTS_R_TREE_DEBUG_SNAPSHOT_TEST_HELPERS_H
38#include <gtest/gtest.h>
62 template <
typename Snapshot>
66 if (idx >=
snap.nodes.size())
68 ADD_FAILURE() <<
"node index " << idx <<
" out of range (nodes.size() = "
69 <<
snap.nodes.size() <<
")";
74 ADD_FAILURE() <<
"cycle detected: node index " << idx <<
" reached more than once";
79 const auto &node =
snap.nodes(idx);
85 if (node.entry_boxes.is_empty())
88 for (
size_t i = 1; i < node.entry_boxes.size(); ++i)
91 return node.entry_boxes.size();
95 if (node.children.is_empty())
98 if (node.children(0) >=
snap.nodes.size())
102 for (
size_t i = 1; i < node.children.size(); ++i)
105 if (node.children(i) >=
snap.nodes.size())
142 template <
typename Snapshot>
Simple dynamic array with automatic resizing and functional operations.
An axis-aligned rectangle.
const Geom_Number & get_xmin() const
Gets the minimum x-coordinate.
const Geom_Number & get_ymax() const
Gets the maximum y-coordinate.
const Geom_Number & get_ymin() const
Gets the minimum y-coordinate.
const Geom_Number & get_xmax() const
Gets the maximum x-coordinate.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
size_t check_snapshot_node_impl(const Snapshot &snap, const size_t idx, const size_t expected_depth, Array< bool > &visited)
Rectangle union_of(const Rectangle &a, const Rectangle &b)
Computes the tight axis-aligned union of two rectangles.
size_t check_snapshot_node(const Snapshot &snap, const size_t idx, const size_t expected_depth)
Recursively validates the structural invariants of a DebugSnapshot produced by RTree::debug_snapshot(...
2D point and geometric utilities.
Dynamic array container with automatic resizing.