SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
所有成员列表 | Public 成员函数
CKNNHeap类 参考

详细描述

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.

在文件 KNNHeap.h47 行定义.

Public 成员函数

 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_tget_dists ()
 
SGVector< index_tget_indices ()
 

构造及析构函数说明

CKNNHeap ( int32_t  k = 1)

constructor

参数
kheap capacity i.e. the number of least distance values to be stored

在文件 KNNHeap.cpp37 行定义.

~CKNNHeap ( )

destructor

在文件 KNNHeap.h57 行定义.

成员函数说明

SGVector< float64_t > get_dists ( )

get distances

返回
distances stored in the heap

在文件 KNNHeap.cpp100 行定义.

SGVector< index_t > get_indices ( )

get indices

返回
indices stored in the heap

在文件 KNNHeap.cpp123 行定义.

float64_t get_max_dist ( )

max distance

返回
max distance value stored in the heap

在文件 KNNHeap.h70 行定义.

index_t get_max_index ( )

max index

返回
vector id of the max distance stored

在文件 KNNHeap.h76 行定义.

void push ( index_t  index,
float64_t  dist 
)

push into heap

参数
indexvector id whose distance value is pushed into the heap
distdistance value of the vector id index from the query point

在文件 KNNHeap.cpp51 行定义.


该类的文档由以下文件生成:

SHOGUN 机器学习工具包 - 项目文档