[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/1f562a1aba7ae55475afcc95659511c2b7f694e5...5b8fdce471328f722fcd8c0f22a6d995ce22c98b
>---------------------------------------------------------------
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