+ removed load_genomic dependency
[qpalma.git] / dyn_prog / QPalmaDP.i
1 %module QPalmaDP
2 %{
3 #define SWIG_FILE_WITH_INIT
4 #include "common.h"
5 #include "Mathmatics.h"
6 #include "penalty_info.h"
7 #include "qpalma_dp.h"
8 %}
9
10 /*%include "std_vector.i"
11 %include "std_string.i"*/
12
13 %include "carrays.i"
14
15 %include "common.h"
16 %include "Mathmatics.h"
17 %include "penalty_info.h"
18 %include "qpalma_dp.h"
19
20 %array_class(int, intArray) ;
21 %array_class(double, doubleArray) ;
22 %array_functions(double, doubleFArray) ;
23 %array_functions(struct penalty_struct, penaltyArray) ;
24
25 /*
26 %array_functions(int, intArray) ;
27 %array_functions(double, doubleArray) ;
28 */
29 %array_class(Pre_score, Pre_scoreArray) ;
30
31 %pythoncode
32 %{
33
34 def createPenaltyArrayFromList(list):
35 array = new_penaltyArray(len(list))
36 for i in range(len(list)):
37 penaltyArray_setitem(array, i, list[i])
38 return array
39
40 def createDoubleArrayFromList(list):
41 #array = new_doubleArray(len(list))
42 array = doubleArray(len(list))
43 for i in range(len(list)):
44 # doubleArray_setitem(array, i, list[i])
45 array[i] = list[i]
46 return array
47
48 def createIntArrayFromList(list):
49 #array = new_intArray(len(list))
50 array = intArray(len(list))
51 for i in range(len(list)):
52 #intArray_setitem(array, i, list[i])
53 array[i] = list[i]
54 return array
55
56 def createListFromIntArray(array, array_len):
57 list = [0]*array_len
58 for i in range(array_len):
59 list[i] = intArray_getitem(array,i)
60 return list
61
62 def createListFromDoubleArray(array, array_len):
63 list = [0]*array_len
64 for i in range(array_len):
65 list[i] = doubleArray_getitem(array,i)
66 return list
67
68 %}