diff --git a/src/mlpack/methods/neighbor_search/ns_model.hpp b/src/mlpack/methods/neighbor_search/ns_model.hpp index 613ef45efd..f0db0d115f 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 public: template - void operator()(NSType *ns) const; + void operator()(NSType* ns) const; MonoSearchVisitor(const size_t k, arma::Mat& neighbors, @@ -132,7 +132,7 @@ class SingleModeVisitor : public boost::static_visitor { public: template - bool& operator()(NSType *ns) const; + bool& operator()(NSType* ns) const; }; class NaiveVisitor : public boost::static_visitor @@ -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 bcded0ec2e..8c7400e0ad 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::operator()(NSTypeT* ns) const template template -void BiSearchVisitor::SearchLeaf(NSType *ns) const +void BiSearchVisitor::SearchLeaf(NSType* ns) const { if (!ns->Naive() && !ns->SingleMode()) { @@ -156,7 +156,7 @@ void TrainVisitor::TrainLeaf(NSType* ns) const template -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 -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 -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 -void DeleteVisitor::operator()(NSType *ns) const +void DeleteVisitor::operator()(NSType* ns) const { if (ns) delete ns; @@ -199,7 +199,7 @@ SerializeVisitor::SerializeVisitor(Archive& ar, template template -void SerializeVisitor::operator()(NSType *ns) const +void SerializeVisitor::operator()(NSType* ns) const { ar & data::CreateNVP(ns, name); } @@ -349,7 +349,7 @@ void NSModel::BuildModel(arma::mat&& referenceSet, break; } - TrainVisitor tn(std::move(referenceSet),leafSize); + TrainVisitor tn(std::move(referenceSet), leafSize); boost::apply_visitor(tn, nSearch); if (!naive)