XNetwork 1.7.5; VERSION ${PROJECT_VERSION}
Loading...
Searching...
No Matches
testcases.hpp
Go to the documentation of this file.
1
9#pragma once
10#include <array>
12
26template <typename Container> inline auto create_test_case1(const Container& weights) {
27 using Edge = std::pair<uint32_t, uint32_t>;
28 constexpr uint32_t num_nodes = 5;
29 constexpr uint32_t A = 0;
30 constexpr uint32_t B = 1;
31 constexpr uint32_t C = 2;
32 constexpr uint32_t D = 3;
33 constexpr uint32_t E = 4;
34 const auto edges
35 = std::array<Edge, 5>{Edge{A, B}, Edge{B, C}, Edge{C, D}, Edge{D, E}, Edge{E, A}};
36 // constexpr auto weights = std::array<int, 5> {-5, 1, 1, 1, 1};
38 gra.add_edges_from(edges, weights);
39 return gra;
40}
41
54template <typename Container> inline auto create_test_case2(const Container& weights) {
55 using Edge = std::pair<uint32_t, uint32_t>;
56 constexpr uint32_t num_nodes = 3;
57 constexpr uint32_t A = 0;
58 constexpr uint32_t B = 1;
59 constexpr uint32_t C = 2;
60 const auto edges = std::array<Edge, 6>{Edge{A, B}, Edge{B, A}, Edge{B, C},
61 Edge{C, B}, Edge{C, A}, Edge{A, C}};
63 gra.add_edges_from(edges, weights);
64 return gra;
65}
66
80template <typename Container> inline auto create_test_case_timing(const Container& weights) {
81 using Edge = std::pair<uint32_t, uint32_t>;
82 constexpr uint32_t num_nodes = 3;
83 constexpr uint32_t A = 0;
84 constexpr uint32_t B = 1;
85 constexpr uint32_t C = 2;
86 const auto edges = std::array<Edge, 6>{Edge{A, B}, Edge{B, A}, Edge{B, C}, Edge{C, B},
87 Edge{C, A}, Edge{A, C}}; // no multiple edges
89 gra.add_edges_from(edges, weights);
90 return gra;
91}
Read-only map of maps of maps (view into a dict-of-dict-of-dict structure)
Definition coreviews.hpp:109
Directed graph data structure for XNetwork.
auto create_test_case2(const Container &weights)
Create a test case with 3 nodes and bidirectional connections.
Definition testcases.hpp:54
auto create_test_case_timing(const Container &weights)
Create a timing test case with 3 nodes and bidirectional connections.
Definition testcases.hpp:80
auto create_test_case1(const Container &weights)
Create a test case with 5 nodes and 5 edges forming a cycle.
Definition testcases.hpp:26