[mlpack-svn] r16210 - in mlpack/trunk: . src/mlpack/core/metrics src/mlpack/core/optimizers/aug_lagrangian src/mlpack/core/optimizers/lbfgs src/mlpack/core/optimizers/lrsdp src/mlpack/core/optimizers/sgd src/mlpack/core/tree src/mlpack/core/tree/binary_space_tree src/mlpack/methods/det src/mlpack/methods/emst src/mlpack/methods/fastmks src/mlpack/methods/hmm src/mlpack/methods/nca src/mlpack/tests

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Feb 4 17:54:00 EST 2014


Author: birm
Date: Tue Feb  4 17:54:00 2014
New Revision: 16210

Log:
Some ToString added, some updated (typos and indent). Test updated.


Modified:
   mlpack/trunk/   (props changed)
   mlpack/trunk/src/mlpack/core/metrics/ip_metric_impl.hpp
   mlpack/trunk/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_function_impl.hpp
   mlpack/trunk/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_impl.hpp
   mlpack/trunk/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp
   mlpack/trunk/src/mlpack/core/optimizers/lrsdp/lrsdp.hpp
   mlpack/trunk/src/mlpack/core/optimizers/lrsdp/lrsdp_impl.hpp
   mlpack/trunk/src/mlpack/core/optimizers/sgd/sgd_impl.hpp
   mlpack/trunk/src/mlpack/core/tree/ballbound_impl.hpp
   mlpack/trunk/src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp
   mlpack/trunk/src/mlpack/methods/det/dtree.cpp
   mlpack/trunk/src/mlpack/methods/det/dtree.hpp
   mlpack/trunk/src/mlpack/methods/emst/dtb.hpp
   mlpack/trunk/src/mlpack/methods/emst/dtb_impl.hpp
   mlpack/trunk/src/mlpack/methods/fastmks/fastmks.hpp
   mlpack/trunk/src/mlpack/methods/fastmks/fastmks_impl.hpp
   mlpack/trunk/src/mlpack/methods/hmm/hmm.hpp
   mlpack/trunk/src/mlpack/methods/hmm/hmm_impl.hpp
   mlpack/trunk/src/mlpack/methods/nca/nca_softmax_error_function_impl.hpp
   mlpack/trunk/src/mlpack/tests/to_string_test.cpp

Modified: mlpack/trunk/src/mlpack/core/metrics/ip_metric_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/metrics/ip_metric_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/metrics/ip_metric_impl.hpp	Tue Feb  4 17:54:00 2014
@@ -58,7 +58,7 @@
 std::string IPMetric<KernelType>::ToString() const{
   std::ostringstream convert;
   convert << "IPMetric [" << this << "]" << std::endl;
-  convert << "Kernel: " << localKernel << std::endl;
+  convert << "  Kernel address: " << localKernel << std::endl;
   return convert.str();
 }
 

Modified: mlpack/trunk/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_function_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_function_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_function_impl.hpp	Tue Feb  4 17:54:00 2014
@@ -100,8 +100,8 @@
 std::string AugLagrangianFunction<LagrangianFunction>::ToString() const{
   std::ostringstream convert;
   convert << "AugLagrangianFunction [" << this << "]" << std::endl;
-  convert << "Lagrange multipliers: " << lambda << std::endl;
-  convert << "Penalty parameter: " << sigma << std::endl;
+  convert << "  Lagrange multipliers: " << lambda << std::endl;
+  convert << "  Penalty parameter: " << sigma << std::endl;
   return convert.str();
 }
 

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	Tue Feb  4 17:54:00 2014
@@ -55,8 +55,8 @@
   std::ostringstream convert;
   convert << "AugLagrangian [" << this << "]" << std::endl;
   // Fix this! Why Only log? Ostream is lonely.
-  Log::Debug  << "Function to be Oprimized: " << function << std::endl;
-  //Log::Debug << "L-BFGS Selected: " << lbfgs << std::endl;
+  Log::Debug  << "  Function to be Optimized: " << function << std::endl;
+  Log::Debug << "L-BFGS Selected: " << lbfgs << std::endl;
   return convert.str();
 }
 

