[mlpack-svn] r16233 - in mlpack/trunk/src/mlpack: core/optimizers/aug_lagrangian methods/emst methods/fastmks methods/kernel_pca methods/kmeans methods/lsh methods/nca methods/neighbor_search methods/nmf methods/pca methods/radical methods/range_search tests

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu Feb 6 19:48:55 EST 2014


Author: birm
Date: Thu Feb  6 19:48:55 2014
New Revision: 16233

Log:
Added more ToString, updated test, took advantage of new tab function.


Modified:
   mlpack/trunk/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_impl.hpp
   mlpack/trunk/src/mlpack/methods/emst/dtb_impl.hpp
   mlpack/trunk/src/mlpack/methods/fastmks/fastmks_impl.hpp
   mlpack/trunk/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp
   mlpack/trunk/src/mlpack/methods/kmeans/kmeans_impl.hpp
   mlpack/trunk/src/mlpack/methods/lsh/lsh_search_impl.hpp
   mlpack/trunk/src/mlpack/methods/nca/nca.hpp
   mlpack/trunk/src/mlpack/methods/nca/nca_impl.hpp
   mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search.hpp
   mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search_impl.hpp
   mlpack/trunk/src/mlpack/methods/nmf/nmf.hpp
   mlpack/trunk/src/mlpack/methods/nmf/nmf_impl.hpp
   mlpack/trunk/src/mlpack/methods/pca/pca.cpp
   mlpack/trunk/src/mlpack/methods/pca/pca.hpp
   mlpack/trunk/src/mlpack/methods/radical/radical.cpp
   mlpack/trunk/src/mlpack/methods/radical/radical.hpp
   mlpack/trunk/src/mlpack/methods/range_search/range_search.hpp
   mlpack/trunk/src/mlpack/methods/range_search/range_search_impl.hpp
   mlpack/trunk/src/mlpack/tests/to_string_test.cpp

Modified: mlpack/trunk/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -54,9 +54,10 @@
 std::string AugLagrangian<LagrangianFunction>::ToString() const{
   std::ostringstream convert;
   convert << "AugLagrangian [" << this << "]" << std::endl;
-  // Fix this! Why Only log? Ostream is lonely.
-  Log::Debug  << "  Function to be Optimized: " << function << std::endl;
-  Log::Debug << "L-BFGS Selected: " << lbfgs << std::endl;
+  convert << "  Function to be Optimized: " <<std::endl;
+  convert << mlpack::util::Indent(function.ToString(),2);
+  convert << "    L-BFGS Selected: " <<std::endl; 
+  convert << mlpack::util::Indent(lbfgs.ToString(),2);
   return convert.str();
 }
 

Modified: mlpack/trunk/src/mlpack/methods/emst/dtb_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/emst/dtb_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/emst/dtb_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -304,7 +304,7 @@
   convert << "  Total Distance: " << totalDist <<std::endl;
   convert << "  Naive: " << naive << std::endl;
   convert << "  Metric: " << std::endl;
-  convert << mlpack::util::Indent(mlpack::util::Indent(metric.ToString()));
+  convert << mlpack::util::Indent(metric.ToString(),2);
   convert << std::endl;
   return convert.str();
 }

Modified: mlpack/trunk/src/mlpack/methods/fastmks/fastmks_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/fastmks/fastmks_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/fastmks/fastmks_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -309,7 +309,7 @@
   convert << "  Naive: " << naive << std::endl;
   convert << "  Single: " << single << std::endl;
   convert << "  Metric: " << std::endl;
-  convert << mlpack::util::Indent(mlpack::util::Indent(metric.ToString()));
+  convert << mlpack::util::Indent(metric.ToString(),2);
   convert << std::endl;
   return convert.str();
 }

Modified: mlpack/trunk/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -128,7 +128,7 @@
   convert << "KernelPCA [" << this << "]" << std::endl;
   convert << "  Center Transformed: " << centerTransformedData <<std::endl;
   convert << "  Kernel Type: " << std::endl;
-  convert <<  mlpack::util::Indent(mlpack::util::Indent(kernel.ToString()));
+  convert <<  mlpack::util::Indent(kernel.ToString(),2);
   convert << std::endl;
   return convert.str();
 }

