lshkit::Topk< KEY > Class Template Reference

Top-K heap. More...

#include <topk.h>

List of all members.

Public Types

typedef TopkEntry< KEY > Element
typedef std::vector< TopkEntry<
KEY > > 

Public Member Functions

void reset (unsigned k, float r=std::numeric_limits< float >::max())
 Reset the heap.
void reset (unsigned k, KEY key, float r=std::numeric_limits< float >::max())
void reset (float r)
float threshold () const
Topkoperator<< (Element t)
 Insert a new element, update the heap.
float recall (const Topk< KEY > &topk) const
 Calculate recall.
unsigned getK () const

Detailed Description

template<class KEY>
class lshkit::Topk< KEY >

Top-K heap.

Following is an example of using the Topk class:

Topk<Key> topk; topk.reset(k);

for each candidate key { topk << key; }

At this point topk should contain the best k keys.

Member Function Documentation

template<class KEY>
float lshkit::Topk< KEY >::recall ( const Topk< KEY > &  topk  )  const [inline]

Calculate recall.

Recall = size(this /\ topk) / size(this).

The documentation for this class was generated from the following file:
Get LSHKIT at Fast, secure and Free Open Source software downloads doxygen