+ added c code from the palma project
[qpalma.git] / QPalmaDP / QPalmaDP.i
1 %module QPalmaDP
2 %{
3 #include "qpalma_dp.h"
4 %}
5
6 %include "std_vector.i"
7 %include "std_string.i"
8
9 %include "carrays.i"
10
11 %include "qpalma_dp.h"
12
13
14 %array_functions(int, intArray) ;
15 %array_functions(double, doubleArray) ;
16 %array_class(Pre_score, Pre_scoreArray) ;
17
18 %pythoncode
19 %{
20
21 def createDoubleArrayFromList(list):
22 array = new_doubleArray(len(list))
23 for i in range(len(list)):
24 doubleArray_setitem(array, i, list[i])
25 return array
26
27 def createIntArrayFromList(list):
28 array = new_intArray(len(list))
29 for i in range(len(list)):
30 intArray_setitem(array, i, list[i])
31 return array
32
33 def createListFromIntArray(array, array_len):
34 list = [0]*array_len
35 for i in range(array_len):
36 list[i] = intArray_getitem(array,i)
37 return list
38
39 def createListFromDoubleArray(array, array_len):
40 list = [0]*array_len
41 for i in range(array_len):
42 list[i] = doubleArray_getitem(array,i)
43 return list
44
45 %}
46