Modified: mlpack/trunk/src/mlpack/methods/kmeans/kmeans_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/kmeans/kmeans_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/kmeans/kmeans_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -815,7 +815,7 @@
   convert << "  Overclustering Factor: " << overclusteringFactor <<std::endl;
   convert << "  Max Iterations: " << maxIterations <<std::endl;
   convert << "  Metric: " << std::endl;
-  convert << mlpack::util::Indent(mlpack::util::Indent(metric.ToString()));
+  convert << mlpack::util::Indent(metric.ToString(),2);
   convert << std::endl;
   return convert.str();
 }

Modified: mlpack/trunk/src/mlpack/methods/lsh/lsh_search_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/lsh/lsh_search_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/lsh/lsh_search_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -397,8 +397,8 @@
   convert << "LSHSearch [" << this << "]" << std::endl;
   convert << "  Reference Set: " << referenceSet.n_rows << "x" ;
   convert <<  referenceSet.n_cols << std::endl;
-  if (&referenceSet != & querySet)
-    convert << "  QueryeSet: " << querySet.n_rows << "x" << querySet.n_cols 
+  if (&referenceSet != &querySet)
+    convert << "  QuerySet: " << querySet.n_rows << "x" << querySet.n_cols 
         << std::endl;
   convert << "  Number of Projections: " << numProj << std::endl;
   convert << "  Number of Tables: " << numTables << std::endl;

Modified: mlpack/trunk/src/mlpack/methods/nca/nca.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/nca/nca.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/nca/nca.hpp	Thu Feb  6 19:48:55 2014
@@ -83,6 +83,9 @@
   OptimizerType<SoftmaxErrorFunction<MetricType> >& Optimizer()
   { return optimizer; }
 
+  // Returns a string representation of this object. 
+  std::string ToString() const;
+
  private:
   //! Dataset reference.
   const arma::mat& dataset;

Modified: mlpack/trunk/src/mlpack/methods/nca/nca_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/nca/nca_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/nca/nca_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -40,6 +40,19 @@
   Timer::Stop("nca_sgd_optimization");
 }
 
+template<typename MetricType, template<typename> class OptimizerType>
+std::string NCA<MetricType, OptimizerType>::ToString() const
+{
+  std::ostringstream convert;
+  convert << "NCA  [" << this << "]" << std::endl;
+  convert << "  Dataset: " << dataset.n_rows << "x" << dataset.n_cols 
+      << std::endl;
+  convert << "  Metric: " << std::endl << 
+      mlpack::util::Indent(metric.ToString(),2);
+  return convert.str();
+}
+
+
 }; // namespace nca
 }; // namespace mlpack
 

Modified: mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search.hpp	Thu Feb  6 19:48:55 2014
@@ -193,6 +193,9 @@
               arma::Mat<size_t>& resultingNeighbors,
               arma::mat& distances);
 
+  // Returns a string representation of this object. 
+  std::string ToString() const;
+
  private:
   //! Copy of reference dataset (if we need it, because tree building modifies
   //! it).

Modified: mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -287,4 +287,26 @@
   }
 } // Search
 
+
+//Return a String of the Object.
+template<typename SortPolicy, typename MetricType, typename TreeType>
+std::string NeighborSearch<SortPolicy, MetricType, TreeType>::ToString() const
+{
+  std::ostringstream convert;
+  convert << "NearestNeighborSearch [" << this << "]" << std::endl;
+  convert << "  Reference Set: " << referenceSet.n_rows << "x" ;
+  convert <<  referenceSet.n_cols << std::endl;
+  if (&referenceSet != &querySet)
+    convert << "  QuerySet: " << querySet.n_rows << "x" << querySet.n_cols 
+        << std::endl;
+  convert << "  Reference Tree: " << referenceTree << std::endl;
+  if (&referenceTree != &queryTree)
+    convert << "  QueryTree: " << queryTree << std::endl;
+  convert << "  Tree Owner: " << treeOwner << std::endl;
+  convert << "  Naive: " << naive << std::endl;
+  convert << "  Metric: " << std::endl;
+  convert << mlpack::util::Indent(metric.ToString(),2);
+  return convert.str();
+}
+
 #endif

Modified: mlpack/trunk/src/mlpack/methods/nmf/nmf.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/nmf/nmf.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/nmf/nmf.hpp	Thu Feb  6 19:48:55 2014
@@ -144,6 +144,9 @@
   //! Modify the H update rule.
   HUpdateRule& HUpdate() { return hUpdate; }
 