Modified: mlpack/trunk/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp	Tue Feb  4 17:54:00 2014
@@ -425,15 +425,15 @@
 std::string L_BFGS<FunctionType>::ToString() const{
   std::ostringstream convert;
   convert << "L_BFGS [" << this << "]" << std::endl;
-  convert << "Memory Size: " << numBasis << std::endl;
-  convert << "Cube Size" << s.n_rows << "x" << s.n_cols << "x" << s.n_slices;
+  convert << "  Memory Size: " << numBasis << std::endl;
+  convert << "  Cube Size" << s.n_rows << "x" << s.n_cols << "x" << s.n_slices;
   convert << std::endl;
-  convert << "Maximum Iterations: " << maxIterations << std::endl;
-  convert << "Armijo condition Parameter: " << armijoConstant << std::endl;
-  convert << "Wolfe Parameter: " << wolfe << std::endl;
-  convert << "Minimum Gradient: " << minGradientNorm << std::endl;
-  convert << "Minimum Step of Line Search: " << minStep << std::endl;
-  convert << "Maximum Step of Line Search: " << maxStep << std::endl;
+  convert << "  Maximum Iterations: " << maxIterations << std::endl;
+  convert << "  Armijo condition Parameter: " << armijoConstant << std::endl;
+  convert << "  Wolfe Parameter: " << wolfe << std::endl;
+  convert << "  Minimum Gradient: " << minGradientNorm << std::endl;
+  convert << "  Minimum Step of Line Search: " << minStep << std::endl;
+  convert << "  Maximum Step of Line Search: " << maxStep << std::endl;
   return convert.str();
 }
 

Modified: mlpack/trunk/src/mlpack/core/optimizers/lrsdp/lrsdp.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/optimizers/lrsdp/lrsdp.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/optimizers/lrsdp/lrsdp.hpp	Tue Feb  4 17:54:00 2014
@@ -116,6 +116,9 @@
   //! Modify the augmented Lagrangian object.
   AugLagrangian<LRSDP>& AugLag() { return augLag; }
 
+  // convert the obkect into a string
+  std::string ToString() const;
+
  private:
   // Should probably use sparse matrices for some of these.
 
@@ -147,3 +150,4 @@
 #include "lrsdp_impl.hpp"
 
 #endif
+

Modified: mlpack/trunk/src/mlpack/core/optimizers/lrsdp/lrsdp_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/optimizers/lrsdp/lrsdp_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/optimizers/lrsdp/lrsdp_impl.hpp	Tue Feb  4 17:54:00 2014
@@ -14,6 +14,17 @@
 namespace mlpack {
 namespace optimization {
 
+// convert the object to a string
+std::string LRSDP::ToString() const{
+  std::ostringstream convert;
+  convert << "LRSDP [" << this << "]" << std::endl;
+  convert << "Matrix Size: " << c.n_rows << "x" << c.n_cols << std::endl;
+  convert << "Initial point Size : " << initialPoint.n_rows << "x" 
+      << initialPoint.n_cols << std::endl;
+  //convert << "AugLagrangian Info: " << std::endl << augLag;
+  return convert.str();
+}
+
 // Custom specializations of the AugmentedLagrangianFunction for the LRSDP case.
 template<>
 double AugLagrangianFunction<LRSDP>::Evaluate(const arma::mat& coordinates)
@@ -107,3 +118,4 @@
 }; // namespace mlpack
 
 #endif
+

Modified: mlpack/trunk/src/mlpack/core/optimizers/sgd/sgd_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/optimizers/sgd/sgd_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/optimizers/sgd/sgd_impl.hpp	Tue Feb  4 17:54:00 2014
@@ -103,11 +103,12 @@
   std::ostringstream convert;
   convert << "SGD [" << this << "]" << std::endl;
   // Fix this! Why Only log? Ostream is lonely.
-  Log::Debug << "Function: " << function << std::endl;
-  convert << "StepSize: " << stepSize << std::endl;
-  convert << "Maximum Iterations: " << maxIterations << std::endl;
-  convert << "Tolerance: " << tolerance << std::endl;
-  convert << "Shuffle: " << shuffle << std::endl;
+  Log::Debug << "  Function: " << function << std::endl;
+  convert << "  StepSize: " << stepSize << std::endl;
+  convert << "  Maximum Iterations: " << maxIterations << std::endl;
+  convert << "  Tolerance: " << tolerance << std::endl;
+  convert << "  Shuffle: " << shuffle << std::endl;
+  convert << std::endl;
   return convert.str();
 }
 

