Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::gtl::TopN< T, Cmp > Class Template Reference

#include <top_n.h>

Detailed Description

template<class T, class Cmp = std::greater<T>>
class operations_research::gtl::TopN< T, Cmp >

Cmp is an stl binary predicate. Note that Cmp is the "greater" predicate, not the more commonly used "less" predicate.

If you use a "less" predicate here, the TopN will pick out the bottom N elements out of the ones passed to it, and it will return them sorted in ascending order.

TopN is rule-of-zero copyable and movable if its members are.

Definition at line 53 of file top_n.h.


The documentation for this class was generated from the following file: