[mlpack-svn] r10781 - mlpack/trunk/src/mlpack/methods/emst

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Dec 14 08:33:03 EST 2011


Author: rcurtin
Date: 2011-12-14 08:33:02 -0500 (Wed, 14 Dec 2011)
New Revision: 10781

Modified:
   mlpack/trunk/src/mlpack/methods/emst/dtb.hpp
   mlpack/trunk/src/mlpack/methods/emst/union_find.hpp
Log:
Last run of modifications for EMST documentation.


Modified: mlpack/trunk/src/mlpack/methods/emst/dtb.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/emst/dtb.hpp	2011-12-14 13:24:30 UTC (rev 10780)
+++ mlpack/trunk/src/mlpack/methods/emst/dtb.hpp	2011-12-14 13:33:02 UTC (rev 10781)
@@ -76,17 +76,33 @@
  *
  * For more information on the algorithm, see the following citation:
  *
+ * @code
  * @inproceedings{
  *   author = {March, W.B., Ram, P., and Gray, A.G.},
  *   title = {{Fast Euclidean Minimum Spanning Tree: Algorithm, Analysis,
  *      Applications.}},
  *   booktitle = {Proceedings of the 16th ACM SIGKDD International Conference
  *      on Knowledge Discovery and Data Mining}
- *   series = {KDD '10},
+ *   series = {KDD 2010},
  *   year = {2010}
  * }
+ * @endcode
  *
- * @tparam TreeType Type of tree to use.
+ * General usage of this class might be like this:
+ *
+ * @code
+ * extern arma::mat data; // We want to find the MST of this dataset.
+ * DualTreeBoruvka<> dtb(data); // Create the tree with default options.
+ *
+ * // Find the MST.
+ * arma::mat mstResults;
+ * dtb.ComputeMST(mstResults);
+ * @endcode
+ *
+ * More advanced usage of the class can use different types of trees, pass in an
+ * already-built tree, or compute the MST using the O(n^2) naive algorithm.
+ *
+ * @tparam TreeType Type of tree to use.  Should use DTBStat as a statistic.
  */
 template<
   typename TreeType = tree::BinarySpaceTree<bound::HRectBound<2>, DTBStat>
@@ -108,7 +124,7 @@
   bool naive;
 
   //! Edges.
-  std::vector<EdgePair> edges; // must use vector with non-numerical types
+  std::vector<EdgePair> edges; // We must use vector with non-numerical types.
 
   //! Connections.
   UnionFind connections;

Modified: mlpack/trunk/src/mlpack/methods/emst/union_find.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/emst/union_find.hpp	2011-12-14 13:24:30 UTC (rev 10780)
+++ mlpack/trunk/src/mlpack/methods/emst/union_find.hpp	2011-12-14 13:33:02 UTC (rev 10781)
@@ -16,7 +16,11 @@
 namespace emst {
 
 /**
- * A Union-Find data structure.  See Cormen, Rivest, & Stein for details.
+ * A Union-Find data structure.  See Cormen, Rivest, & Stein for details.  The
+ * structure tracks the components of a graph.  Each point in the graph is
+ * initially in its own component.  Calling Union(x, y) unites the components
+ * indexed by x and y.  Find(x) returns the index of the component containing
+ * point x.
  */
 class UnionFind
 {
@@ -26,6 +30,7 @@
   arma::ivec rank;
 
  public:
+  //! Construct the object with the given size.
   UnionFind(const size_t size) : size(size), parent(size), rank(size)
   {
     for (size_t i = 0; i < size; ++i)
@@ -35,7 +40,8 @@
     }
   }
 
-  ~UnionFind() {}
+  //! Destroy the object (nothing to do).
+  ~UnionFind() { }
 
   /**
    * Returns the component containing an element.




More information about the mlpack-svn mailing list