[mlpack-git] master: remove useless codes (29f0536)
gitdub at mlpack.org
gitdub at mlpack.org
Tue May 31 04:10:30 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/2629a4fd65684e2bd4544d5ef8ea07fa9ad594a7...ee95e2030ddd526368e377b4e1c13484d471e307
>---------------------------------------------------------------
commit 29f0536f6aea762b98bef2a2ae91ce2d54b88e1b
Author: stereomatchingkiss <stereomatchingkiss at gmail.com>
Date: Tue May 31 16:10:30 2016 +0800
remove useless codes
>---------------------------------------------------------------
29f0536f6aea762b98bef2a2ae91ce2d54b88e1b
src/mlpack/core/data/load_impl.hpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/mlpack/core/data/load_impl.hpp b/src/mlpack/core/data/load_impl.hpp
index c02fa5e..69a46fa 100644
--- a/src/mlpack/core/data/load_impl.hpp
+++ b/src/mlpack/core/data/load_impl.hpp
@@ -388,7 +388,6 @@ bool Load(const std::string& filename,
stream.close();
stream.open(filename, std::fstream::in);
- // Extract line by line.
auto notNumber = [](std::string const &str)
{
return std::any_of(std::begin(str), std::end(str),
@@ -397,6 +396,7 @@ bool Load(const std::string& filename,
size_t row = 0;
while (!stream.bad() && !stream.fail() && !stream.eof())
{
+ // Extract line by line.
std::getline(stream, buffer, '\n');
Tokenizer lineTok(buffer, sep);
std::vector<std::string> tokens;
@@ -423,10 +423,8 @@ bool Load(const std::string& filename,
std::stringstream sstream;
for(size_t i = 0; i != tokens.size(); ++i)
{
- eT val(0);
sstream<<tokens[i];
- sstream>>val;
- matrix.at(row, i) = val;
+ sstream>>matrix.at(row, i);
sstream.clear();
}
}
More information about the mlpack-git
mailing list