[mlpack-git] master: Add header guards. (9506eaa)

gitdub at mlpack.org gitdub at mlpack.org
Tue Nov 1 13:57:37 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/94d14187222231ca29e4f6419c5999c660db4f8a...981ffa2d67d8fe38df6c699589005835fef710ea

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

commit 9506eaa676e21732e8a2f5b04fb4335c6ee3ca0e
Author: Ryan Curtin <ryan at ratml.org>
Date:   Tue Nov 1 13:57:37 2016 -0400

    Add header guards.


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

9506eaa676e21732e8a2f5b04fb4335c6ee3ca0e
 src/mlpack/methods/det/dt_utils_impl.hpp | 38 +++++++++++++++++++-------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/src/mlpack/methods/det/dt_utils_impl.hpp b/src/mlpack/methods/det/dt_utils_impl.hpp
index 61f001c..e9e1c61 100644
--- a/src/mlpack/methods/det/dt_utils_impl.hpp
+++ b/src/mlpack/methods/det/dt_utils_impl.hpp
@@ -10,17 +10,20 @@
  * 3-clause BSD license along with mlpack.  If not, see
  * http://www.opensource.org/licenses/BSD-3-Clause for more information.
  */
+#ifndef MLPACK_METHODS_DET_DT_UTILS_IMPL_HPP
+#define MLPACK_METHODS_DET_DT_UTILS_IMPL_HPP
+
 #include "dt_utils.hpp"
 
-using namespace mlpack;
-using namespace det;
+namespace mlpack {
+namespace det {
 
 template <typename MatType, typename TagType>
-void mlpack::det::PrintLeafMembership(DTree<MatType, TagType>* dtree,
-                                      const MatType& data,
-                                      const arma::Mat<size_t>& labels,
-                                      const size_t numClasses,
-                                      const std::string leafClassMembershipFile)
+void PrintLeafMembership(DTree<MatType, TagType>* dtree,
+                         const MatType& data,
+                         const arma::Mat<size_t>& labels,
+                         const size_t numClasses,
+                         const std::string leafClassMembershipFile)
 {
   // Tag the leaves with numbers.
   TagType numLeaves = dtree->TagTree();
@@ -64,8 +67,8 @@ void mlpack::det::PrintLeafMembership(DTree<MatType, TagType>* dtree,
 }
 
 template <typename MatType, typename TagType>
-void mlpack::det::PrintVariableImportance(const DTree<MatType, TagType>* dtree,
-                                          const std::string viFile)
+void PrintVariableImportance(const DTree<MatType, TagType>* dtree,
+                             const std::string viFile)
 {
   arma::vec imps;
   dtree->ComputeVariableImportance(imps);
@@ -103,12 +106,12 @@ void mlpack::det::PrintVariableImportance(const DTree<MatType, TagType>* dtree,
 // This function trains the optimal decision tree using the given number of
 // folds.
 template <typename MatType, typename TagType>
-DTree<MatType, TagType>* mlpack::det::Trainer(MatType& dataset,
-                                              const size_t folds,
-                                              const bool useVolumeReg,
-                                              const size_t maxLeafSize,
-                                              const size_t minLeafSize,
-                                              const std::string unprunedTreeOutput)
+DTree<MatType, TagType>* Trainer(MatType& dataset,
+                                 const size_t folds,
+                                 const bool useVolumeReg,
+                                 const size_t maxLeafSize,
+                                 const size_t minLeafSize,
+                                 const std::string unprunedTreeOutput)
 {
   // Initialize the tree.
   DTree<MatType, TagType> dtree(dataset);
@@ -325,3 +328,8 @@ DTree<MatType, TagType>* mlpack::det::Trainer(MatType& dataset,
 
   return dtreeOpt;
 }
+
+} // namespace det
+} // namespace mlpack
+
+#endif




More information about the mlpack-git mailing list