[mlpack-git] master: Better casting, remove std::. (31c10fe)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Wed Dec 16 14:12:41 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/cd5986e141b41781fdc13a9c89443f9be33b56bd...31c10fef76ac1d85c6415c92d2ccd429c430105f

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

commit 31c10fef76ac1d85c6415c92d2ccd429c430105f
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Dec 16 19:12:06 2015 +0000

    Better casting, remove std::.


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

31c10fef76ac1d85c6415c92d2ccd429c430105f
 src/mlpack/methods/sparse_coding/sparse_coding_main.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mlpack/methods/sparse_coding/sparse_coding_main.cpp b/src/mlpack/methods/sparse_coding/sparse_coding_main.cpp
index e5ffce4..72bc2f5 100644
--- a/src/mlpack/methods/sparse_coding/sparse_coding_main.cpp
+++ b/src/mlpack/methods/sparse_coding/sparse_coding_main.cpp
@@ -91,7 +91,7 @@ int main(int argc, char* argv[])
   if (CLI::GetParam<int>("seed") != 0)
     RandomSeed((size_t) CLI::GetParam<int>("seed"));
   else
-    RandomSeed((size_t) std::time(NULL));
+    RandomSeed((size_t) time(NULL));
 
   // Check for parameter validity.
   if (CLI::HasParam("input_model_file") && CLI::HasParam("initial_dictionary"))
@@ -156,15 +156,15 @@ int main(int argc, char* argv[])
     // Normalize each point if the user asked for it.
     if (CLI::HasParam("normalize"))
     {
-      Log::Info << "Normalizing data before coding..." << std::endl;
+      Log::Info << "Normalizing data before coding..." << endl;
       for (size_t i = 0; i < matX.n_cols; ++i)
         matX.col(i) /= norm(matX.col(i), 2);
     }
 
     sc.Lambda1() = CLI::GetParam<double>("lambda1");
     sc.Lambda2() = CLI::GetParam<double>("lambda2");
-    sc.MaxIterations() = CLI::GetParam<int>("max_iterations");
-    sc.Atoms() = CLI::GetParam<int>("atoms");
+    sc.MaxIterations() = (size_t) CLI::GetParam<int>("max_iterations");
+    sc.Atoms() = (size_t) CLI::GetParam<int>("atoms");
     sc.ObjTolerance() = CLI::GetParam<double>("objective_tolerance");
     sc.NewtonTolerance() = CLI::GetParam<double>("newton_tolerance");
 
@@ -222,7 +222,7 @@ int main(int argc, char* argv[])
     // Normalize each point if the user asked for it.
     if (CLI::HasParam("normalize"))
     {
-      Log::Info << "Normalizing test data before coding..." << std::endl;
+      Log::Info << "Normalizing test data before coding..." << endl;
       for (size_t i = 0; i < matY.n_cols; ++i)
         matY.col(i) /= norm(matY.col(i), 2);
     }



More information about the mlpack-git mailing list