[mlpack-svn] [MLPACK] #164: Standardized concept for class output to Log

MLPACK Trac trac at coffeetalk-1.cc.gatech.edu
Mon Aug 27 18:49:45 EDT 2012

#164: Standardized concept for class output to Log
  Reporter:  rcurtin                                  |        Owner:  trironk3    
      Type:  wishlist                                 |       Status:  accepted    
  Priority:  major                                    |    Milestone:  mlpack 1.1.0
 Component:  mlpack                                   |   Resolution:              
  Keywords:  mlpack output model type consistent api  |     Blocking:              
Blocked By:                                           |  

Comment (by rcurtin):

 Replying to [comment:8 trironk3]:
 > I looked into handling the case of the given not having a ToString
 method or an operator<< method by just printing a pointer.

 This is a good intention, but let's avoid it because it gives a sort of
 false sense of security.  If a developer comes along and makes SomeClass
 then naively thinks he can just print it out, then never checks how it
 looks, we end up with a bunch of pointers spat all over the logs, which
 unfortunately isn't useful.  I'd rather have a compile-time error that
 tells the user in one way or another that they need to implement
 ToString() to be able to do that.  But then you wrote at the end of your
 comment that it wasn't worth the time, and I agree with that.

 > The framework for a standardized concept of class output is in place,
 but not all objects leverage it. Is that enough to close this ticket? Or
 should I go about adding a dummy ToString? method to every class?

 So when I filed this ticket I was intending that the ToString() method be
 implemented for each existing class.  Give me a little while and I will
 sketch up some "general rules" for how class output should look, so it is
 uniform.  This will not be too incredibly time-consuming, because a class
 that holds other MLPACK classes can just dump them to the stream too.  I
 can help you with ideas for how things should look.

Ticket URL: <http://trac.research.cc.gatech.edu/fastlab/ticket/164#comment:10>
MLPACK <www.fast-lab.org>
MLPACK is an intuitive, fast, and scalable C++ machine learning library developed by the FASTLAB at Georgia Tech under Dr. Alex Gray.

More information about the mlpack-svn mailing list