[mlpack-git] master, mlpack-1.0.x: It turns out the implementation of FurthestPointDistance() was just wrong. Thanks Andrew for pointing it out. (0449ba4)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:47:12 EST 2015


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

On branches: master,mlpack-1.0.x
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

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

commit 0449ba43a04c0374fa33b3d5a4b7815551ac3d25
Author: Ryan Curtin <ryan at ratml.org>
Date:   Tue May 20 18:34:32 2014 +0000

    It turns out the implementation of FurthestPointDistance() was just wrong.
    Thanks Andrew for pointing it out.


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

0449ba43a04c0374fa33b3d5a4b7815551ac3d25
 src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp b/src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp
index 25ed4f5..d9e9735 100644
--- a/src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp
+++ b/src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp
@@ -438,12 +438,12 @@ template<typename BoundType,
 inline double BinarySpaceTree<BoundType, StatisticType, MatType, SplitType>::
     FurthestPointDistance() const
 {
-  if (IsLeaf())
+  if (!IsLeaf())
     return 0.0;
 
   // Otherwise half of the maximum bound distance is sufficient (this is the
   // distance from a corner of the bound to the centroid).
-  return bound.MaxDistance(bound);
+  return 0.5 * bound.MaxDistance(bound);
 }
 
 /**



More information about the mlpack-git mailing list