[mlpack-git] master: Fix error in BinarySearchTree move constructor. (4a1fb51)

gitdub at mlpack.org gitdub at mlpack.org
Tue Aug 23 15:58:25 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/1148f1652e139c9037eb3813550090313d089a30...a8a8a1381b529a01420de6e792a4a1e7bd58a626

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

commit 4a1fb513255c2eb49af43324513c209fb01a3111
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Sun Jul 31 23:19:02 2016 -0300

    Fix error in BinarySearchTree move constructor.


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

4a1fb513255c2eb49af43324513c209fb01a3111
 src/mlpack/core/tree/binary_space_tree/binary_space_tree_impl.hpp | 6 ++++++
 1 file changed, 6 insertions(+)

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 3ae07d1..de68097 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
@@ -407,6 +407,12 @@ BinarySpaceTree(BinarySpaceTree&& other) :
   other.furthestDescendantDistance = 0.0;
   other.minimumBoundDistance = 0.0;
   other.dataset = NULL;
+
+  //Set new parent.
+  if (left)
+    left->parent = this;
+  if (right)
+    right->parent = this;
 }
 
 /**




More information about the mlpack-git mailing list