-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrknng_lib.h
47 lines (35 loc) · 1.06 KB
/
rknng_lib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <Python.h>
#include <math.h>
#include <numpy/arrayobject.h>
typedef int BOOL;
#define true 1
#define false 0
typedef struct kNNItem {
int id;
float dist;
BOOL new_item;
int visited;
} kNNItem;
typedef struct kNNList {
// List of <size> number of nearest neighbors
kNNItem * items;
float max_dist;
int size;
// <id> of point which nearest neighbors this represents
int id;
BOOL is_exact;
} kNNList;
typedef struct kNNGraph {
int size;
int k;
int format;
kNNList * list;
void * DS;
} kNNGraph ;
extern void printDSVec(kNNGraph* knng,int id);
extern kNNGraph* get_knng(const char* infn,int k, int data_type, int algo, float endcond, float nndes_start, int W, int dfunc);
PyObject *__rpdiv_knng(PyArrayObject *py_v, int k, int w, float nndes, float delta, int maxiter, int dtype);
PyObject *__rpdiv_knng_generic(PyObject *py_v, int k, int w, float nndes, float delta, int maxiter);
extern void test_rknn_lib();
extern float knng_dist(kNNGraph* knng, int p1, int p2);
extern float get_elapsed_time();