+  // Returns a string representation of this object. 
+  std::string ToString() const;
+
 }; // class NMF
 
 }; // namespace nmf

Modified: mlpack/trunk/src/mlpack/methods/nmf/nmf_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/nmf/nmf_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/nmf/nmf_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -94,5 +94,18 @@
       << iteration << " iterations." << std::endl;
 }
 
+//Return a String of the object
+template<typename InitializationRule,
+         typename WUpdateRule,
+         typename HUpdateRule>
+std::string NMF<InitializationRule, WUpdateRule, HUpdateRule>::ToString() const
+{
+  std::ostringstream convert;
+  convert << "Non negative matrix factorization [" << this << "]" << std::endl;
+  convert << "  Max Iterations: " << maxIterations << std::endl;
+  convert << "  Minimum Residue: " << minResidue<< std::endl;
+  return convert.str();
+}
+
 }; // namespace nmf
 }; // namespace mlpack

Modified: mlpack/trunk/src/mlpack/methods/pca/pca.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/pca/pca.cpp	(original)
+++ mlpack/trunk/src/mlpack/methods/pca/pca.cpp	Thu Feb  6 19:48:55 2014
@@ -169,3 +169,13 @@
 
   return varSum;
 }
+
+// return a string of this object.
+std::string PCA::ToString() const
+{
+  std::ostringstream convert;
+  convert << "Principal Component Analysis  [" << this << "]" << std::endl;
+  if (scaleData)  
+    convert << "  Scaling Data: TRUE" << std::endl;
+  return convert.str();
+}

Modified: mlpack/trunk/src/mlpack/methods/pca/pca.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/pca/pca.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/pca/pca.hpp	Thu Feb  6 19:48:55 2014
@@ -100,6 +100,9 @@
   //! the data when PCA is performed.
   bool& ScaleData() { return scaleData; }
 
+  // Returns a string representation of this object. 
+  std::string ToString() const;
+
  private:
   //! Whether or not the data will be scaled by standard deviation when PCA is
   //! performed.

Modified: mlpack/trunk/src/mlpack/methods/radical/radical.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/radical/radical.cpp	(original)
+++ mlpack/trunk/src/mlpack/methods/radical/radical.cpp	Thu Feb  6 19:48:55 2014
@@ -184,3 +184,15 @@
   matWhitening = matU * diagmat(1 / sqrt(s)) * trans(matV);
   matXWhitened = matX * matWhitening;
 }
+
+// return a string of this object.
+std::string Radical::ToString() const
+{
+  std::ostringstream convert;
+  convert << "Radical  [" << this << "]" << std::endl;
+  convert << "  StdDev of Noise: " << noiseStdDev << std::endl;
+  convert << "  Number of Replicates: " << replicates << std::endl;
+  convert << "  Number of Angles: " << angles << std::endl;
+  convert << "  M value: " << m << std::endl;
+  return convert.str();
+}

Modified: mlpack/trunk/src/mlpack/methods/radical/radical.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/radical/radical.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/radical/radical.hpp	Thu Feb  6 19:48:55 2014
@@ -106,6 +106,9 @@
   //! Modify the number of sweeps.
   size_t& Sweeps() { return sweeps; }
 
+  // Returns a string representation of this object. 
+  std::string ToString() const;
+
  private:
   //! Standard deviation of the Gaussian noise added to the replicates of
   //! the data points during Radical2D.

Modified: mlpack/trunk/src/mlpack/methods/range_search/range_search.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/range_search/range_search.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/range_search/range_search.hpp	Thu Feb  6 19:48:55 2014
@@ -186,6 +186,9 @@
               std::vector<std::vector<size_t> >& neighbors,
               std::vector<std::vector<double> >& distances);
 
+  // Returns a string representation of this object. 
+  std::string ToString() const;
+
  private:
   //! Copy of reference matrix; used when a tree is built internally.
   typename TreeType::Mat referenceCopy;

Modified: mlpack/trunk/src/mlpack/methods/range_search/range_search_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/range_search/range_search_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/range_search/range_search_impl.hpp	Thu Feb  6 19:48:55 2014
@@ -277,6 +277,20 @@
   }
 }
 
