[mlpack] 21/37: Fix some warnings.

Barak A. Pearlmutter barak+git at pearlmutter.net
Mon Feb 15 19:35:48 UTC 2016


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

bap pushed a commit to tag mlpack-1.0.10
in repository mlpack.

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

    Fix some warnings.
---
 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;

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