Modified: mlpack/trunk/src/mlpack/core/tree/ballbound_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/tree/ballbound_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/tree/ballbound_impl.hpp	Tue Feb  4 17:54:00 2014
@@ -198,8 +198,8 @@
 {
   std::ostringstream convert;
   convert << "BallBound [" << this << "]" << std::endl;
-  convert << "Radius:  " << radius << std::endl;
-  convert << "Center:  " << std::endl << center;
+  convert << "  Radius:  " << radius << std::endl;
+  convert << "  Center:  " << center << std::endl;
   return convert.str();
 }
 

Modified: mlpack/trunk/src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp	Tue Feb  4 17:54:00 2014
@@ -678,12 +678,12 @@
 {
   std::ostringstream convert;
   convert << "BinarySpaceTree [" << this << "]" << std::endl;
-  convert << "begin: " << begin << std::endl;
-  convert << "count: " << count << std::endl;
-  convert << "bound: " << mlpack::util::Indent(bound.ToString());
-  convert << "statistic: " << stat.ToString();
-  convert << "leaf size: " << leafSize << std::endl;
-  convert << "splitDimension: " << splitDimension << std::endl;
+  convert << "  begin: " << begin << std::endl;
+  convert << "  count: " << count << std::endl;
+  convert << "  bound: " << mlpack::util::Indent(bound.ToString());
+  convert << "  statistic: " << stat.ToString();
+  convert << "  leaf size: " << leafSize << std::endl;
+  convert << "  splitDimension: " << splitDimension << std::endl;
   if (left != NULL)
   {
     convert << "left:" << std::endl;

Modified: mlpack/trunk/src/mlpack/methods/det/dtree.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/det/dtree.cpp	(original)
+++ mlpack/trunk/src/mlpack/methods/det/dtree.cpp	Tue Feb  4 17:54:00 2014
@@ -665,3 +665,19 @@
     nodes.push(curNode.Right());
   }
 }
+
+// Return string of object. 
+std::string DTree::ToString() const
+{
+  std::ostringstream convert;
+  convert << "Density Estimation Tree [" << this << "]" << std::endl;
+  convert << "  Start Node Index: " << start <<std::endl;
+  convert << "  End Node Index: " << end <<std::endl;
+  convert << "  Node Information:" << std::endl;
+  convert << "    Splitting Dimension: " << splitDim << std::endl;
+  convert << "    Splitting Value: " << splitValue << std::endl;
+  convert << "    Is Root: " << root << std::endl;
+  convert << "    # of points in Node to Total # of points" << ratio ;
+  convert << std::endl;
+  return convert.str();
+}

Modified: mlpack/trunk/src/mlpack/methods/det/dtree.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/det/dtree.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/det/dtree.hpp	Tue Feb  4 17:54:00 2014
@@ -278,6 +278,11 @@
   //! Modify the minimum values.
   arma::vec& MinVals() { return minVals; }
 
+  /**
+   * Returns a string representation of this object.
+   */
+  std::string ToString() const;
+
  private:
 
   // Utility methods.

Modified: mlpack/trunk/src/mlpack/methods/emst/dtb.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/emst/dtb.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/emst/dtb.hpp	Tue Feb  4 17:54:00 2014
@@ -169,6 +169,11 @@
    */
   void ComputeMST(arma::mat& results);
 
