[mlpack-git] mlpack-1.0.x: Fix some warnings. (770447e)

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


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

On branch  : mlpack-1.0.x
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

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

commit 770447e764a30ec62dc83e78f46754e4e66b360e
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Jul 28 17:37:54 2014 +0000

    Fix some warnings.


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

770447e764a30ec62dc83e78f46754e4e66b360e
 src/mlpack/methods/emst/dtb_impl.hpp              | 2 +-
 src/mlpack/methods/perceptron/perceptron_impl.hpp | 4 ++--
 src/mlpack/tests/emst_test.cpp                    | 3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/mlpack/methods/emst/dtb_impl.hpp b/src/mlpack/methods/emst/dtb_impl.hpp
index 2a257bc..7cab24d 100644
--- a/src/mlpack/methods/emst/dtb_impl.hpp
+++ b/src/mlpack/methods/emst/dtb_impl.hpp
@@ -268,7 +268,7 @@ void DualTreeBoruvka<MetricType, TreeType>::CleanupHelper(TreeType* tree)
 
   // Check components of points.
   for (size_t i = 0; i < tree->NumPoints(); ++i)
-    if (connections.Find(tree->Point(i)) != component)
+    if (connections.Find(tree->Point(i)) != int(component))
       return;
 
   // If we made it this far, all components are the same.
diff --git a/src/mlpack/methods/perceptron/perceptron_impl.hpp b/src/mlpack/methods/perceptron/perceptron_impl.hpp
index 8b3bd35..bfa1866 100644
--- a/src/mlpack/methods/perceptron/perceptron_impl.hpp
+++ b/src/mlpack/methods/perceptron/perceptron_impl.hpp
@@ -69,7 +69,7 @@ void Perceptron<LearnPolicy, WeightInitializationPolicy, MatType>::Classify(
   arma::mat tempLabelMat;
   arma::uword maxIndexRow, maxIndexCol;
 
-  for (int i = 0; i < test.n_cols; i++)
+  for (size_t i = 0; i < test.n_cols; i++)
   {
     tempLabelMat = weightVectors.submat(0, 1, weightVectors.n_rows - 1,
                                         weightVectors.n_cols - 1) * 
@@ -123,7 +123,7 @@ template<
 void Perceptron<LearnPolicy, WeightInitializationPolicy, MatType>::Train(
      const arma::rowvec& D)
 {
-  int j, i = 0;
+  size_t j, i = 0;
   bool converged = false;
   size_t tempLabel;
   arma::uword maxIndexRow, maxIndexCol;
diff --git a/src/mlpack/tests/emst_test.cpp b/src/mlpack/tests/emst_test.cpp
index a6f3742..d2b1750 100644
--- a/src/mlpack/tests/emst_test.cpp
+++ b/src/mlpack/tests/emst_test.cpp
@@ -259,8 +259,7 @@ BOOST_AUTO_TEST_CASE(BallTreeTest)
   // naive mode.
   DualTreeBoruvka<> bst(inputData, true);
   // Ball tree.
-  DualTreeBoruvka<EuclideanDistance,
-                  BinarySpaceTree<BallBound<>, DTBStat> > ballt(inputData);
+  DualTreeBoruvka<EuclideanDistance, TreeType> ballt(inputData);
 
   arma::mat bstResults;
   arma::mat ballResults;



More information about the mlpack-git mailing list