forked from pandas-dev/pandas
/
hashtable.pxd
59 lines (42 loc) · 1.45 KB
/
hashtable.pxd
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
47
48
49
50
51
52
53
54
55
56
57
58
59
from khash cimport (kh_int64_t, kh_uint64_t, kh_float64_t, kh_pymap_t,
kh_str_t, uint64_t, int64_t, float64_t)
from numpy cimport ndarray
# prototypes for sharing
cdef class HashTable:
pass
cdef class UInt64HashTable(HashTable):
cdef kh_uint64_t *table
cpdef get_item(self, uint64_t val)
cpdef set_item(self, uint64_t key, Py_ssize_t val)
cdef class Int64HashTable(HashTable):
cdef kh_int64_t *table
cpdef get_item(self, int64_t val)
cpdef set_item(self, int64_t key, Py_ssize_t val)
cdef class Float64HashTable(HashTable):
cdef kh_float64_t *table
cpdef get_item(self, float64_t val)
cpdef set_item(self, float64_t key, Py_ssize_t val)
cdef class PyObjectHashTable(HashTable):
cdef kh_pymap_t *table
cpdef get_item(self, object val)
cpdef set_item(self, object key, Py_ssize_t val)
cdef class MultiIndexHashTable(HashTable):
cdef:
kh_uint64_t *table
object mi
cpdef get_item(self, object val)
cpdef set_item(self, object key, Py_ssize_t val)
cdef class StringHashTable(HashTable):
cdef kh_str_t *table
cpdef get_item(self, object val)
cpdef set_item(self, object key, Py_ssize_t val)
cdef struct Int64VectorData:
int64_t *data
size_t n, m
cdef class Int64Vector:
cdef Int64VectorData *data
cdef ndarray ao
cdef resize(self)
cpdef to_array(self)
cdef inline void append(self, int64_t x)
cdef extend(self, int64_t[:] x)