+  /**
+   * Returns a string representation of this object.
+   */
+  std::string ToString() const;
+
  private:
   /**
    * Adds a single edge to the edge list

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	Tue Feb  4 17:54:00 2014
@@ -294,6 +294,19 @@
   }
 }
 
+// convert the object to a string
+template<typename MetricType, typename TreeType>
+std::string DualTreeBoruvka<MetricType, TreeType>::ToString() const
+{
+  std::ostringstream convert;
+  convert << "Dual Tree Boruvka [" << this << "]" << std::endl;
+  //convert << "  Data: " << data.n_rows << "x" << data.n_cols <<std::endl;
+  //convert << "  Total Distance: " << totalDist <<std::endl;
+  //convert << "  Naive: " << naive << std::endl;
+  //convert << "  Metric" << metric << std::endl;
+  return convert.str();
+}
+
 }; // namespace emst
 }; // namespace mlpack
 

Modified: mlpack/trunk/src/mlpack/methods/fastmks/fastmks.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/fastmks/fastmks.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/fastmks/fastmks.hpp	Tue Feb  4 17:54:00 2014
@@ -179,6 +179,11 @@
   //! Modify the inner-product metric induced by the given kernel.
   metric::IPMetric<KernelType>& Metric() { return metric; }
 
+  /**
+   * Returns a string representation of this object.
+   */
+  std::string ToString() const;
+
  private:
   //! The reference dataset.
   const arma::mat& referenceSet;

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	Tue Feb  4 17:54:00 2014
@@ -300,6 +300,18 @@
   indices(pos, queryIndex) = neighbor;
 }
 
+// Return string of object.
+template<typename KernelType, typename TreeType>
+std::string FastMKS<KernelType, TreeType>::ToString() const
+{
+  std::ostringstream convert;
+  convert << "FastMKS [" << this << "]" << std::endl;
+  convert << "  Naive: " << naive << std::endl;
+  convert << "  Single: " << single << std::endl;
+  Log::Debug << "  Metric: " << metric << std::endl;
+  return convert.str();
+}
+
 // Specialized implementation for tighter bounds for Gaussian.
 /*
 template<>

Modified: mlpack/trunk/src/mlpack/methods/hmm/hmm.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/hmm/hmm.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/hmm/hmm.hpp	Tue Feb  4 17:54:00 2014
@@ -270,6 +270,11 @@
   //! Modify the tolerance of the Baum-Welch algorithm.
   double& Tolerance() { return tolerance; }
 
+  /**
+   * Returns a string representation of this object.
+   */
+  std::string ToString() const;
+
  private:
   // Helper functions.
 

Modified: mlpack/trunk/src/mlpack/methods/hmm/hmm_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/hmm/hmm_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/hmm/hmm_impl.hpp	Tue Feb  4 17:54:00 2014
@@ -489,6 +489,18 @@
   }
 }
 
+template<typename Distribution>
+std::string HMM<Distribution>::ToString() const
+{
+  std::ostringstream convert;
+  convert << "HMM [" << this << "]" << std::endl;
+  convert << "  Dimensionality: " << Dimensionality <<std::endl;
+  convert << "  Tolerance: " << Tolerance <<std::endl;
+  convert << "  Transition matrix: " << transition.n_rows << "x" ;
+  convert << transition.n_cols << std::endl;
+  return convert.str();
+}
+
 }; // namespace hmm
 }; // namespace mlpack
 

Modified: mlpack/trunk/src/mlpack/methods/nca/nca_softmax_error_function_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/nca/nca_softmax_error_function_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/nca/nca_softmax_error_function_impl.hpp	Tue Feb  4 17:54:00 2014
@@ -271,11 +271,11 @@
 std::string SoftmaxErrorFunction<MetricType>::ToString() const{
   std::ostringstream convert;
   convert << "Sofmax Error Function [" << this << "]" << std::endl;
-  convert << "Dataset: " << dataset.n_rows << "x" << dataset.n_cols 
+  convert << "  Dataset: " << dataset.n_rows << "x" << dataset.n_cols 
       << std::endl;
-  convert << "Labels: " << labels.n_elem << std::endl;
+  convert << "  Labels: " << labels.n_elem << std::endl;
   //convert << "Metric: " << metric << std::endl;
-  convert << "Precalculated: " << precalculated << std::endl;
+  convert << "  Precalculated: " << precalculated << std::endl;
   return convert.str();
 }
 

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	Tue Feb  4 17:54:00 2014
@@ -33,6 +33,11 @@
 #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>
