[mlpack-git] master: Re-add Center() to the API. (015d791)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Jul 16 12:16:53 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/b4659b668021db631b3c8a48e3d735b513706fdc...015d79104286231ef70ea0ba1d99a6c397025b3e

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

commit 015d79104286231ef70ea0ba1d99a6c397025b3e
Author: Ryan Curtin <ryan at ratml.org>
Date:   Thu Jul 16 16:16:18 2015 +0000

    Re-add Center() to the API.


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

015d79104286231ef70ea0ba1d99a6c397025b3e
 doc/policies/trees.hpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/doc/policies/trees.hpp b/doc/policies/trees.hpp
index 4a06de9..0b52f71 100644
--- a/doc/policies/trees.hpp
+++ b/doc/policies/trees.hpp
@@ -269,6 +269,9 @@ class ExampleTree
   // Return the index of the i'th descendant point of this node.
   size_t Descendant(const size_t i);
 
+  // Store the center of the bounding region of the node in the given vector.
+  void Center(arma::vec& center);
+
   // ///////////////////////////////////////////////// //
   // // More complex distance-related functionality // //
   // ///////////////////////////////////////////////// //
@@ -595,6 +598,17 @@ should return 2, not 3.  The ordering in which the descendants are returned can
 be arbitrary; so, \c Descendant(0) can return 6 \b or 7, and \c Descendant(1)
 should return the other index.
 
+ at code
+// Store the center of the bounding region of the node in the given vector.
+void Center(arma::vec& center);
+ at endcode
+
+The last function, \c Center(), should calculate the center of the bounding
+shape and store it in the given vector.  So, for instance, if the tree is a ball
+tree, then the center is simply the center of the ball.  Algorithm writers would
+be wise to try and avoid the use of \c Center() if possible, since it will
+necessarily cost a copy of a vector.
+
 @subsection treetype_rigorous_complex Complex tree functionality and bounds
 
 A node in a tree should also be able to calculate various distance-related



More information about the mlpack-git mailing list