SHOGUN
4.2.0
|
This class implements a specialized version of max heap structure. This heap specializes in storing the least k values seen so far along with the indices (or id) of the entities with which the values are associated. On calling the push method, it is automatically checked, if the new value supplied, is among the least k distances seen so far. Also, in case the heap is full already, the max among the stored values is automatically thrown out as the new value finds its proper place in the heap.
Public Member Functions | |
CKNNHeap (int32_t k=1) | |
~CKNNHeap () | |
void | push (index_t index, float64_t dist) |
float64_t | get_max_dist () |
index_t | get_max_index () |
SGVector< float64_t > | get_dists () |
SGVector< index_t > | get_indices () |
CKNNHeap | ( | int32_t | k = 1 | ) |
constructor
k | heap capacity i.e. the number of least distance values to be stored |
Definition at line 37 of file KNNHeap.cpp.
float64_t get_max_dist | ( | ) |
index_t get_max_index | ( | ) |
push into heap
index | vector id whose distance value is pushed into the heap |
dist | distance value of the vector id index from the query point |
Definition at line 51 of file KNNHeap.cpp.