[mlpack] 149/324: clang complains when default parameters aren't part of the original declaration. Also vim removes trailing whitespaces, so this diff looks way longer and more complex than it actually is...

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:22:05 UTC 2014


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

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit 9045a552f3f0be5cc3fc5fb82d8b4cba57a15c00
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Tue Jul 8 17:42:46 2014 +0000

    clang complains when default parameters aren't part of the original declaration.
    Also vim removes trailing whitespaces, so this diff looks way longer and more
    complex than it actually is...
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16788 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 .../core/tree/rectangle_tree/rectangle_tree.hpp    | 36 +++++++++++-----------
 .../tree/rectangle_tree/rectangle_tree_impl.hpp    | 30 +++++++++---------
 2 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp b/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp
index e50d372..550cf74 100644
--- a/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp
+++ b/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp
@@ -16,7 +16,7 @@ namespace mlpack {
 namespace tree /** Trees and tree-building procedures. */ {
 
 using bound::HRectBound;
-  
+
 /**
  * A rectangle type tree tree, such as an R-tree or X-tree.  Once the
  * bound and type of dataset is defined, the tree will construct itself.  Call
@@ -31,7 +31,7 @@ using bound::HRectBound;
  * @tparam MatType The dataset class.
  * @tparam SplitType The type of split to use when inserting points.
  * @tparam DescentType The heuristic to use when descending the tree to insert points.
- */   
+ */
 
 template<typename SplitType,
 	 typename DescentType,
@@ -56,7 +56,7 @@ class RectangleTree
   //! REMOVED.
   size_t begin;
   //! The number of points in the dataset contained in this node (and its
-  //! children).  
+  //! children).
   size_t count;
   //! The max leaf size.
   size_t maxLeafSize;
@@ -74,7 +74,7 @@ class RectangleTree
   MatType& dataset;
   //! The mapping to the dataset
   std::vector<size_t> points;
-  
+
  public:
   //! So other classes can use TreeType::Mat.
   typedef MatType Mat;
@@ -96,17 +96,17 @@ class RectangleTree
    * @param minLeafSize Minimum size of each leaf in the tree.
    * @param maxNumChildren The maximum number of child nodes a non-leaf node may have.
    * @param minNumChildren The minimum number of child nodes a non-leaf node may have.
-   * @param firstDataIndex The index of the first data point.  UNUSED UNLESS WE ADD SUPPORT FOR HAVING A 
+   * @param firstDataIndex The index of the first data point.  UNUSED UNLESS WE ADD SUPPORT FOR HAVING A
    * "CENTERAL" DATA MATRIX.
    */
   RectangleTree(MatType& data,
-		const size_t maxLeafSize,
-		const size_t minLeafSize,
-		const size_t maxNumChildren,
-		const size_t minNumChildren,
-		const size_t firstDataIndex
+		const size_t maxLeafSize = 20,
+		const size_t minLeafSize = 6,
+		const size_t maxNumChildren = 4,
+		const size_t minNumChildren = 0,
+		const size_t firstDataIndex = 0
  	      );
-  
+
   /**
    * Construct this as an empty node with the specified parent.  Copying the parameters
    * (maxLeafSize, minLeafSize, maxNumChildren, minNumChildren, firstDataIndex) from the parent.
@@ -124,14 +124,14 @@ class RectangleTree
    * to any nodes which are children of this one.
    */
   ~RectangleTree();
-  
+
   /**
    * Delete this node of the tree, but leave the stuff contained in it intact.
    * This is used when splitting a node, where the data in this tree is moved to two
    * other trees.
    */
   void softDelete();
-  
+
   /**
    * Set dataset to null. Used for memory management.  Be cafeful.
    */
@@ -152,7 +152,7 @@ class RectangleTree
    * (ie. the point is not in the tree)
    */
   bool DeletePoint(const size_t point);
-  
+
   /**
    * Find a node in this tree by its begin and count (const).
    *
@@ -221,12 +221,12 @@ class RectangleTree
   const arma::mat& Dataset() const { return dataset; }
   //! Modify the dataset which the tree is built on.  Be careful!
   arma::mat& Dataset() { return dataset; }
-  
+
   //! Get the points vector for this node.
   const std::vector<size_t>& Points() const { return points; }
   //! Modify the points vector for this node.  Be careful!
   std::vector<size_t>& Points() { return points; }
-  
+
   //! Get the metric which the tree uses.
   typename HRectBound<>::MetricType Metric() const { return bound.Metric(); }
 
@@ -276,7 +276,7 @@ class RectangleTree
   {
     return children[child];
   }
-  
+
   /**
    * Modify the specified child.
     *
@@ -287,7 +287,7 @@ class RectangleTree
   {
     return children[child];
   }
-  
+
   //! Return the number of points in this node (returns 0 if this node is not a leaf).
   size_t NumPoints() const;
 
diff --git a/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp b/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp
index d1ed3e2..ad6f038 100644
--- a/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp
+++ b/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp
@@ -23,11 +23,11 @@ template<typename SplitType,
          typename MatType>
 RectangleTree<SplitType, DescentType, StatisticType, MatType>::RectangleTree(
     MatType& data,
-    const size_t maxLeafSize = 20,
-    const size_t minLeafSize = 6,
-    const size_t maxNumChildren = 4,
-    const size_t minNumChildren = 0,
-    const size_t firstDataIndex = 0):
+    const size_t maxLeafSize,
+    const size_t minLeafSize,
+    const size_t maxNumChildren,
+    const size_t minNumChildren,
+    const size_t firstDataIndex):
     maxNumChildren(maxNumChildren),
     minNumChildren(minNumChildren),
     numChildren(0),
@@ -43,10 +43,10 @@ RectangleTree<SplitType, DescentType, StatisticType, MatType>::RectangleTree(
     points(maxLeafSize+1) // Add one to make splitting the node simpler.
 {
   stat = StatisticType(*this);
-  
+
   // For now, just insert the points in order.
   RectangleTree* root = this;
-  
+
   //for(int i = firstDataIndex; i < 57; i++) { // 56,57 are the bound for where it works/breaks
   for(size_t i = firstDataIndex; i < data.n_cols; i++) {
     root->InsertPoint(i);
@@ -97,7 +97,7 @@ RectangleTree<SplitType, DescentType, StatisticType, MatType>::
 
 
 /**
-  * Deletes this node but leaves the children untouched.  Needed for when we 
+  * Deletes this node but leaves the children untouched.  Needed for when we
   * split nodes and remove nodes (inserting and deleting points).
   */
 template<typename SplitType,
@@ -111,10 +111,10 @@ void RectangleTree<SplitType, DescentType, StatisticType, MatType>::
     //dataset = NULL;
   parent = NULL;
   for(int i = 0; i < children.size(); i++) {
-    children[i] = NULL;    
+    children[i] = NULL;
   }
   numChildren = 0;
-  delete this;  
+  delete this;
 }
 
 /**
@@ -156,7 +156,7 @@ void RectangleTree<SplitType, DescentType, StatisticType, MatType>::
   // to which we recurse.
   double minScore = DescentType::EvalNode(children[0]->Bound(), dataset.col(point));
   int bestIndex = 0;
-  
+
   for(int i = 1; i < numChildren; i++) {
     double score = DescentType::EvalNode(children[i]->Bound(), dataset.col(point));
     if(score < minScore) {
@@ -212,12 +212,12 @@ bool RectangleTree<SplitType, DescentType, StatisticType, MatType>::
       for(int i = 0; i < numChildren; i++) {
 	if(children[i].Bound().Contains(dataset.col(point))) {
 	  if(children[i].DeletePoint(dataset.col(point))) {
-	    
+
 	    return true;
 	  }
 	}
       }
-  } 
+  }
   return false;
 }
 
@@ -244,7 +244,7 @@ template<typename SplitType,
 size_t RectangleTree<SplitType, DescentType, StatisticType, MatType>::
     TreeDepth() const
 {
-  /* Because R trees are balanced, we could simplify this.  However, X trees are not 
+  /* Because R trees are balanced, we could simplify this.  However, X trees are not
      guaranteed to be balanced so I keep it as is: */
 
   // Recursively count the depth of each subtree.  The plus one is
@@ -401,7 +401,7 @@ void RectangleTree<SplitType, DescentType, StatisticType, MatType>::SplitNode()
   // Check to see if we are full.
   if(count < maxLeafSize)
     return; // We don't need to split.
-  
+
   // If we are full, then we need to split (or at least try).  The SplitType takes
   // care of this and of moving up the tree if necessary.
   SplitType::SplitLeafNode(this);

-- 
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