9 #include <boost/test/unit_test.hpp>
16 #include <torch/torch.h>
19 std::vector<int64_t> &testGraph,
26 auto opts = torch::TensorOptions().dtype(torch::kInt64);
27 const auto edgeTensor =
28 torch::from_blob(testGraph.data(),
29 {
static_cast<long>(testGraph.size() / 2), 2},
opts)
34 const auto str = ss.str();
36 auto begin = str.begin() + str.find(
"Efficiency");
42 std::vector<int64_t> truthGraph = {
51 std::vector<int64_t> testGraph = {
67 std::vector<int64_t> truthGraph = {
74 std::transform(truthGraph.begin(), truthGraph.end(), truthGraph.begin(),
75 [&](auto i) { return k + i; });
78 std::vector<int64_t> testGraph = {
85 std::transform(testGraph.begin(), testGraph.end(), testGraph.begin(),
86 [&](auto i) { return k + i; });
88 testTruthTestGraph(truthGraph, testGraph, "Efficiency=1, purity=1");
91 BOOST_AUTO_TEST_CASE(fifty_fifty) {
93 std::vector<int64_t> truthGraph = {
102 std::vector<int64_t> testGraph = {
110 testTruthTestGraph(truthGraph, testGraph, "Efficiency=0.5, purity=0.5");