<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r69383465">src/mlpack/methods/ne/genome.hpp</a>:</p>
<pre style='color:#555'>> + std::vector<double> toNeuronDepths;
> + for (ssize_t i=0; i<aLinkGenes.size(); ++i) {
> + NeuronGene toNeuron = GetNeuronById(aLinkGenes[i].ToNeuronId());
> + toNeuronDepths.push_back(toNeuron.Depth());
> + }
> +
> + std::vector<DepthAndLink> depthAndLinks;
> + ssize_t linkGenesSize = aLinkGenes.size();
> + for (ssize_t i=0; i<linkGenesSize; ++i) {
> + depthAndLinks.push_back(DepthAndLink(toNeuronDepths[i], aLinkGenes[i]));
> + }
> +
> + std::sort(depthAndLinks.begin(), depthAndLinks.end());
> +
> + for (ssize_t i=0; i<linkGenesSize; ++i) {
> + aLinkGenes[i] = depthAndLinks[i].link;
</pre>
<p>I think, we could speed this up, if we would just store the index of all linkGenes, an use another list, that contains all linkGenes as a reference.</p>
<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/686/files/554a279b0089e4385dfb40077e578d6ae2a42ece#r69383465">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFDm5ulxXmfreJ6dpc4dDRIwMHpj9ks5qRuiFgaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFPKHG832UOVfgMmcjOhG66lXNPlbks5qRuiFgaJpZM4IwJa6.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/686/files/554a279b0089e4385dfb40077e578d6ae2a42ece#r69383465"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>