[mlpack-git] master: Fix bugs; add KernelType(). (42a94db)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Tue Dec 22 23:26:48 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/977afbec0648056124dcb206e0bf972a161d9b51...c0a1500de16d920eb0689e8c052e1aa7e1375c38

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

commit 42a94dbf970ea03a89caad7f33dc5f18c4d1d032
Author: ryan <ryan at ratml.org>
Date:   Tue Dec 22 23:25:57 2015 -0500

    Fix bugs; add KernelType().


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

42a94dbf970ea03a89caad7f33dc5f18c4d1d032
 src/mlpack/methods/fastmks/fastmks_model.hpp      | 9 +++++++--
 src/mlpack/methods/fastmks/fastmks_model_impl.hpp | 4 ++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/methods/fastmks/fastmks_model.hpp b/src/mlpack/methods/fastmks/fastmks_model.hpp
index 4289d4b..5226912 100644
--- a/src/mlpack/methods/fastmks/fastmks_model.hpp
+++ b/src/mlpack/methods/fastmks/fastmks_model.hpp
@@ -44,9 +44,9 @@ class FastMKSModel
    * Build the model on the given reference set.  Make sure kernelType is equal
    * to the correct entry in KernelTypes for the given KernelType class!
    */
-  template<typename KernelType>
+  template<typename TKernelType>
   void BuildModel(const arma::mat& referenceData,
-                  KernelType& kernel,
+                  TKernelType& kernel,
                   const bool singleMode,
                   const bool naive,
                   const double base);
@@ -61,6 +61,11 @@ class FastMKSModel
   //! Set whether or not single-tree search is used.
   bool& SingleMode();
 
+  //! Get the kernel type.
+  int KernelType() const { return kernelType; }
+  //! Modify the kernel type.
+  int& KernelType() { return kernelType; }
+
   /**
    * Search with a different query set.
    *
diff --git a/src/mlpack/methods/fastmks/fastmks_model_impl.hpp b/src/mlpack/methods/fastmks/fastmks_model_impl.hpp
index 00534c7..e70f8c0 100644
--- a/src/mlpack/methods/fastmks/fastmks_model_impl.hpp
+++ b/src/mlpack/methods/fastmks/fastmks_model_impl.hpp
@@ -49,9 +49,9 @@ void BuildFastMKSModel(FastMKSType& /* f */,
       " not equal to kernel type of the model!");
 }
 
-template<typename KernelType>
+template<typename TKernelType>
 void FastMKSModel::BuildModel(const arma::mat& referenceData,
-                              KernelType& kernel,
+                              TKernelType& kernel,
                               const bool singleMode,
                               const bool naive,
                               const double base)



More information about the mlpack-git mailing list