[mlpack] [mlpack/mlpack] using rvalue references to set a given reference tree in FastMKS and DualTreeBoruvka (#799)

Anuraj Kanodia notifications at github.com
Sat Dec 24 11:02:00 EST 2016


akanuraj200 commented on this pull request.



> @@ -103,6 +103,56 @@ template<
     template<typename TreeMetricType,
              typename TreeStatType,
              typename TreeMatType> class TreeType>
+DualTreeBoruvka<MetricType, MatType, TreeType>::DualTreeBoruvka(
+    Tree& tree,
+    const MetricType metric) :
+    tree(new Tree(tree)),
+    data(&this->tree->Dataset()),
+    ownTree(true),
+    naive(false),
+    connections(data.n_cols),
+    totalDist(0.0),
+    metric(metric)

Hi @rcurtin ,

```
error: invalid initialization of reference of type ‘const arma::Mat<double>&’ from expression of type ‘arma::Mat<double>*’
     metric(metric)
                  ^
```
The `NeighborSearch` class is implemented in a similar way, but that runs without an error.  Any thoughts?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/799#pullrequestreview-14354878
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://knife.lugatgt.org/pipermail/mlpack/attachments/20161224/9602b8c7/attachment.html>


More information about the mlpack mailing list