[mlpack] 69/207: Initialize bitset correctly, to all 1s.

Barak A. Pearlmutter barak+git at pearlmutter.net
Thu Mar 23 17:53:41 UTC 2017


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch master
in repository mlpack.

commit 63f3eb901bf6e793ddfe054469e314439007f27e
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Aug 3 17:53:53 2016 -0400

    Initialize bitset correctly, to all 1s.
---
 src/mlpack/methods/dbscan/dbscan_impl.hpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mlpack/methods/dbscan/dbscan_impl.hpp b/src/mlpack/methods/dbscan/dbscan_impl.hpp
index e14a127..f701864 100644
--- a/src/mlpack/methods/dbscan/dbscan_impl.hpp
+++ b/src/mlpack/methods/dbscan/dbscan_impl.hpp
@@ -84,7 +84,8 @@ size_t DBSCAN<RangeSearchType, PointSelectionPolicy>::Cluster(
   rangeSearch.Search(data, math::Range(0.0, epsilon), neighbors, distances);
 
   // Initialize to all true; false means it's been visited.
-  boost::dynamic_bitset<> unvisited(data.n_cols, 1);
+  boost::dynamic_bitset<> unvisited(data.n_cols);
+  unvisited.set();
   while (unvisited.any())
   {
     const size_t nextIndex = pointSelector.Select(unvisited, data);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list