[mlpack-git] [mlpack/mlpack] Heaps for mlpack! (#732)
Ryan Curtin
notifications at github.com
Mon Jul 25 10:22:08 EDT 2016
> + {
> + //! Value of this recommendation.
> + double value;
> + //! Item of this recommendation.
> + size_t item;
> + //! Trivial constructor.
> + Candidate(double value, size_t item) :
> + value(value),
> + item(item)
> + {};
> + //! Compare the value of two candidates.
> + friend bool operator>(const Candidate& l, const Candidate& r)
> + {
> + return l.value > r.value;
> + };
> + };
That makes sense---there is not much reason to believe that `std::pair<>` is intrinsically faster than a handwritten class that implements the same functionality. My leaning towards `pair` is primarily a function of minimizing code, but it is not a huge preference. :)
---
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/732/files/57dd61f1d823f209c8d0f67fa69f8a8ae0669d18#r72071885
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160725/0fa9a24e/attachment-0001.html>
More information about the mlpack-git
mailing list