<p>In <a href="https://github.com/mlpack/mlpack/pull/657#discussion_r65107943">src/mlpack/methods/lsh/lsh_search_impl.hpp</a>:</p>
<pre style='color:#555'>> + Ao.push_back(0); // initial perturbation holds smallest score (0 if sorted)
> +
> + std::vector< std::vector<size_t> > perturbationSets;
> + perturbationSets.push_back(Ao); //storage of perturbation sets
> +
> + //define a priority queue with CompareGreater as a minheap
> + std::priority_queue<
> + std::pair<double, size_t>, //contents: pairs of (score, index)
> + std::vector< //container: vector of pairs
> + std::pair<double, size_t>
> + >,
> + mlpack::neighbor::CompareGreater //comparator of pairs (compares scores)
> + > minHeap; //our minheap
> +
> + //Start by adding the lowest scoring set to the minheap
> + std::pair<double, size_t> pair0( perturbationScore(Ao, scores), 0 );
</pre>
<p>priority_queue is a min-heap and the default comparator is defined for pair, so if you just invert your scores here so you want the min instead of the max I think it will allow you to remove a lot of code, including the custom comparator.</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/657/files/2eb6163c90e8e19566784cf960d38d82691221e1#r65107943">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFM_9WmeXg1JbOyMDV4g0PL0dJfEpks5qG12fgaJpZM4IpUVp">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFJTTMylAFRngKw4TNLZCltX54kURks5qG12fgaJpZM4IpUVp.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/657/files/2eb6163c90e8e19566784cf960d38d82691221e1#r65107943"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>