[mlpack-git] master: Details to improve code and documentation. (83f1925)

gitdub at mlpack.org gitdub at mlpack.org
Wed Jun 15 22:13:35 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/a7e8d3bac60d6aa2717f27e0d4f6c53ff20607f5...779556fed748819a18cc898d9a6f69900740ef23

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

commit 83f1925bb246471323c893b7ead2f7ebf39124b1
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Wed Jun 15 23:13:35 2016 -0300

    Details to improve code and documentation.


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

83f1925bb246471323c893b7ead2f7ebf39124b1
 src/mlpack/methods/neighbor_search/ns_model.hpp      |  8 ++++++--
 src/mlpack/methods/neighbor_search/ns_model_impl.hpp | 14 +++++++-------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/mlpack/methods/neighbor_search/ns_model.hpp b/src/mlpack/methods/neighbor_search/ns_model.hpp
index 613ef45..f0db0d1 100644
--- a/src/mlpack/methods/neighbor_search/ns_model.hpp
+++ b/src/mlpack/methods/neighbor_search/ns_model.hpp
@@ -58,7 +58,7 @@ class MonoSearchVisitor : public boost::static_visitor<void>
 
  public:
   template<typename NSType>
-  void operator()(NSType *ns) const;
+  void operator()(NSType* ns) const;
 
   MonoSearchVisitor(const size_t k,
                     arma::Mat<size_t>& neighbors,
@@ -132,7 +132,7 @@ class SingleModeVisitor : public boost::static_visitor<bool&>
 {
  public:
   template<typename NSType>
-  bool& operator()(NSType *ns) const;
+  bool& operator()(NSType* ns) const;
 };
 
 class NaiveVisitor : public boost::static_visitor<bool&>
@@ -220,15 +220,19 @@ class NSModel
   bool SingleMode() const;
   bool& SingleMode();
 
+  //! Expose naiveMode.
   bool Naive() const;
   bool& Naive();
 
+  //! Expose leafSize.
   size_t LeafSize() const { return leafSize; }
   size_t& LeafSize() { return leafSize; }
 
+  //! Expose treeType.
   TreeTypes TreeType() const { return treeType; }
   TreeTypes& TreeType() { return treeType; }
 
+  //! Expose randomBasis.
   bool RandomBasis() const { return randomBasis; }
   bool& RandomBasis() { return randomBasis; }
 
diff --git a/src/mlpack/methods/neighbor_search/ns_model_impl.hpp b/src/mlpack/methods/neighbor_search/ns_model_impl.hpp
index bcded0e..8c7400e 100644
--- a/src/mlpack/methods/neighbor_search/ns_model_impl.hpp
+++ b/src/mlpack/methods/neighbor_search/ns_model_impl.hpp
@@ -74,7 +74,7 @@ void BiSearchVisitor<SortPolicy>::operator()(NSTypeT<tree::BallTree>* ns) const
 
 template<typename SortPolicy>
 template<typename NSType>
-void BiSearchVisitor<SortPolicy>::SearchLeaf(NSType *ns) const
+void BiSearchVisitor<SortPolicy>::SearchLeaf(NSType* ns) const
 {
   if (!ns->Naive() && !ns->SingleMode())
   {
@@ -156,7 +156,7 @@ void TrainVisitor<SortPolicy>::TrainLeaf(NSType* ns) const
 
 
 template<typename NSType>
-bool& SingleModeVisitor::operator()(NSType *ns) const
+bool& SingleModeVisitor::operator()(NSType* ns) const
 {
   if (ns)
     return ns->SingleMode();
@@ -165,7 +165,7 @@ bool& SingleModeVisitor::operator()(NSType *ns) const
 
 
 template<typename NSType>
-bool& NaiveVisitor::operator()(NSType *ns) const
+bool& NaiveVisitor::operator()(NSType* ns) const
 {
   if (ns)
     return ns->Naive();
@@ -174,7 +174,7 @@ bool& NaiveVisitor::operator()(NSType *ns) const
 
 
 template<typename NSType>
-const arma::mat& ReferenceSetVisitor::operator()(NSType *ns) const
+const arma::mat& ReferenceSetVisitor::operator()(NSType* ns) const
 {
   if (ns)
     return ns->ReferenceSet();
@@ -183,7 +183,7 @@ const arma::mat& ReferenceSetVisitor::operator()(NSType *ns) const
 
 
 template<typename NSType>
-void DeleteVisitor::operator()(NSType *ns) const
+void DeleteVisitor::operator()(NSType* ns) const
 {
   if (ns)
     delete ns;
@@ -199,7 +199,7 @@ SerializeVisitor<Archive>::SerializeVisitor(Archive& ar,
 
 template<typename Archive>
 template<typename NSType>
-void SerializeVisitor<Archive>::operator()(NSType *ns) const
+void SerializeVisitor<Archive>::operator()(NSType* ns) const
 {
   ar & data::CreateNVP(ns, name);
 }
@@ -349,7 +349,7 @@ void NSModel<SortPolicy>::BuildModel(arma::mat&& referenceSet,
       break;
   }
 
-  TrainVisitor<SortPolicy> tn(std::move(referenceSet),leafSize);
+  TrainVisitor<SortPolicy> tn(std::move(referenceSet), leafSize);
   boost::apply_visitor(tn, nSearch);
 
   if (!naive)




More information about the mlpack-git mailing list