Skip to content

Commit

Permalink
Corrected network dynamics example for issue CodeQL Analysis fails du…
Browse files Browse the repository at this point in the history
…e 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
  • Loading branch information
ZigRazor authored Dec 2, 2024
1 parent 3fe4aa3 commit f91ce5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ build/
# ignore the packaging folder contents from git
packaging/
# ignore vscode files
.vscode
.vscode
.code-workspace
CXXGraph.code-workspace
5 changes: 2 additions & 3 deletions examples/NetworkDynamicsExample/network_dynamics_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ int main() {
auto degreeMatrix = graph.getDegreeMatrix();
for (const auto& nodePair : *degreeMatrix) {
const CXXGraph::shared<const CXXGraph::Node<int>>& node = nodePair.first;
const std::vector<int>& degrees = nodePair.second;
const unsigned int degree = nodePair.second;

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

0 comments on commit f91ce5e

Please sign in to comment.