summaryrefslogtreecommitdiff
path: root/python/src/utils.pxd
blob: 786cd265a344c1f111b39eb4ebf69ed40643f85f (plain)
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
from libcpp.string cimport string
from libcpp.vector cimport vector

cdef extern from "<iostream>" namespace "std":
    cdef cppclass istream:
        pass
    cdef cppclass ostream:
        pass
    cdef cppclass istringstream(istream):
        istringstream(char*)

cdef extern from "utils/weights.h":
    ctypedef double weight_t

cdef extern from "utils/logval.h":
    cdef cppclass LogVal[T]:
        pass

cdef extern from "utils/prob.h":
    cdef cppclass prob_t:
        pass

cdef extern from "utils/wordid.h":
    ctypedef int WordID

cdef extern from "utils/sparse_vector.h":
    cdef cppclass SparseVector[T]:
        pass

cdef extern from "utils/tdict.cc" namespace "TD":
    cdef string GetString(vector[WordID] st)

cdef extern from "utils/verbose.h":
    cdef void SetSilent(bint)

cdef extern from "utils/fdict.h" namespace "FD":
    WordID FDConvert "FD::Convert" (char*)
    string& FDConvert "FD::Convert" (WordID)

cdef extern from "utils/filelib.h":
    cdef cppclass ReadFile:
        ReadFile(string)
        istream* stream()

cdef extern from "utils/sampler.h":
    cdef cppclass MT19937:
        pass

"""
cdef extern from "<boost/shared_ptr.hpp>" namespace "boost":
    cdef cppclass shared_ptr[T]:
        void reset(T*)
"""