[mlpack] 05/324: It turns out the implementation of FurthestPointDistance() was just wrong. Thanks Andrew for pointing it out.

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:21:50 UTC 2014


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit e597e9a2609649a498ec8f9849e419a8ebc17601
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
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.
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16523 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp | 6 +++---
 1 file changed, 3 insertions(+), 3 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);
 }
 
 /**
@@ -681,7 +681,7 @@ std::string BinarySpaceTree<BoundType, StatisticType, MatType, SplitType>::
   convert << "  Split dimension: " << splitDimension << std::endl;
 
   // How many levels should we print?  This will print the top two tree levels.
-  if (left != NULL && parent == NULL) 
+  if (left != NULL && parent == NULL)
   {
     convert << " Left child:" << std::endl;
     convert << mlpack::util::Indent(left->ToString(), 2);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list