Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undefined behavior when parsing boolean options in DBSCAN benchmark #804

Merged
merged 1 commit into from
Dec 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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