+template<typename MetricType, typename TreeType>
+std::string RangeSearch<MetricType, TreeType>::ToString() const
+{
+  std::ostringstream convert;
+  convert << "Range Search  [" << this << "]" << std::endl;
+  if (treeOwner)  
+    convert << "  Tree Owner: TRUE" << std::endl;
+  if (naive)  
+    convert << "  Naive: TRUE" << std::endl;
+  convert << "  Metric: " << std::endl << 
+      mlpack::util::Indent(metric.ToString(),2);
+  return convert.str();
+}
+
 }; // namespace range
 }; // namespace mlpack
 

Modified: mlpack/trunk/src/mlpack/tests/to_string_test.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/tests/to_string_test.cpp	(original)
+++ mlpack/trunk/src/mlpack/tests/to_string_test.cpp	Thu Feb  6 19:48:55 2014
@@ -33,6 +33,7 @@
 #include <mlpack/core/tree/hrectbound.hpp>
 #include <mlpack/core/tree/periodichrectbound.hpp>
 #include <mlpack/core/tree/statistic.hpp>
+
 #include <mlpack/methods/cf/cf.hpp>
 #include <mlpack/methods/det/dtree.hpp>
 #include <mlpack/methods/emst/dtb.hpp>
@@ -46,6 +47,12 @@
 #include <mlpack/methods/local_coordinate_coding/lcc.hpp>
 #include <mlpack/methods/logistic_regression/logistic_regression.hpp>
 #include <mlpack/methods/lsh/lsh_search.hpp>
+#include <mlpack/methods/neighbor_search/neighbor_search.hpp>
+#include <mlpack/methods/nmf/nmf.hpp>
+#include <mlpack/methods/nca/nca.hpp>
+#include <mlpack/methods/pca/pca.hpp>
+#include <mlpack/methods/radical/radical.hpp>
+#include <mlpack/methods/range_search/range_search.hpp>
 
 using namespace mlpack;
 using namespace mlpack::kernel;
