[mlpack-git] master: Fix typo/bug and memory leak. (322deab)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Tue May 12 14:24:00 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/8fce9086d19a6cb228302f068920ce876035890c...322deab1ff056e33d4e6aea5f4d0ef9a5b62ab4c

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

commit 322deab1ff056e33d4e6aea5f4d0ef9a5b62ab4c
Author: Ryan Cirtin <ryan at ratml.org>
Date:   Tue May 12 14:23:44 2015 -0400

    Fix typo/bug and memory leak.


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

322deab1ff056e33d4e6aea5f4d0ef9a5b62ab4c
 src/mlpack/core/tree/binary_space_tree/mean_split_impl.hpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mlpack/core/tree/binary_space_tree/mean_split_impl.hpp b/src/mlpack/core/tree/binary_space_tree/mean_split_impl.hpp
index be6ba14..cdaf727 100644
--- a/src/mlpack/core/tree/binary_space_tree/mean_split_impl.hpp
+++ b/src/mlpack/core/tree/binary_space_tree/mean_split_impl.hpp
@@ -136,7 +136,7 @@ bool MeanSplit<BoundType, MatType>::SplitNode(const BoundType& bound,
     // Now, which is the widest?
     for (size_t d = 0; d < data.n_rows; d++)
     {
-      const double width = bound[d].Width();
+      const double width = ranges[d].Width();
 
       if (width > maxWidth)
       {
@@ -144,6 +144,8 @@ bool MeanSplit<BoundType, MatType>::SplitNode(const BoundType& bound,
         splitDimension = d;
       }
     }
+
+    delete[] ranges;
   }
 
   if (maxWidth == 0) // All these points are the same.  We can't split.



More information about the mlpack-git mailing list