<p>Hi,</p>
<p>I have modified NeighborSearch class to take a rvalue reference instead of pointer, when setting a specific referenceTree, for the constructor and Train() method.<br>
I think this is more intuitive. We use these methods when we want to build the reference tree with a special configuration, for example to set the leafSize.<br>
Every time we use these methods, we want to transfer ownership of this tree to the neighbor search class, so I think a rvalue reference is more appropiate.<br>
These changes are not completed, we should add a move constructor for all rtrees's flavours. I wanted to be sure you are interested in this, before spending more time.</p>
<p>Another option is to continue using the pointer to referenceTree and incorporate a boolean parameter like: "setOwnership".<br>
Personally, I prefer rvalues references for this case.</p>
<p>Thanks!</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/mlpack/mlpack/pull/743'>https://github.com/mlpack/mlpack/pull/743</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Documentation details.</li>
<li>Add move constructor for cover tree.</li>
<li>Update knn test to use rvalue references.</li>
<li>Update kfn test to use rvalue references.</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/mlpack/mlpack/pull/743/files#diff-0">src/mlpack/core/tree/cover_tree/cover_tree.hpp</a>
(8)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/mlpack/mlpack/pull/743/files#diff-1">src/mlpack/core/tree/cover_tree/cover_tree_impl.hpp</a>
(40)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/mlpack/mlpack/pull/743/files#diff-2">src/mlpack/methods/neighbor_search/neighbor_search.hpp</a>
(15)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/mlpack/mlpack/pull/743/files#diff-3">src/mlpack/methods/neighbor_search/neighbor_search_impl.hpp</a>
(18)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/mlpack/mlpack/pull/743/files#diff-4">src/mlpack/methods/neighbor_search/ns_model_impl.hpp</a>
(9)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/mlpack/mlpack/pull/743/files#diff-5">src/mlpack/tests/akfn_test.cpp</a>
(4)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/mlpack/mlpack/pull/743/files#diff-6">src/mlpack/tests/kfn_test.cpp</a>
(36)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/mlpack/mlpack/pull/743/files#diff-7">src/mlpack/tests/knn_test.cpp</a>
(39)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/mlpack/mlpack/pull/743.patch'>https://github.com/mlpack/mlpack/pull/743.patch</a></li>
<li><a href='https://github.com/mlpack/mlpack/pull/743.diff'>https://github.com/mlpack/mlpack/pull/743.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/743">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFIK7Kss3uuJtjgSnOyrsBwDqRDo2ks5qaRZFgaJpZM4JXoXp">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOBL_W2ODqbdmgowsZtgUcnd2GJFks5qaRZFgaJpZM4JXoXp.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/743"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>