Fix graph volume V()
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user