-
Notifications
You must be signed in to change notification settings - Fork 0
/
ktreemodule.cpp
46 lines (44 loc) · 1.62 KB
/
ktreemodule.cpp
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
46
#include "module_base.cpp"
#define METHDEF(cppName, pyName) {#pyName, py_##cppName<KTreeNode>, METH_VARARGS, cppName##__doc__ }
static PyMethodDef ktreeMethods[] = {
METHDEF(init, init),
METHDEF(free, free),
METHDEF(add, add),
METHDEF(clear, clear),
METHDEF(neighbors, neighbors),
METHDEF(getData, get_data),
METHDEF(getLabel, get_label),
METHDEF(size, size),
METHDEF(countNodes, count_nodes),
METHDEF(printTree, print_tree),
METHDEF(leafStats, leaf_stats),
METHDEF(isActive, is_active),
METHDEF(checkConsistency, check_consistency),
METHDEF(isValidNdx, is_valid_ndx),
METHDEF(lookupExact, lookup_exact),
METHDEF(enforceTreeConsistencyFull, enforce_tree_consistency_full),
METHDEF(enforceTreeConsistencyAt, enforce_tree_consistency_at),
METHDEF(enforceTreeConsistencyRandom, enforce_tree_consistency_random),
METHDEF(tailNdx, get_tail_ndx),
METHDEF(headNdx, get_head_ndx),
METHDEF(dim, get_dim),
METHDEF(memorySize, get_memory_size),
METHDEF(maxLeafSize, get_max_leaf_size),
METHDEF(branchFactor, get_branch_factor),
METHDEF(spill, get_spill),
METHDEF(removeDups, get_remove_dups),
METHDEF(numTrees, get_num_trees),
METHDEF(minLeaves, get_min_leaves),
METHDEF(exactEps, get_exact_eps),
METHDEF(defaultSearchType, get_search_type),
METHDEF(set_minLeaves, set_min_leaves),
METHDEF(set_exactEps, set_exact_eps),
METHDEF(set_defaultSearchType, set_search_type),
{NULL, NULL, 0, NULL}
};
#undef METHDEF
PyDoc_STRVAR(ktree__doc__,"KTree data structure for online kernel regression");
PyMODINIT_FUNC init_ktree(void) {
import_array();
Py_InitModule3("_ktree", ktreeMethods, ktree__doc__);
}