From d28c527337d237ccc07384cb920bd8fe69cdc310 Mon Sep 17 00:00:00 2001 From: wrcorcoran Date: Wed, 25 Sep 2024 20:37:35 -0700 Subject: [PATCH] small changes --- include/CXXGraph/Graph/Algorithm/Pow_impl.hpp | 5 ++--- test/PowTest.cpp | 15 --------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/include/CXXGraph/Graph/Algorithm/Pow_impl.hpp b/include/CXXGraph/Graph/Algorithm/Pow_impl.hpp index 2e9c5c9a..ade2fe71 100644 --- a/include/CXXGraph/Graph/Algorithm/Pow_impl.hpp +++ b/include/CXXGraph/Graph/Algorithm/Pow_impl.hpp @@ -48,9 +48,8 @@ std::vector> matMult(std::vector> &a, template std::vector> exponentiation(std::vector> &mat, unsigned int k) { - // typechecking static_assert(std::is_arithmetic::value, - "Type T must be either unsigned long long or double"); + "Type T must be any artithmetic type"); int n = static_cast(mat.size()); std::vector> res(n, std::vector(n, 0)); @@ -58,7 +57,7 @@ std::vector> exponentiation(std::vector> &mat, // build identity matrix for (int i = 0; i < n; i++) res[i][i] = 1; - // fast exponentation! + // fast exponentiation! while (k) { if (k & 1) res = matMult(res, mat); mat = matMult(mat, mat); diff --git a/test/PowTest.cpp b/test/PowTest.cpp index 9a49819d..bf81bf26 100644 --- a/test/PowTest.cpp +++ b/test/PowTest.cpp @@ -68,21 +68,6 @@ TEST(PowAdjTest, triangle) { auto res = matrixPow(graph.getAdjMatrix(), 5); - std::cout << "HERE" << std::endl; - - for (const auto &[node, edges] : *graph.getAdjMatrix()) { - for (const auto &e : edges) { - const auto edge = e.second->getNodePair(); - const auto firstId = edge.first->getUserId(); - const auto secondId = edge.second->getUserId(); - - std::cout << firstId << " " << secondId << std::endl; - } - } - for (const auto &[nodes, value] : res.result) { - std::cout << value << std::endl; - } - ASSERT_TRUE(res.success); ASSERT_TRUE(res.result[std::make_pair("a", "a")] == 10); ASSERT_TRUE(res.result[std::make_pair("b", "b")] == 10);