@@ -191,9 +198,9 @@
 
 BOOST_AUTO_TEST_CASE(SGDString)
 {
-  const arma::mat g(2,2);
+  const arma::mat g(2, 2);
   const arma::Col<size_t> v(2);
-  SoftmaxErrorFunction<> a(g,v);
+  SoftmaxErrorFunction<> a(g, v);
 	mlpack::optimization::SGD<SoftmaxErrorFunction<> > d(a);
   Log::Debug << d;
   std::string s = d.ToString();
@@ -202,9 +209,9 @@
 
 BOOST_AUTO_TEST_CASE(L_BFGSString)
 {
-  const arma::mat g(2,2);
+  const arma::mat g(2, 2);
   const arma::Col<size_t> v(2);
-  SoftmaxErrorFunction<> a(g,v);
+  SoftmaxErrorFunction<> a(g, v);
 	mlpack::optimization::L_BFGS<SoftmaxErrorFunction<> > d(a);
   Log::Debug << d;
   std::string s = d.ToString();
@@ -233,7 +240,7 @@
 
 BOOST_AUTO_TEST_CASE(BinSpaceString)
 {
-  arma::mat q(2,2);
+  arma::mat q(2, 2);
   q.randu();
   BinarySpaceTree<HRectBound<1> > d(q);
   Log::Debug << d;
@@ -244,7 +251,7 @@
 BOOST_AUTO_TEST_CASE(CFString)
 {
   size_t a = 1 ;
-  arma::mat c(3,3);
+  arma::mat c(3, 3);
   c(0, 0) = 1;
   c(0, 1) = 2;
   c(0, 2) = 1.5;
@@ -254,7 +261,7 @@
   c(2, 0) = 1;
   c(2, 1) = 3;
   c(2, 2) = 0.7;
-  mlpack::cf::CF d(a,a,c);
+  mlpack::cf::CF d(a, a, c);
   Log::Debug << d;
   std::string s = d.ToString();
   BOOST_REQUIRE_NE(s, "");
@@ -262,7 +269,7 @@
 
 BOOST_AUTO_TEST_CASE(DetString)
 {
-  arma::mat c(4,4);
+  arma::mat c(4, 4);
   c.randn();
   mlpack::det::DTree d(c);
   Log::Debug << d;
@@ -272,7 +279,7 @@
 
 BOOST_AUTO_TEST_CASE(EmstString)
 {
-  arma::mat c(4,4);
+  arma::mat c(4, 4);
   c.randu();
   mlpack::emst::DualTreeBoruvka<> d(c);
   Log::Debug << d;
@@ -282,7 +289,7 @@
 
 BOOST_AUTO_TEST_CASE(FastMKSString)
 {
-  arma::mat c(4,4);
+  arma::mat c(4, 4);
   c.randn();
   mlpack::fastmks::FastMKS<LinearKernel> d(c);
   Log::Debug << d;
@@ -292,7 +299,7 @@
 
 BOOST_AUTO_TEST_CASE(GMMString)
 {
-  arma::mat c(400,40);
+  arma::mat c(400, 40);
   c.randn();
   mlpack::gmm::GMM<> d(5, 4);
   Log::Debug << d;
@@ -302,7 +309,7 @@
 
 BOOST_AUTO_TEST_CASE(HMMString)
 {
-  mlpack::hmm::HMM<> d(5,4);
+  mlpack::hmm::HMM<> d(5, 4);
   Log::Debug << d;
   std::string s = d.ToString();
   BOOST_REQUIRE_NE(s, "");
@@ -311,7 +318,7 @@
 BOOST_AUTO_TEST_CASE(KPCAString)
 {
   LinearKernel k;
-  mlpack::kpca::KernelPCA<LinearKernel> d(k,false);
+  mlpack::kpca::KernelPCA<LinearKernel> d(k, false);
   Log::Debug << d;
   std::string s = d.ToString();
   BOOST_REQUIRE_NE(s, "");
@@ -335,11 +342,11 @@
 
 BOOST_AUTO_TEST_CASE(LinRegString)
 {
-  arma::mat c(40,40);
-  arma::mat b(40,1);
+  arma::mat c(40, 40);
+  arma::mat b(40, 1);
   c.randn();
   b.randn();
-  mlpack::regression::LinearRegression d(c,b);
+  mlpack::regression::LinearRegression d(c, b);
   Log::Debug << d;
   std::string s = d.ToString();
   BOOST_REQUIRE_NE(s, "");
@@ -351,7 +358,7 @@
   const size_t b=3;
   const double a=1;
   c.randn();
-  mlpack::lcc::LocalCoordinateCoding<> d(c,b,a);
+  mlpack::lcc::LocalCoordinateCoding<> d(c, b, a);
   Log::Debug << d;
   std::string s = d.ToString();
   BOOST_REQUIRE_NE(s, "");
@@ -359,18 +366,19 @@
 
 BOOST_AUTO_TEST_CASE(LogRegString)
 {
-  arma::mat c(40,40);
-  arma::mat b(40,1);
+  arma::mat c(40, 40);
+  arma::mat b(40, 1);
   c.randn();
   b.randn();
-  mlpack::regression::LogisticRegression<> d(c,b);
+  mlpack::regression::LogisticRegression<> d(c, b);
   Log::Debug << d;
   std::string s = d.ToString();
   BOOST_REQUIRE_NE(s, "");
 }
+
 BOOST_AUTO_TEST_CASE(LSHString)
 {
-  arma::mat c(40,40);
+  arma::mat c(40, 40);
   const size_t b=3;
   c.randn();
   mlpack::neighbor::LSHSearch<NearestNeighborSort> d(c, b, b);
@@ -379,4 +387,61 @@
   BOOST_REQUIRE_NE(s, "");
 }
 
+BOOST_AUTO_TEST_CASE(NeighborString)
+{
+  arma::mat c(40, 40);
+  c.randn();
+  mlpack::neighbor::NeighborSearch<> d(c, c);
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+BOOST_AUTO_TEST_CASE(NMFString)
+{
+  arma::mat c(40, 40);
+  c.randn();
+  mlpack::nmf::NMF<> d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+BOOST_AUTO_TEST_CASE(NCAString)
+{
+  arma::mat c(40, 40);
+  arma::Col<size_t> b(3);
+  c.randn();
+  mlpack::nca::NCA<> d(c, b);
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+BOOST_AUTO_TEST_CASE(PCAString)
+{
+  mlpack::pca::PCA d(true);
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+BOOST_AUTO_TEST_CASE(RadicalString)
+{
+  mlpack::radical::Radical d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+BOOST_AUTO_TEST_CASE(RangeSearchString)
+{
+  arma::mat c(40, 40);
+  c.randn();
+  mlpack::range::RangeSearch<> d(c);
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
 BOOST_AUTO_TEST_SUITE_END();



More information about the mlpack-svn mailing list