#include "WireCellUtil/IndexedGraph.h"
#include "WireCellUtil/Testing.h"
#include <boost/graph/graphviz.hpp>
Go to the source code of this file.
typedef std::shared_ptr<float> fptr_t |
typedef std::shared_ptr<int> iptr_t |
Definition at line 45 of file test_indexedgraph.cxx.
49 std::unordered_map<if_t, int> p2i;
53 if_t one = std::make_shared<int>(42);
54 if_t two = std::make_shared<float>(6.9);
55 if_t tre = std::make_shared<float>(33);
63 Assert(*std::get<1>(two) < *std::get<1>(tre));
65 Assert(*std::get<0>(one) == 42);
66 Assert(
nullptr == std::get_if<1>(&one));
73 auto v1 =
g.vertex(one);
74 auto v2 =
g.vertex(one);
80 auto verts = boost::vertices(
g.graph());
81 Assert(verts.second-verts.first == 3);
85 indexed_graph_t
g2(
g.graph());
87 for (
auto n :
g2.neighbors(two)) {
93 std::vector<std::string> names{
"one",
"two",
"tre"};
94 std::unordered_map<indexed_graph_t::vdesc_t, std::string> ids;
95 for (
auto u : boost::make_iterator_range(vertices(
g2.graph()))) {
96 ids[u] = names[ids.size()];
98 boost::default_writer
w;
99 boost::write_graphviz(std::cout,
102 boost::make_assoc_property_map(ids));
std::variant< iptr_t, fptr_t > if_t