+#include <mlpack/methods/fastmks/fastmks.hpp>
+#include <mlpack/methods/gmm/gmm.hpp>
 
 using namespace mlpack;
 using namespace mlpack::kernel;
@@ -49,61 +54,81 @@
 BOOST_AUTO_TEST_CASE(DiscreteDistributionString)
 {
   DiscreteDistribution d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(GaussianDistributionString)
 {
   GaussianDistribution d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(CosineDistanceString)
 {
   CosineDistance d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(EpanechnikovKernelString)
 {
   EpanechnikovKernel d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(ExampleKernelString)
 {
   ExampleKernel d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(GaussianKernelString)
 {
   GaussianKernel d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(HyperbolicTangentKernelString)
 {
   HyperbolicTangentKernel d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(LaplacianKernelString)
 {
   LaplacianKernel d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(LinearKernelString)
 {
   LinearKernel d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(PolynomialKernelString)
 {
   PolynomialKernel d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(PSpectrumStringKernelString)
@@ -111,37 +136,49 @@
   const std::vector<std::vector<std::string> > s;
   const size_t t=1;
   PSpectrumStringKernel d(s,t);
-  Log::Info << d;
+  Log::Debug << d;
+  std::string sttm = d.ToString();
+  BOOST_REQUIRE_NE(sttm, "");
 }
 
 BOOST_AUTO_TEST_CASE(SphericalKernelString)
 {
   SphericalKernel d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(TriangularKernelString)
 {
   TriangularKernel d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(IPMetricString)
 {
   IPMetric<TriangularKernel> d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(LMetricString)
 {
   LMetric<1> d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(MahalanobisDistanceString)
 {
   MahalanobisDistance<> d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(SGDString)
@@ -150,7 +187,9 @@
   const arma::Col<size_t> v(2);
   SoftmaxErrorFunction<> a(g,v);
 	mlpack::optimization::SGD<SoftmaxErrorFunction<> > d(a);
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(L_BFGSString)
@@ -159,7 +198,9 @@
   const arma::Col<size_t> v(2);
   SoftmaxErrorFunction<> a(g,v);
 	mlpack::optimization::L_BFGS<SoftmaxErrorFunction<> > d(a);
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(AugLagString)
@@ -169,13 +210,77 @@
       <mlpack::optimization::AugLagrangianTestFunction> q(a);
 	mlpack::optimization::AugLagrangian 
       <mlpack::optimization::AugLagrangianTestFunction> d(a);
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
 }
 
 BOOST_AUTO_TEST_CASE(BallBoundString)
 {
   BallBound<> d;
-  Log::Info << d;
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+BOOST_AUTO_TEST_CASE(BinSpaceString)
+{  
+  arma::mat q(2,2);
+  q.randu();
+  BinarySpaceTree<HRectBound<1> > d(q);
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+/**
+BOOST_AUTO_TEST_CASE(CFString)
+{ 
+  arma::mat c(10,10);
+  mlpack::cf::CF d(c);
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+**/
+BOOST_AUTO_TEST_CASE(DetString)
+{ 
+  arma::mat c(4,4);
+  c.randn(); 
+  mlpack::det::DTree d(c);
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+BOOST_AUTO_TEST_CASE(EmstString)
+{ 
+  arma::mat c(4,4);
+  c.randn(); 
+  mlpack::emst::DualTreeBoruvka<> d(c);
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+BOOST_AUTO_TEST_CASE(FastMKSString)
+{ 
+  arma::mat c(4,4);
+  c.randn();
+  mlpack::fastmks::FastMKS<LinearKernel> d(c);
+  Log::Debug << d;
+  std::string s = d.ToString();
+  BOOST_REQUIRE_NE(s, "");
+}
+
+BOOST_AUTO_TEST_CASE(GMMString)
+{ 
+  arma::mat c(400,40);
+  c.randn();
+  mlpack::gmm::GMM<> d(5, 4);
+  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