[mlpack-svn] r16284 - mlpack/trunk/src/mlpack/core/util

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Feb 11 12:21:12 EST 2014


Author: rcurtin
Date: Tue Feb 11 12:21:11 2014
New Revision: 16284

Log:
Fix formatting and fix contributor information.


Modified:
   mlpack/trunk/src/mlpack/core/util/string_util.cpp
   mlpack/trunk/src/mlpack/core/util/string_util.hpp

Modified: mlpack/trunk/src/mlpack/core/util/string_util.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/util/string_util.cpp	(original)
+++ mlpack/trunk/src/mlpack/core/util/string_util.cpp	Tue Feb 11 12:21:11 2014
@@ -1,6 +1,8 @@
 /**
  * @file string_util.cpp
- * @author ??? and Ryan Birmingham
+ * @author Trironk Kiatkungwanglai
+ * @author Ryan Birmingham
+ *
  * Defines methods useful for formatting output.
  */
 #include "string_util.hpp"
@@ -11,21 +13,23 @@
 
 //! A utility function that replaces all all newlines with a number of spaces
 //! depending on the indentation level.
-string mlpack::util::Indent(string input, size_t howManyTabs)
+string mlpack::util::Indent(string input, const size_t howManyTabs)
 {
   // For each declared...
   string standardTab = "  ";
   string bigTab = "";
-  for (size_t ind=0; ind<howManyTabs; ind++)
+  for (size_t ind = 0; ind < howManyTabs; ind++)
   {
-    // increase amount tabbed on later lines
-    bigTab+=standardTab;
-    //add to first line
+    // Increase amount tabbed on later lines.
+    bigTab += standardTab;
+
+    // Add indentation to first line.
     input.insert(0, 1, ' ');
     input.insert(0, 1, ' ');
-  }  
-// Get the character sequence to replace all newline characters.
-  std::string tabbedNewline("\n"+ bigTab);
+  }
+
+  // Create the character sequence to replace all newline characters.
+  std::string tabbedNewline("\n" + bigTab);
 
   // Replace all newline characters with the precomputed character sequence.
   size_t startPos = 0;

Modified: mlpack/trunk/src/mlpack/core/util/string_util.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/util/string_util.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/util/string_util.hpp	Tue Feb 11 12:21:11 2014
@@ -1,6 +1,8 @@
 /**
  * @file string_util.hpp
- * @author ??? and Ryan Birmingham
+ * @author Trironk Kiatkungwanglai
+ * @author Ryan Birmingham
+ *
  * Declares methods that are useful for writing formatting output.
  */
 #ifndef __MLPACK_CORE_STRING_UTIL_HPP
@@ -13,7 +15,7 @@
 
 //! A utility function that replaces all all newlines with a number of spaces
 //! depending on the indentation level.
-std::string Indent(std::string input, size_t howManyTabs=1);
+std::string Indent(std::string input, const size_t howManyTabs = 1);
 
 }; // namespace util
 }; // namespace mlpack



More information about the mlpack-svn mailing list