[mlpack-svn] [MLPACK] #167: Different solution for HRectBound::MinDistance(..., std::vector<>)

MLPACK Trac trac at coffeetalk-1.cc.gatech.edu
Wed Nov 30 14:19:24 EST 2011


#167: Different solution for HRectBound::MinDistance(..., std::vector<>)
-------------------------------------------------+--------------------------
  Reporter:  rcurtin                             |        Owner:  nslagle   
      Type:  defect                              |       Status:  new       
  Priority:  major                               |    Milestone:  MLPACK 1.0
 Component:  MLPACK                              |   Resolution:            
  Keywords:  bound tree policy template methods  |     Blocking:            
Blocked By:  136                                 |  
-------------------------------------------------+--------------------------

Comment (by rcurtin):

 What you're basically suggesting is that we add an additional four methods
 that anyone who wants to implement a bound needs to implement (and I do
 mean need -- it is not an option), and this is a nightmare that the old
 FASTLIB code suffered from.  If you're using policy-based design, it is
 imperative that the policy classes be as simple as possible.

 So, I have a different solution for you:

 {{{
 class HRectFilteredBound
 {
  public:
   HRectFilteredBound(const size_t dimension,
                      const std::vector<size_t>& filter);

   /**
    * and all that other good stuff too
    */

  private:
   std::vector<size_t>& filter; // Or name it whatever you want.
 };
 }}}

 Now when you build a tree...

 {{{
 std::vector<size_t> importantDimensions(3);
 importantDimensions[0] = 2;
 importantDimensions[1] = 56;
 importantDimensions[2] = 111; // Eleventy!
 // The constructor of BinarySpaceTree will need to be modified to take a
 BoundType as a
 // parameter.
 BinarySpaceTree<HRectFilteredBound> b(data, leafSize,
 HRectFilteredBound(importantDimensions));
 }}}

 What I'm saying in the end is that we cannot afford to add to the
 footprint of the Bound policy class, at almost any cost, and this
 situation does not warrant adding an additional four methods.

-- 
Ticket URL: <https://trac.research.cc.gatech.edu/fastlab/ticket/167#comment:2>
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