Skip to content

Commit

Permalink
fixing CLI for edge and vertex weights; fixing error message for edge…
Browse files Browse the repository at this point in the history
…/vertex weight range checks (#47)
  • Loading branch information
jabo17 authored Jul 23, 2024
1 parent ec1e7ae commit 7f8a9f8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/KaGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ This is mostly useful for experimental graph generators or when using KaGen to l
"--edgeweights-range-begin", config.edge_weights.weight_range_begin,
"(Included) begin of weight range used for edge weights, i.e., minimum edge weight.");
app.add_option(
"--edgeweights-range-end", config.edge_weights.weight_range_begin,
"--edgeweights-range-end", config.edge_weights.weight_range_end,
"(Excluded) end of weight range to be used for edge weights.");

// Vertex weight generator parameters
Expand All @@ -190,7 +190,7 @@ This is mostly useful for experimental graph generators or when using KaGen to l
"--vertexweights-range-begin", config.vertex_weights.weight_range_begin,
"(Included) begin of weight range used for vertex weights, i.e., minimum vertex weight.");
app.add_option(
"--vertexweights-range-end", config.vertex_weights.weight_range_begin,
"--vertexweights-range-end", config.vertex_weights.weight_range_end,
"(Excluded) end of weight range to be used for vertex weights.");

{ // Options string
Expand Down
2 changes: 1 addition & 1 deletion kagen/edgeweight_generators/uniform_random_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ UniformRandomEdgeWeightGenerator::UniformRandomEdgeWeightGenerator(
comm_(comm),
vertex_range_(vertex_range) {
if (config_.weight_range_begin >= config_.weight_range_end) {
throw std::runtime_error("Weight causes undefined behavior, need weight_range_begin > weight_range_end.");
throw std::runtime_error("Weight causes undefined behavior, need weight_range_begin < weight_range_end.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion kagen/vertexweight_generators/uniform_random_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ UniformRandomVertexWeightGenerator::UniformRandomVertexWeightGenerator(VertexWei
: config_(config),
comm_{comm} {
if (config_.weight_range_begin >= config_.weight_range_end) {
throw std::runtime_error("Weight causes undefined behavior, need weight_range_begin > weight_range_end.");
throw std::runtime_error("Weight causes undefined behavior, need weight_range_begin < weight_range_end.");
}
}

Expand Down

0 comments on commit 7f8a9f8

Please sign in to comment.