diff --git a/src/mlpack/core/util/sfinae_utility.hpp b/src/mlpack/core/util/sfinae_utility.hpp index 338d8c849c..dd19bdf47d 100644 --- a/src/mlpack/core/util/sfinae_utility.hpp +++ b/src/mlpack/core/util/sfinae_utility.hpp @@ -203,10 +203,10 @@ struct NAME \ static typename \ std::enable_if::value, \ int>::type \ - f(int t) { return 1;} \ + f(int) { return 1;} \ \ template \ - static char f(char t) { return 0; } \ + static char f(char) { return 0; } \ \ static const bool value = sizeof(f(0)) != sizeof(char); \ }; diff --git a/src/mlpack/methods/amf/update_rules/svd_complete_incremental_learning.hpp b/src/mlpack/methods/amf/update_rules/svd_complete_incremental_learning.hpp index 22174a0f7c..25c935cd13 100644 --- a/src/mlpack/methods/amf/update_rules/svd_complete_incremental_learning.hpp +++ b/src/mlpack/methods/amf/update_rules/svd_complete_incremental_learning.hpp @@ -203,7 +203,8 @@ class SVDCompleteIncrementalLearning arma::mat& W, const arma::mat& H) { - if (!isStart) (*it)++; + if (!isStart) + ++(*it); else isStart = false; if (*it == V.end()) @@ -234,12 +235,10 @@ class SVDCompleteIncrementalLearning * @param W Basis matrix. * @param H Encoding matrix to be updated. */ - inline void HUpdate(const arma::sp_mat& V, + inline void HUpdate(const arma::sp_mat& /* V */, const arma::mat& W, arma::mat& H) { - (void)V; - arma::mat deltaH(H.n_rows, 1); deltaH.zeros(); diff --git a/src/mlpack/methods/amf/update_rules/svd_incomplete_incremental_learning.hpp b/src/mlpack/methods/amf/update_rules/svd_incomplete_incremental_learning.hpp index ce5c26f99c..95467c4b10 100644 --- a/src/mlpack/methods/amf/update_rules/svd_incomplete_incremental_learning.hpp +++ b/src/mlpack/methods/amf/update_rules/svd_incomplete_incremental_learning.hpp @@ -169,7 +169,7 @@ inline void SVDIncompleteIncrementalLearning::WUpdate( arma::mat deltaW(V.n_rows, W.n_cols); deltaW.zeros(); for (arma::sp_mat::const_iterator it = V.begin_col(currentUserIndex); - it != V.end_col(currentUserIndex); it++) + it != V.end_col(currentUserIndex); ++it) { double val = *it; size_t i = it.row(); @@ -189,7 +189,7 @@ inline void SVDIncompleteIncrementalLearning::HUpdate( deltaH.zeros(); for (arma::sp_mat::const_iterator it = V.begin_col(currentUserIndex); - it != V.end_col(currentUserIndex); it++) + it != V.end_col(currentUserIndex); ++it) { double val = *it; size_t i = it.row(); diff --git a/src/mlpack/methods/gmm/em_fit_impl.hpp b/src/mlpack/methods/gmm/em_fit_impl.hpp index 2d37fe7a7a..8c57826644 100644 --- a/src/mlpack/methods/gmm/em_fit_impl.hpp +++ b/src/mlpack/methods/gmm/em_fit_impl.hpp @@ -383,7 +383,7 @@ ArmadilloGMMWrapper(const arma::mat& observations, for (size_t i = 0; i < dists.size(); ++i) { dists[i].Mean() = g.means.col(i); - dists[i].Covariance(std::move(arma::diagmat(g.dcovs.col(i)))); + dists[i].Covariance(arma::diagmat(g.dcovs.col(i))); } } #endif diff --git a/src/mlpack/methods/lsh/lsh_main.cpp b/src/mlpack/methods/lsh/lsh_main.cpp index eec2049daa..fdf34d3cf8 100644 --- a/src/mlpack/methods/lsh/lsh_main.cpp +++ b/src/mlpack/methods/lsh/lsh_main.cpp @@ -169,7 +169,7 @@ static void mlpackMain() secondHashSize, bucketSize); Timer::Stop("hash_building"); } - else if (CLI::HasParam("input_model")) + else // We must have an input model. { allkann = CLI::GetParam*>("input_model"); } diff --git a/src/mlpack/tests/arma_extend_test.cpp b/src/mlpack/tests/arma_extend_test.cpp index ce3950ab53..175528ea7f 100644 --- a/src/mlpack/tests/arma_extend_test.cpp +++ b/src/mlpack/tests/arma_extend_test.cpp @@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE(ConstRowColIteratorTest) mat::const_row_col_iterator it; // Make sure ++ operator, operator* and comparison operators work fine. size_t count = 0; - for (it = X.begin_row_col(); it != X.end_row_col(); it++) + for (it = X.begin_row_col(); it != X.end_row_col(); ++it) { // Check iterator value. BOOST_REQUIRE_EQUAL(*it, (count % 5) * 3 + (count / 5)); @@ -79,14 +79,14 @@ BOOST_AUTO_TEST_CASE(ConstRowColIteratorTest) BOOST_REQUIRE_EQUAL(it.row(), count % 5); BOOST_REQUIRE_EQUAL(it.col(), count / 5); - count++; + ++count; } BOOST_REQUIRE_EQUAL(count, 25); it = X.end_row_col(); do { - it--; - count--; + --it; + --count; // Check iterator value. BOOST_REQUIRE_EQUAL(*it, (count % 5) * 3 + (count / 5)); @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(RowColIteratorTest) mat::row_col_iterator it; // Make sure ++ operator, operator* and comparison operators work fine. size_t count = 0; - for (it = X.begin_row_col(); it != X.end_row_col(); it++) + for (it = X.begin_row_col(); it != X.end_row_col(); ++it) { // Check iterator value. BOOST_REQUIRE_EQUAL(*it, (count % 5) * 3 + (count / 5)); @@ -125,14 +125,14 @@ BOOST_AUTO_TEST_CASE(RowColIteratorTest) BOOST_REQUIRE_EQUAL(it.row(), count % 5); BOOST_REQUIRE_EQUAL(it.col(), count / 5); - count++; + ++count; } BOOST_REQUIRE_EQUAL(count, 25); it = X.end_row_col(); do { - it--; - count--; + --it; + --count; // Check iterator value. BOOST_REQUIRE_EQUAL(*it, (count % 5) * 3 + (count / 5)); @@ -155,14 +155,14 @@ BOOST_AUTO_TEST_CASE(MatRowColIteratorDecrementOperatorTest) mat::row_col_iterator it1 = test.begin_row_col(); mat::row_col_iterator it2 = it1; - // check that postfix-- does not decrement the position when position is - // pointing to the begining - it2--; + // Check that postfix-- does not decrement the position when position is + // pointing to the beginning. + (void) it2--; BOOST_REQUIRE_EQUAL(it1.row(), it2.row()); BOOST_REQUIRE_EQUAL(it1.col(), it2.col()); - // check that prefix-- does not decrement the position when position is - // pointing to the begining + // Check that prefix-- does not decrement the position when position is + // pointing to the beginning. --it2; BOOST_REQUIRE_EQUAL(it1.row(), it2.row()); BOOST_REQUIRE_EQUAL(it1.col(), it2.col()); @@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE(ConstSpRowColIteratorTest) sp_mat::const_row_col_iterator it; // Make sure ++ operator, operator* and comparison operators work fine. size_t count = 1; - for (it = X.begin_row_col(); it != X.end_row_col(); it++) + for (it = X.begin_row_col(); it != X.end_row_col(); ++it) { // Check iterator value. BOOST_REQUIRE_EQUAL(*it, (count % 5) * 3 + (count / 5)); @@ -196,14 +196,14 @@ BOOST_AUTO_TEST_CASE(ConstSpRowColIteratorTest) BOOST_REQUIRE_EQUAL(it.row(), count % 5); BOOST_REQUIRE_EQUAL(it.col(), count / 5); - count++; + ++count; } BOOST_REQUIRE_EQUAL(count, 25); it = X.end_row_col(); do { - it--; - count--; + --it; + --count; // Check iterator value. BOOST_REQUIRE_EQUAL(*it, (count % 5) * 3 + (count / 5)); @@ -232,7 +232,7 @@ BOOST_AUTO_TEST_CASE(SpRowColIteratorTest) sp_mat::row_col_iterator it; // Make sure ++ operator, operator* and comparison operators work fine. size_t count = 1; - for (it = X.begin_row_col(); it != X.end_row_col(); it++) + for (it = X.begin_row_col(); it != X.end_row_col(); ++it) { // Check iterator value. BOOST_REQUIRE_EQUAL(*it, (count % 5) * 3 + (count / 5)); @@ -241,14 +241,14 @@ BOOST_AUTO_TEST_CASE(SpRowColIteratorTest) BOOST_REQUIRE_EQUAL(it.row(), count % 5); BOOST_REQUIRE_EQUAL(it.col(), count / 5); - count++; + ++count; } BOOST_REQUIRE_EQUAL(count, 25); it = X.end_row_col(); do { - it--; - count--; + --it; + --count; // Check iterator value. BOOST_REQUIRE_EQUAL(*it, (count % 5) * 3 + (count / 5)); diff --git a/src/mlpack/tests/main_tests/decision_tree_test.cpp b/src/mlpack/tests/main_tests/decision_tree_test.cpp index 7e48d3ecbe..5aecccac98 100644 --- a/src/mlpack/tests/main_tests/decision_tree_test.cpp +++ b/src/mlpack/tests/main_tests/decision_tree_test.cpp @@ -69,12 +69,12 @@ BOOST_AUTO_TEST_CASE(DecisionTreeOutputDimensionTest) size_t testSize = testData.n_cols; // Input training data. - SetInputParam("training", std::move(std::make_tuple(info, inputData))); + SetInputParam("training", std::make_tuple(info, inputData)); SetInputParam("labels", std::move(labels)); SetInputParam("weights", std::move(weights)); // Input test data. - SetInputParam("test", std::move(std::make_tuple(info, testData))); + SetInputParam("test", std::make_tuple(info, testData)); mlpackMain(); @@ -116,12 +116,12 @@ BOOST_AUTO_TEST_CASE(DecisionTreeCategoricalOutputDimensionTest) size_t testSize = testData.n_cols; // Input training data. - SetInputParam("training", std::move(std::make_tuple(info, inputData))); + SetInputParam("training", std::make_tuple(info, inputData)); SetInputParam("labels", std::move(labels)); SetInputParam("weights", std::move(weights)); // Input test data. - SetInputParam("test", std::move(std::make_tuple(info, testData))); + SetInputParam("test", std::make_tuple(info, testData)); mlpackMain(); @@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE(DecisionModelReuseTest) size_t testSize = testData.n_cols; // Input training data. - SetInputParam("training", std::move(std::make_tuple(info, inputData))); + SetInputParam("training", std::make_tuple(info, inputData)); SetInputParam("labels", std::move(labels)); SetInputParam("weights", std::move(weights)); @@ -206,7 +206,7 @@ BOOST_AUTO_TEST_CASE(DecisionModelReuseTest) CLI::GetSingleton().Parameters()["test"].wasPassed = false; // Input trained model. - SetInputParam("test", std::move(std::make_tuple(info, testData))); + SetInputParam("test", std::make_tuple(info, testData)); SetInputParam("input_model", std::move(CLI::GetParam("output_model"))); @@ -247,7 +247,7 @@ BOOST_AUTO_TEST_CASE(DecisionTreeTrainingVerTest) arma::mat weights(1, labels.n_cols, arma::fill::ones); // Input training data. - SetInputParam("training", std::move(std::make_tuple(info, inputData))); + SetInputParam("training", std::make_tuple(info, inputData)); SetInputParam("labels", std::move(labels)); SetInputParam("weights", std::move(weights)); @@ -286,7 +286,7 @@ BOOST_AUTO_TEST_CASE(DecisionModelCategoricalReuseTest) size_t testSize = testData.n_cols; // Input training data. - SetInputParam("training", std::move(std::make_tuple(info, inputData))); + SetInputParam("training", std::make_tuple(info, inputData)); SetInputParam("labels", std::move(labels)); SetInputParam("weights", std::move(weights)); @@ -307,7 +307,7 @@ BOOST_AUTO_TEST_CASE(DecisionModelCategoricalReuseTest) CLI::GetSingleton().Parameters()["test"].wasPassed = false; // Input trained model. - SetInputParam("test", std::move(std::make_tuple(info, testData))); + SetInputParam("test", std::make_tuple(info, testData)); SetInputParam("input_model", std::move(CLI::GetParam("output_model")));