[mlpack-svn] r11197 - in mlpack/trunk/src/mlpack: methods/hmm tests

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Fri Jan 20 12:09:20 EST 2012


Author: rcurtin
Date: 2012-01-20 12:09:20 -0500 (Fri, 20 Jan 2012)
New Revision: 11197

Modified:
   mlpack/trunk/src/mlpack/methods/hmm/hmm_generate_main.cpp
   mlpack/trunk/src/mlpack/methods/hmm/hmm_train_main.cpp
   mlpack/trunk/src/mlpack/tests/kernel_test.cpp
Log:
Fix some errors present on older gcc versions.


Modified: mlpack/trunk/src/mlpack/methods/hmm/hmm_generate_main.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/hmm/hmm_generate_main.cpp	2012-01-20 16:58:44 UTC (rev 11196)
+++ mlpack/trunk/src/mlpack/methods/hmm/hmm_generate_main.cpp	2012-01-20 17:09:20 UTC (rev 11197)
@@ -33,6 +33,7 @@
 using namespace mlpack::distribution;
 using namespace mlpack::utilities;
 using namespace mlpack::gmm;
+using namespace mlpack::math;
 using namespace arma;
 using namespace std;
 
@@ -43,9 +44,9 @@
 
   // Set random seed.
   if (CLI::GetParam<int>("seed") != 0)
-    math::RandomSeed((size_t) CLI::GetParam<int>("seed"));
+    RandomSeed((size_t) CLI::GetParam<int>("seed"));
   else
-    math::RandomSeed((size_t) std::time(NULL));
+    RandomSeed((size_t) time(NULL));
 
   // Load observations.
   const string modelFile = CLI::GetParam<string>("model_file");

Modified: mlpack/trunk/src/mlpack/methods/hmm/hmm_train_main.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/hmm/hmm_train_main.cpp	2012-01-20 16:58:44 UTC (rev 11196)
+++ mlpack/trunk/src/mlpack/methods/hmm/hmm_train_main.cpp	2012-01-20 17:09:20 UTC (rev 11197)
@@ -48,6 +48,7 @@
 using namespace mlpack::distribution;
 using namespace mlpack::utilities;
 using namespace mlpack::gmm;
+using namespace mlpack::math;
 using namespace arma;
 using namespace std;
 
@@ -58,9 +59,9 @@
 
   // Set random seed.
   if (CLI::GetParam<int>("seed") != 0)
-    math::RandomSeed((size_t) CLI::GetParam<int>("seed"));
+    RandomSeed((size_t) CLI::GetParam<int>("seed"));
   else
-    math::RandomSeed((size_t) std::time(NULL));
+    RandomSeed((size_t) time(NULL));
 
   // Validate parameters.
   const string inputFile = CLI::GetParam<string>("input_file");

Modified: mlpack/trunk/src/mlpack/tests/kernel_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/kernel_test.cpp	2012-01-20 16:58:44 UTC (rev 11196)
+++ mlpack/trunk/src/mlpack/tests/kernel_test.cpp	2012-01-20 17:09:20 UTC (rev 11197)
@@ -251,8 +251,8 @@
   arma::vec b = "0 1 0";
 
   PolynomialKernel pk(5.0, 5.0);
-  BOOST_REQUIRE_CLOSE(pk.Evaluate(a, b), 3125, 0);
-  BOOST_REQUIRE_CLOSE(pk.Evaluate(b, a), 3125, 0);
+  BOOST_REQUIRE_CLOSE(pk.Evaluate(a, b), 3125.0, 0);
+  BOOST_REQUIRE_CLOSE(pk.Evaluate(b, a), 3125.0, 0);
 }
 
 BOOST_AUTO_TEST_CASE(hyperbolic_tangent_kernel)




More information about the mlpack-svn mailing list