+ renamed dyn_prog directory
[qpalma.git] / DynProg / 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 "carrays.i"
11
12 %include "common.h"
13 %include "Mathmatics.h"
14 %include "penalty_info.h"
15 %include "qpalma_dp.h"
16
17 /*
18 %array_class(int, intArray) ;
19 %array_class(double, doubleArray) ;
20 %array_functions(double, doubleFArray) ;
21 %array_functions(struct penalty_struct, penaltyArray) ;
22 %array_class(Pre_score, Pre_scoreArray) ;
23
24 %pythoncode
25 %{
26
27 def createPenaltyArrayFromList(list):
28 array = new_penaltyArray(len(list))
29 for i in range(len(list)):
30 penaltyArray_setitem(array, i, list[i])
31 return array
32
33 def createDoubleArrayFromList(list):
34 #array = new_doubleArray(len(list))
35 array = doubleArray(len(list))
36 for i in range(len(list)):
37 # doubleArray_setitem(array, i, list[i])
38 array[i] = list[i]
39 return array
40
41 def createIntArrayFromList(list):
42 #array = new_intArray(len(list))
43 array = intArray(len(list))
44 for i in range(len(list)):
45 #intArray_setitem(array, i, list[i])
46 array[i] = list[i]
47 return array
48
49 def createListFromIntArray(array, array_len):
50 list = [0]*array_len
51 for i in range(array_len):
52 list[i] = intArray_getitem(array,i)
53 return list
54
55 def createListFromDoubleArray(array, array_len):
56 list = [0]*array_len
57 for i in range(array_len):
58 list[i] = doubleArray_getitem(array,i)
59 return list
60
61 %}
62 */