#include <topk.h>
Public Types | |
| typedef ACCESSOR::Key | Key |
| Key type. | |
| typedef ACCESSOR::Value | Value |
| Value type. | |
Public Member Functions | |
| TopkScanner (const ACCESSOR &accessor, const METRIC &metric, unsigned K, float R=std::numeric_limits< float >::max()) | |
| Constructor. | |
| void | reset (Value query) |
| Reset the query. | |
| unsigned | cnt () const |
| Number of points scanned for the current query. | |
| const Topk< Key > & | topk () const |
| TopK results. | |
| void | operator() (Key key) |
| Update the current query by scanning key. | |
Scans keys for top-K query. This is the object passed into the LSH query interface.
| lshkit::TopkScanner< ACCESSOR, METRIC >::TopkScanner | ( | const ACCESSOR & | accessor, | |
| const METRIC & | metric, | |||
| unsigned | K, | |||
| float | R = std::numeric_limits<float>::max() | |||
| ) | [inline] |
Constructor.
| accessor | The scanner use accessor to retrieva values from keys. | |
| metric | The distance metric. | |
| K | value used to reset internal Topk class. | |
| R | value used to reset internal Topk class. |
Metric metric is also used as a function. It accepts two parameters of the type LSH::Domain and returns the distance between the two.
| void lshkit::TopkScanner< ACCESSOR, METRIC >::operator() | ( | Key | key | ) | [inline] |
Update the current query by scanning key.
This is normally invoked by the LSH index structure.
| void lshkit::TopkScanner< ACCESSOR, METRIC >::reset | ( | Value | query | ) | [inline] |
Reset the query.
This function should be invoked before each query.