Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Cpm.TopKeeper
Sourcecreate n
creates a 'a TopKeeper.t
that will keep up to n
best scoring elements. n
must be greater than 0.
add t score elt
add elt
with score
to the top_keeper t
(if the score is good enough or if the top_keeper doesn't hold enough elements yet)
high_scores_first t
retrieve the n
best scores from t
(with associated elements); scores are in decreasing order
get_curr_size t
return the current number of elements in t
. Note that get_curr_size t <= get_max_size t
is always true (it is the data-structure invariant).