Fix graph volume V()

This commit is contained in:
stefiosif
2022-08-09 00:22:21 +03:00
parent 3f3c58b0b8
commit 4d189f269c
2 changed files with 3 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ Graph<T>::~Graph() {
template<typename T> template<typename T>
inline void Graph<T>::insert(const T& u, const T& v) { inline void Graph<T>::insert(const T& u, const T& v) {
Graph<T>::adjMatrix[u].insert(v); Graph<T>::adjMatrix[u].insert(v);
Graph<T>::adjMatrix[v];
} }
template<typename T> template<typename T>

View File

@@ -45,13 +45,13 @@ TEST_SUITE("Graph") {
CHECK_EQ(R, X); CHECK_EQ(R, X);
} }
TEST_CASE("Digraph::V and Digraph::E") { TEST_CASE("Graph::V and Graph::E") {
// 1 --> 2 --> 3 --> 1 // 1 --> 2 --> 3 --> 1
// 3 --> 4 --> 5 --> 3 // 3 --> 4 --> 5 --> 3
// 2 --> 6 --> 7 --> 8 --> 6 // 2 --> 6 --> 7 --> 8 --> 6
// 6 --> 9 --> 10 --> 11 --> 12 --> 13 --> 9 // 6 --> 9 --> 10 --> 11 --> 12 --> 13 --> 9
// 12 --> 10 // 12 --> 10
Digraph<std::uint16_t> G; Graph<std::uint16_t> G;
G.insert(1, 2); G.insert(1, 2);
G.insert(2, 3); G.insert(2, 3);
G.insert(3, 1); G.insert(3, 1);