[mlpack-git] master: Minor style fixes. (3ccd1bd)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:04:36 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

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

commit 3ccd1bd6cee8588d971f50ebe969866c37c9e357
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Dec 3 02:47:43 2014 +0000

    Minor style fixes.


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

3ccd1bd6cee8588d971f50ebe969866c37c9e357
 src/mlpack/tests/cosine_tree_test.cpp | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/mlpack/tests/cosine_tree_test.cpp b/src/mlpack/tests/cosine_tree_test.cpp
index 10447ba..2f44d7d 100644
--- a/src/mlpack/tests/cosine_tree_test.cpp
+++ b/src/mlpack/tests/cosine_tree_test.cpp
@@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(CosineNodeCosineSplit)
   nodeStack.push_back(&root);
 
   // While stack is not empty.
-  while(nodeStack.size())
+  while (nodeStack.size())
   {
     // Pop a node from the stack and split it.
     CosineTree *currentNode, *currentLeft, *currentRight;
@@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(CosineNodeCosineSplit)
     currentRight = currentNode->Right();
 
     // If children exist.
-    if(currentLeft && currentRight)
+    if (currentLeft && currentRight)
     {
       // Push the child nodes on to the stack.
       nodeStack.push_back(currentLeft);
@@ -97,28 +97,22 @@ BOOST_AUTO_TEST_CASE(CosineNodeCosineSplit)
       cosines.zeros(currentNode->NumColumns());
 
       size_t i, j, k;
-      for(i = 0; i < leftIndices.size(); i++)
-      {
+      for (i = 0; i < leftIndices.size(); i++)
         cosines(i) = arma::norm_dot(data.col(leftIndices[i]), splitPoint);
-      }
-      for(j = 0, k = i; j < rightIndices.size(); j++, k++)
-      {
+
+      for (j = 0, k = i; j < rightIndices.size(); j++, k++)
         cosines(k) = arma::norm_dot(data.col(rightIndices[j]), splitPoint);
-      }
 
       // Check if the columns assigned to the children agree with the splitting
       // condition.
       double cosineMax = arma::max(cosines % (cosines < 1));
       double cosineMin = arma::min(cosines);
 
-      for(i = 0; i < leftIndices.size(); i++)
-      {
+      for (i = 0; i < leftIndices.size(); i++)
         BOOST_CHECK_LT(cosineMax - cosines(i), cosines(i) - cosineMin);
-      }
-      for(j = 0, k = i; j < rightIndices.size(); j++, k++)
-      {
+
+      for (j = 0, k = i; j < rightIndices.size(); j++, k++)
         BOOST_CHECK_GT(cosineMax - cosines(k), cosines(k) - cosineMin);
-      }
     }
   }
 }



More information about the mlpack-git mailing list