MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / test_adjacency_list_create

Function test_adjacency_list_create

cpp/test/graph.cpp:36–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void test_adjacency_list_create()
37{
38 std::vector<std::int32_t> edges{1, 2, 0, 0, 1};
39 std::vector<std::int32_t> offsets{0, 2, 3, 5};
40 graph::AdjacencyList g0(edges, offsets);
41
42 CHECK(std::ranges::equal(g0.links(0), std::vector<std::int32_t>{1, 2}));
43 CHECK(std::ranges::equal(g0.links(1), std::vector<std::int32_t>{0}));
44 CHECK(std::ranges::equal(g0.links(2), std::vector<std::int32_t>{0, 1}));
45
46 std::vector<std::int64_t> node_data{-1, 5, -20};
47 graph::AdjacencyList g1(edges, offsets, node_data);
48 CHECK(std::ranges::equal(g1.node_data().value(), node_data));
49}
50
51void test_comm_graphs()
52{

Callers 1

graph.cppFile · 0.85

Calls 2

linksMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected