[mlpack-git] master: Fix invalid memory access. (96bcad5)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 12 16:01:49 EDT 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/eddd7167d69b6c88b271ef2e51d1c20e13f1acd8...70342dd8e5c17e0c164cfb8189748671e9c0dd44

>---------------------------------------------------------------

commit 96bcad550d3bcaa401cf9447413f22693d1c7afe
Author: Ryan Curtin <ryan at ratml.org>
Date:   Tue Jan 20 17:28:22 2015 -0500

    Fix invalid memory access.


>---------------------------------------------------------------

96bcad550d3bcaa401cf9447413f22693d1c7afe
 src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp
index ed51137..068a74f 100644
--- a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp
+++ b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp
@@ -146,8 +146,8 @@ void DualTreeKMeans<MetricType, MatType, TreeType>::ClusterTreeUpdate(
   }
   for (size_t i = 0; i < node->NumPoints(); ++i)
   {
-    if (distances(1, node->Point(i)) > firstBound)
-      firstBound = distances(1, node->Point(i));
+    if (distances(0, node->Point(i)) > firstBound)
+      firstBound = distances(0, node->Point(i));
   }
 
   node->Stat().FirstBound() = firstBound;



More information about the mlpack-git mailing list