Skip to content

Commit

Permalink
Properly resize edge_weights vector when using CSR representation. (#48)
Browse files Browse the repository at this point in the history
* Properly resize edge_weights vector when using CSR representation.

* Also fix it for vertex weights.
  • Loading branch information
niklas-uhl authored Sep 12, 2024
1 parent 7f8a9f8 commit 6cdeb60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kagen/generators/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void Generator::GenerateEdgeWeights(EdgeWeightConfig weight_config, MPI_Comm com
edge_weight_generator->GenerateEdgeWeights(graph_.edges, graph_.edge_weights);
break;
case GraphRepresentation::CSR:
if (!graph_.xadj.empty()) {
if (!graph_.edges.empty()) {
edge_weight_generator->GenerateEdgeWeights(graph_.edges, graph_.edge_weights);
} else {
// for generated graph edgelist format is used for construction and then transformed to CSR only in the
Expand Down Expand Up @@ -113,7 +113,7 @@ void Generator::GenerateVertexWeights(VertexWeightConfig weight_config, MPI_Comm
vertex_weight_generator->GenerateVertexWeights(graph_.vertex_range, graph_.edges, graph_.vertex_weights);
break;
case GraphRepresentation::CSR:
if (!graph_.xadj.empty()) {
if (!graph_.edges.empty()) {
vertex_weight_generator->GenerateVertexWeights(
graph_.vertex_range, graph_.edges, graph_.vertex_weights);
} else {
Expand Down

0 comments on commit 6cdeb60

Please sign in to comment.