Skip to content

Commit

Permalink
Merge pull request #804 from dalg24/bool_switch_default_value
Browse files Browse the repository at this point in the history
Fix undefined behavior when parsing boolean options in DBSCAN benchmark
  • Loading branch information
dalg24 authored Dec 28, 2022
2 parents 6936c9f + d64f232 commit 4b17922
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benchmarks/dbscan/dbscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int main(int argc, char *argv[])
desc.add_options()
( "help", "help message" )
( "algorithm", bpo::value<std::string>(&params.algorithm)->default_value("dbscan"), "algorithm (dbscan | hdbscan | mst)" )
( "binary", bpo::bool_switch(&params.binary)->default_value(false), "binary file indicator")
( "binary", bpo::bool_switch(&params.binary), "binary file indicator")
( "cluster-min-size", bpo::value<int>(&params.cluster_min_size)->default_value(1), "minimum cluster size")
( "core-min-size", bpo::value<int>(&params.core_min_size)->default_value(2), "DBSCAN min_pts")
( "dimension", bpo::value<int>(&dim)->default_value(3), "dimension of points to generate" )
Expand All @@ -79,9 +79,9 @@ int main(int argc, char *argv[])
( "max-num-points", bpo::value<int>(&params.max_num_points)->default_value(-1), "max number of points to read in")
( "n", bpo::value<int>(&params.n)->default_value(10), "number of points to generate" )
( "samples", bpo::value<int>(&params.num_samples)->default_value(-1), "number of samples" )
( "variable-density", bpo::bool_switch(&params.variable_density)->default_value(false), "type of cluster density to generate" )
( "verbose", bpo::bool_switch(&params.verbose)->default_value(false), "verbose")
( "verify", bpo::bool_switch(&params.verify)->default_value(false), "verify connected components")
( "variable-density", bpo::bool_switch(&params.variable_density), "type of cluster density to generate" )
( "verbose", bpo::bool_switch(&params.verbose), "verbose")
( "verify", bpo::bool_switch(&params.verify), "verify connected components")
;
// clang-format on
bpo::variables_map vm;
Expand Down

0 comments on commit 4b17922

Please sign in to comment.