[mlpack-svn] r14921 - mlpack/trunk/src/mlpack/methods/kmeans

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu Apr 18 19:35:53 EDT 2013


Author: rcurtin
Date: 2013-04-18 19:35:50 -0400 (Thu, 18 Apr 2013)
New Revision: 14921

Modified:
   mlpack/trunk/src/mlpack/methods/kmeans/refined_start.hpp
   mlpack/trunk/src/mlpack/methods/kmeans/refined_start_impl.hpp
Log:
Add accessors and mutators, and mark function const (as it should be).


Modified: mlpack/trunk/src/mlpack/methods/kmeans/refined_start.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/kmeans/refined_start.hpp	2013-04-18 23:10:28 UTC (rev 14920)
+++ mlpack/trunk/src/mlpack/methods/kmeans/refined_start.hpp	2013-04-18 23:35:50 UTC (rev 14921)
@@ -54,8 +54,18 @@
   template<typename MatType>
   void Cluster(const MatType& data,
                const size_t clusters,
-               arma::Col<size_t>& assignments);
+               arma::Col<size_t>& assignments) const;
 
+  //! Get the number of samplings that will be performed.
+  size_t Samplings() const { return samplings; }
+  //! Modify the number of samplings that will be performed.
+  size_t& Samplings() { return samplings; }
+
+  //! Get the percentage of the data used by each subsampling.
+  double Percentage() const { return percentage; }
+  //! Modify the percentage of the data used by each subsampling.
+  double& Percentage() { return percentage; }
+
  private:
   //! The number of samplings to perform.
   size_t samplings;

Modified: mlpack/trunk/src/mlpack/methods/kmeans/refined_start_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/kmeans/refined_start_impl.hpp	2013-04-18 23:10:28 UTC (rev 14920)
+++ mlpack/trunk/src/mlpack/methods/kmeans/refined_start_impl.hpp	2013-04-18 23:35:50 UTC (rev 14921)
@@ -19,7 +19,7 @@
 template<typename MatType>
 void RefinedStart::Cluster(const MatType& data,
                            const size_t clusters,
-                           arma::Col<size_t>& assignments)
+                           arma::Col<size_t>& assignments) const
 {
   math::RandomSeed(std::time(NULL));
 




More information about the mlpack-svn mailing list