![]() |
Rosetta Utilities
2014.16.56682
|
The TopScoreSelector keeps an in-place, sorted, singly-linked list of the N top-scoring objects and their scores that it encounters. In the case of ties, the first object(s) encountered are kept. Class T must have a default constructor, a copy constructor, and must be assignable. Class S must be assignable and comparable, both by a < operator and by a > operator. More...
#include <TopScoreSelector.hh>
Public Types | |
| typedef platform::Size | Size |
Public Member Functions | |
| TopScoreSelector () | |
| void | n_to_keep (Size setting) |
| Size | n_to_keep () const |
| void | low_is_better (bool setting) |
| bool | low_is_better () const |
| bool | better (S s1, S s2) const |
| void | insert (T const &obj, S score) |
| Keep a particular element if it is better than the worst element, or if we have not yet stored n_to_keep_ elements. More... | |
| Size | size () const |
| T const & | operator[] (Size ind) const |
| S | top_score (Size ind) const |
Private Member Functions | |
| void | add_to_set (T const &obj, S score) |
| void | sort_top_scores () const |
| Copy the top_scorers_ data into the sorted_top_scorers_ array. More... | |
Private Attributes | |
| Size | n_to_keep_ |
| bool | low_is_better_ |
| Size | worst_ind_ |
| vector1< std::pair< T, S > > | top_scorers_ |
| vector1< Size > | next_ptr_ |
| bool | is_sorted_ |
| vector1< std::pair< T, S > > | sorted_top_scorers_ |
The TopScoreSelector keeps an in-place, sorted, singly-linked list of the N top-scoring objects and their scores that it encounters. In the case of ties, the first object(s) encountered are kept. Class T must have a default constructor, a copy constructor, and must be assignable. Class S must be assignable and comparable, both by a < operator and by a > operator.
| typedef platform::Size utility::TopScoreSelector< T, S >::Size |
|
inline |
|
inlineprivate |
References utility::TopScoreSelector< T, S >::better(), utility::TopScoreSelector< T, S >::is_sorted_, utility::TopScoreSelector< T, S >::n_to_keep_, utility::TopScoreSelector< T, S >::next_ptr_, basic::options::OptionKeys::AnchoredDesign::filters::score, utility::TopScoreSelector< T, S >::top_scorers_, and utility::TopScoreSelector< T, S >::worst_ind_.
Referenced by utility::TopScoreSelector< T, S >::insert().
|
inline |
|
inline |
Keep a particular element if it is better than the worst element, or if we have not yet stored n_to_keep_ elements.
References utility::TopScoreSelector< T, S >::add_to_set(), utility::TopScoreSelector< T, S >::better(), utility::TopScoreSelector< T, S >::n_to_keep_, utility::TopScoreSelector< T, S >::top_scorers_, and utility::TopScoreSelector< T, S >::worst_ind_.
|
inline |
|
inline |
|
inline |
|
inline |
References utility::TopScoreSelector< T, S >::n_to_keep_.
|
inline |
|
inline |
References utility::TopScoreSelector< T, S >::top_scorers_.
|
inlineprivate |
Copy the top_scorers_ data into the sorted_top_scorers_ array.
References utility::TopScoreSelector< T, S >::is_sorted_, utility::TopScoreSelector< T, S >::next_ptr_, utility::TopScoreSelector< T, S >::sorted_top_scorers_, utility::TopScoreSelector< T, S >::top_scorers_, and utility::TopScoreSelector< T, S >::worst_ind_.
Referenced by utility::TopScoreSelector< T, S >::operator[](), and utility::TopScoreSelector< T, S >::top_score().
|
inline |
|
mutableprivate |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
1.8.7