[mlpack-git] master, mlpack-1.0.x: Fix formatting and fix contributor information. (2afaf2f)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:43:47 EST 2015


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

On branches: master,mlpack-1.0.x
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

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

commit 2afaf2f13efeead8ab09286d083f5847b62c9d54
Author: Ryan Curtin <ryan at ratml.org>
Date:   Tue Feb 11 17:21:11 2014 +0000

    Fix formatting and fix contributor information.


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

2afaf2f13efeead8ab09286d083f5847b62c9d54
 src/mlpack/core/util/string_util.cpp | 20 ++++++++++++--------
 src/mlpack/core/util/string_util.hpp |  6 ++++--
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/mlpack/core/util/string_util.cpp b/src/mlpack/core/util/string_util.cpp
index cdead2c..1dc54b2 100644
--- a/src/mlpack/core/util/string_util.cpp
+++ b/src/mlpack/core/util/string_util.cpp
@@ -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 @@ using namespace std;
 
 //! 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;
diff --git a/src/mlpack/core/util/string_util.hpp b/src/mlpack/core/util/string_util.hpp
index 504eeed..0e5b16f 100644
--- a/src/mlpack/core/util/string_util.hpp
+++ b/src/mlpack/core/util/string_util.hpp
@@ -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 @@ namespace util {
 
 //! 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-git mailing list