[mlpack-svn] r10466 - mlpack/trunk/src/mlpack/core/data

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Nov 30 03:18:19 EST 2011


Author: rcurtin
Date: 2011-11-30 03:18:19 -0500 (Wed, 30 Nov 2011)
New Revision: 10466

Modified:
   mlpack/trunk/src/mlpack/core/data/load_impl.hpp
   mlpack/trunk/src/mlpack/core/data/save_impl.hpp
Log:
Improper use of regex leads to over-confidence about code compilability then
sudden erosion of programmer confidence.  Moral: your regex is always wrong.


Modified: mlpack/trunk/src/mlpack/core/data/load_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/data/load_impl.hpp	2011-11-30 07:40:42 UTC (rev 10465)
+++ mlpack/trunk/src/mlpack/core/data/load_impl.hpp	2011-11-30 08:18:19 UTC (rev 10466)
@@ -48,14 +48,14 @@
     return false;
   }
 
-  bool unknown_type = false;
+  bool unknownType = false;
   arma::file_type loadType;
   std::string stringType;
 
   if (extension == "csv")
   {
-    load_type = arma::csv_ascii;
-    string_type = "CSV data";
+    loadType = arma::csv_ascii;
+    stringType = "CSV data";
   }
   else if (extension == "txt")
   {
@@ -117,7 +117,7 @@
       loadType = arma::raw_binary;
     }
 
-    delete[] raw_header;
+    delete[] rawHeader;
   }
   else if (extension == "pgm")
   {
@@ -150,7 +150,7 @@
     Log::Info << "Loading '" << filename << "' as " << stringType << "."
         << std::endl;
 
-  bool success = matrix.load(stream, load_type);
+  bool success = matrix.load(stream, loadType);
 
   if (!success)
   {

Modified: mlpack/trunk/src/mlpack/core/data/save_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/data/save_impl.hpp	2011-11-30 07:40:42 UTC (rev 10465)
+++ mlpack/trunk/src/mlpack/core/data/save_impl.hpp	2011-11-30 08:18:19 UTC (rev 10466)
@@ -50,7 +50,7 @@
     return false;
   }
 
-  bool unknown_type = false;
+  bool unknownType = false;
   arma::file_type saveType;
   std::string stringType;
 
@@ -76,11 +76,11 @@
   }
   else
   {
-    unknown_type = true;
+    unknownType = true;
   }
 
   // Provide error if we don't know the type.
-  if (unknown_type)
+  if (unknownType)
   {
     if (fatal)
       Log::Fatal << "Unable to determine format to save to from filename '"




More information about the mlpack-svn mailing list