[mlpack-git] master: Add some debugging output. This makes it a bit easier to figure out what is going wrong. (b094362)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 12 16:02:22 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/eddd7167d69b6c88b271ef2e51d1c20e13f1acd8...70342dd8e5c17e0c164cfb8189748671e9c0dd44

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

commit b094362c2b396e75c1a2e39d30314dfa1dbdc606
Author: Ryan Curtin <ryan at ratml.org>
Date:   Thu Jan 29 16:51:18 2015 -0500

    Add some debugging output. This makes it a bit easier to figure out what is going wrong.


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

b094362c2b396e75c1a2e39d30314dfa1dbdc606
 src/mlpack/methods/kmeans/dual_tree_kmeans_statistic.hpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/mlpack/methods/kmeans/dual_tree_kmeans_statistic.hpp b/src/mlpack/methods/kmeans/dual_tree_kmeans_statistic.hpp
index 8d762fd..01fa6bc 100644
--- a/src/mlpack/methods/kmeans/dual_tree_kmeans_statistic.hpp
+++ b/src/mlpack/methods/kmeans/dual_tree_kmeans_statistic.hpp
@@ -131,6 +131,20 @@ class DualTreeKMeansStatistic
   //! Modify the last distance calculation.
   double& LastDistance() { return lastDistance; }
 
+  std::string ToString() const
+  {
+    std::ostringstream convert;
+    convert << "DualTreeKMeansStatistic [" << this << "]" << std::endl;
+    convert << "  minQueryNodeDistance: " << minQueryNodeDistance << ".\n";
+    convert << "  maxQueryNodeDistance: " << maxQueryNodeDistance << ".\n";
+    convert << "  secondMinQueryNodeDistance: " << secondMinQueryNodeDistance << ".\n";
+    convert << "  secondMaxQueryNodeDistance: " << secondMaxQueryNodeDistance << ".\n";
+    convert << "  hamerlyPruned: " << hamerlyPruned << ".\n";
+    convert << "  lastSecondClosestBound: " << lastSecondClosestBound << ".\n";
+    convert << "  clustersPruned: " << clustersPruned << ".\n";
+    return convert.str();
+  }
+
  private:
   //! The empirically calculated centroid of the node.
   arma::vec centroid;



More information about the mlpack-git mailing list