[mlpack] 132/207: Minor formatting fixes and clarifications.
Barak A. Pearlmutter
barak+git at pearlmutter.net
Thu Mar 23 17:53:47 UTC 2017
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to branch master
in repository mlpack.
commit 820f7a0c3a75cb78a3e691121dd04c6fe7f018bb
Author: Ryan Curtin <ryan at ratml.org>
Date: Mon Mar 6 14:14:04 2017 -0500
Minor formatting fixes and clarifications.
---
src/mlpack/core/data/load_impl.hpp | 10 +++++-----
src/mlpack/tests/load_save_test.cpp | 21 ++++++++-------------
2 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/src/mlpack/core/data/load_impl.hpp b/src/mlpack/core/data/load_impl.hpp
index 1573883..7434b4c 100644
--- a/src/mlpack/core/data/load_impl.hpp
+++ b/src/mlpack/core/data/load_impl.hpp
@@ -16,7 +16,7 @@
#include "load.hpp"
#include "extension.hpp"
-#include<exception>
+#include <exception>
#include <algorithm>
#include <mlpack/core/util/timers.hpp>
@@ -90,22 +90,22 @@ bool inline inplace_transpose(arma::Mat<eT>& X)
}
}
+// Load column vector.
template<typename eT>
bool Load(const std::string& filename,
arma::Col<eT>& vec,
const bool fatal)
{
- Load(filename, vec, fatal, false);
- return true;
+ return Load(filename, vec, fatal, false);
}
+// Load row vector.
template<typename eT>
bool Load(const std::string& filename,
arma::Row<eT>& rowvec,
const bool fatal)
{
- Load(filename, rowvec, fatal, false);
- return true;
+ return Load(filename, rowvec, fatal, false);
}
template<typename eT>
diff --git a/src/mlpack/tests/load_save_test.cpp b/src/mlpack/tests/load_save_test.cpp
index 7ceba99..86f2f07 100644
--- a/src/mlpack/tests/load_save_test.cpp
+++ b/src/mlpack/tests/load_save_test.cpp
@@ -180,17 +180,13 @@ BOOST_AUTO_TEST_CASE(LoadTransposedCSVTest)
}
/**
- * The test LoadColVecCSVTest, LoadMatinColVec,
- * LoadRowVecCSVTest need to run in DEBUG mode
- * else arma::colvec and arma::rowvec behave
- * like arma::mat, that is you can also load
- * matrices into them if DEBUG mode is not on
- * So to test whether Colvec and Rowvec load
- * works, we need to turn on the debug mode
+ * The test LoadColVecCSVTest, LoadMatinColVec, LoadRowVecCSVTest need to run in
+ * debug mode only; without debugging symbols, size checks are not performed and
+ * thus the exception will not be thrown.
*/
/**
- * Make sure ColVec can be loaded
+ * Make sure ColVec can be loaded.
*/
#ifdef DEBUG
BOOST_AUTO_TEST_CASE(LoadColVecCSVTest)
@@ -212,14 +208,13 @@ BOOST_AUTO_TEST_CASE(LoadColVecCSVTest)
for (size_t i = 0; i < 8; ++i)
BOOST_REQUIRE_CLOSE(test[i], (double) (i), 1e-5);
- //Remove the file
+ // Remove the file.
remove("test_file.csv");
}
/**
- * Make Sure Load throws Exception when trying
- * to load a Matrix in ColVec
- * and RowVec
+ * Make sure Load() throws an exception when trying to load a matrix into a
+ * colvec or rowvec.
*/
BOOST_AUTO_TEST_CASE(LoadMatinColVec)
{
@@ -245,7 +240,7 @@ BOOST_AUTO_TEST_CASE(LoadMatinColVec)
}
/**
- * Make sure RowVec can be loaded
+ * Make sure that rowvecs can be loaded successfully.
*/
BOOST_AUTO_TEST_CASE(LoadRowVecCSVTest)
{
--
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