[mlpack-git] master: Fix simple errors. (7aaf969)

gitdub at mlpack.org gitdub at mlpack.org
Thu Aug 18 13:39:55 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/0f4b25acd6aaa14294c044874ba6cc0751712baa...0a19d07bd39e6223991976474bc79671ba8aa0f0

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

commit 7aaf9699cdc016f31d4b0088942593ea47c157b0
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Fri Jul 8 10:12:08 2016 -0300

    Fix simple errors.


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

7aaf9699cdc016f31d4b0088942593ea47c157b0
 src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp b/src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp
index 25c83aa..50f7be9 100644
--- a/src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp
+++ b/src/mlpack/core/tree/spill_tree/spill_tree_impl.hpp
@@ -38,8 +38,8 @@ SpillTree(
     dataset(new MatType(data)) // Copies the dataset.
 {
   std::vector<size_t> points;
-  points.reserve(data.n_cols);
-  for(size_t i=0; i < data.n_cols; i++)
+  points.reserve(dataset->n_cols);
+  for(size_t i=0; i < dataset->n_cols; i++)
     points.push_back(i);
 
   // Do the actual splitting of this node.
@@ -72,8 +72,8 @@ SpillTree(
     dataset(new MatType(std::move(data)))
 {
   std::vector<size_t> points;
-  points.reserve(data.n_cols);
-  for(size_t i=0; i < data.n_cols; i++)
+  points.reserve(dataset->n_cols);
+  for(size_t i=0; i < dataset->n_cols; i++)
     points.push_back(i);
 
   // Do the actual splitting of this node.
@@ -411,7 +411,7 @@ inline size_t SpillTree<MetricType, StatisticType, MatType, BoundType,
     SplitType>::Descendant(const size_t index) const
 {
   if (IsLeaf())
-    return pointsIndex[index];
+    return (*pointsIndex)[index];
   size_t num = left->NumDescendants();
   if (index < num)
     return left->Descendant(index);
@@ -434,7 +434,7 @@ inline size_t SpillTree<MetricType, StatisticType, MatType, BoundType,
     SplitType>::Point(const size_t index) const
 {
   if (IsLeaf())
-    return pointsIndex[index];
+    return (*pointsIndex)[index];
   // This should never happen.
   return (size_t() - 1);
 }
@@ -472,7 +472,7 @@ void SpillTree<MetricType, StatisticType, MatType, BoundType, SplitType>::
   size_t splitDimension;
   double splitVal;
   const bool split = SplitType<BoundType<MetricType>, MatType>::SplitNode(
-      bound, *dataset, splitDimension, splitVal);
+      bound, *dataset, points, splitDimension, splitVal);
   // The node may not be always split. For instance, if all the points are the
   // same, we can't split them.
   if (!split)




More information about the mlpack-git mailing list