Skip to content

Commit f91ce5e

Browse files
authored
Corrected network dynamics example for issue CodeQL Analysis fails due to a compilation error on example #474 (#477)
* Corrected network dynamics example for issue CodeQL Analysis fails due to a compilation error on example #474 * updated gitignore
1 parent 3fe4aa3 commit f91ce5e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ build/
3636
# ignore the packaging folder contents from git
3737
packaging/
3838
# ignore vscode files
39-
.vscode
39+
.vscode
40+
.code-workspace
41+
CXXGraph.code-workspace

examples/NetworkDynamicsExample/network_dynamics_example.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ int main() {
2626
auto degreeMatrix = graph.getDegreeMatrix();
2727
for (const auto& nodePair : *degreeMatrix) {
2828
const CXXGraph::shared<const CXXGraph::Node<int>>& node = nodePair.first;
29-
const std::vector<int>& degrees = nodePair.second;
29+
const unsigned int degree = nodePair.second;
3030

31-
std::cout << "Node: " << node->getId() << ", Degree: " << degrees[0]
32-
<< "\n";
31+
std::cout << "Node: " << node->getId() << ", Degree: " << degree << "\n";
3332
}
3433
auto laplacianMatrix = graph.getLaplacianMatrix();
3534
for (const auto& nodePair : *laplacianMatrix) {

0 commit comments

Comments
 (0)