[mlpack-git] master: all tests are passing (449b660)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Tue Nov 24 13:54:02 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/0dc380de64b6b087d025c63618b8d6f00abe7545...4f97fdfb7e158025283c2652084af670bc6e2d76

>---------------------------------------------------------------

commit 449b660127e3fbc42634660edffbbef339b6f73a
Author: theSundayProgrammer <joe.mariadassou at gmail.com>
Date:   Tue Nov 24 11:15:06 2015 +1100

    all tests are passing


>---------------------------------------------------------------

449b660127e3fbc42634660edffbbef339b6f73a
 src/mlpack/core/data/load_impl.hpp      | 5 ++++-
 src/mlpack/core/data/save_impl.hpp      | 5 ++++-
 src/mlpack/tests/serialization_test.cpp | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/mlpack/core/data/load_impl.hpp b/src/mlpack/core/data/load_impl.hpp
index e374611..6c6b553 100644
--- a/src/mlpack/core/data/load_impl.hpp
+++ b/src/mlpack/core/data/load_impl.hpp
@@ -61,8 +61,11 @@ bool Load(const std::string& filename,
 
   // Catch nonexistent files by opening the stream ourselves.
   std::fstream stream;
+#ifdef  _WIN32
+  stream.open(filename.c_str(), std::fstream::in | std::fstream::binary);
+#else
   stream.open(filename.c_str(), std::fstream::in);
-
+#endif
   if (!stream.is_open())
   {
     Timer::Stop("loading_data");
diff --git a/src/mlpack/core/data/save_impl.hpp b/src/mlpack/core/data/save_impl.hpp
index 393dfdd..e84bda5 100644
--- a/src/mlpack/core/data/save_impl.hpp
+++ b/src/mlpack/core/data/save_impl.hpp
@@ -46,8 +46,11 @@ bool Save(const std::string& filename,
 
   // Catch errors opening the file.
   std::fstream stream;
+#ifdef  _WIN32
+  stream.open(filename.c_str(), std::fstream::out| std::fstream::binary);
+#else
   stream.open(filename.c_str(), std::fstream::out);
-
+#endif
   if (!stream.is_open())
   {
     Timer::Stop("saving_data");
diff --git a/src/mlpack/tests/serialization_test.cpp b/src/mlpack/tests/serialization_test.cpp
index dbef1de..679fa0e 100644
--- a/src/mlpack/tests/serialization_test.cpp
+++ b/src/mlpack/tests/serialization_test.cpp
@@ -112,7 +112,7 @@ void TestAllArmadilloSerialization(MatType& x)
 {
   TestArmadilloSerialization<MatType, xml_iarchive, xml_oarchive>(x);
   TestArmadilloSerialization<MatType, text_iarchive, text_oarchive>(x);
-  //TestArmadilloSerialization<MatType, binary_iarchive, binary_oarchive>(x);
+  TestArmadilloSerialization<MatType, binary_iarchive, binary_oarchive>(x);
 }
 
 /**



More information about the mlpack-git mailing list