6#include <gtest/gtest.h>
265 Point p1(10.0, 20.0);
266 Point p2(30.0, 40.0);
283 Point search_point(99.0, 99.0);
306 auto n2 =
g1.insert_node(
Point(1.0, 1.0));
307 g1.insert_arc(n1, n2);
323 auto n2 =
g1.insert_node(
Point(5.0, 5.0));
324 g1.insert_arc(n1, n2);
398 const size_t n = 1000;
400 for (
size_t i = 0; i < n; ++i)
402 double x =
static_cast<double>(i);
403 double y =
static_cast<double>(i * 2);
413 const size_t n = 100;
415 std::vector<ENode*>
nodes;
416 for (
size_t i = 0; i < n; ++i)
422 for (
size_t i = 0; i < n; ++i)
424 for (
size_t j = i + 1; j < n; ++j)
Geom_Number get_distance(Arc *arc)
Node * insert_node(Node *node) noexcept override
Insertion of a node already allocated.
Node * search_node(const Point &)
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
Represents a point with rectangular coordinates in a 2D plane.
const Geom_Number & get_x() const noexcept
Gets the x-coordinate value.
const Geom_Number & get_y() const noexcept
Gets the y-coordinate value.
ArcInfo & get_info() noexcept
Return a modifiable reference to the arc data.
NodeInfo & get_info() noexcept
Return a modifiable reference to the data contained in the node.
Node * get_src_node(Arc *arc) const noexcept
Return the source node of arc (only for directed graphs)
constexpr size_t get_num_nodes() const noexcept
Return the total of nodes of graph.
bool is_digraph() const noexcept
Return true if the graph this is directed.
constexpr size_t get_num_arcs() const noexcept
Node * get_tgt_node(Arc *arc) const noexcept
Return the target node of arc (only for directed graphs)
TEST_F(EuclidianGraphTest, NodeDefaultConstructor)
DynArray< Graph::Node * > nodes
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
2D point and geometric utilities.
Euclidean graph with 2D coordinates.