[mlpack-git] [mlpack/mlpack] Hilbert R tree (#664)

Ryan Curtin notifications at github.com
Thu Jun 2 15:05:03 EDT 2016


I agree with that change; otherwise the call to `arma::Mat<eT>::col()` has to cast the result (which is a `subview_col`) into an `arma::Col<eT>`, which means calling the constructor.  It's a little bit of extra overhead that can be avoided by using the solution you just proposed.  Usually I will call `T` `VecType` instead, and sometimes (although I doubt it's necessary here), you can enforce the type by using SFINAE with the `IsVector` class... something like this:

```
// This can only be called with an arma::Col<eT>.
template<typename VecType>
void Function(VecType& a, typename boost::enable_if<IsVector<VecType>>*);
```

But I don't know if SFINAE is necessary here.  If you want, you can find `IsVector` in `src/mlpack/core/util/arma_traits.hpp`.

---
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/664#issuecomment-223390450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160602/c16e7ac4/attachment.html>


More information about the mlpack-git mailing list