[mlpack-git] [mlpack/mlpack] Replaced SortStruct by std::pair (#721)

lozhnikov notifications at github.com
Tue Jul 12 10:01:56 EDT 2016


>      }
>    }
>  
> -  std::sort(sorted.begin(), sorted.end(), structComp<ElemType>);
> +  std::sort(sorted.begin(), sorted.end(),
> +      [] (const std::pair<ElemType, size_t>& p1,
> +          const std::pair<ElemType, size_t>& p2)
> +      {
> +        return p1.first < p2.first;
> +      });

I replaced lambdas by a comparator. I define this function in `RStarTreeSplit` and `XTreeSplit`. These classes have a lot of duplicated code, I think we should not create a separate file for the comparator.

---
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/721/files/ee2a8a1461a33edd830747dccde117ac2cfb12b7#r70443843
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160712/72b78e53/attachment.html>


More information about the mlpack-git mailing list