Debian Codegraph @

tools/swig/test/Vector.i

raw
1 // -*- c++ -*-
2 %module Vector
3
4 %{
5 #define SWIG_FILE_WITH_INIT
6 #include "Vector.h"
7 %}
8
9 // Get the NumPy typemaps
10 %include "../numpy.i"
11
12 %init %{
13 import_array();
14 %}
15
16 %define %apply_numpy_typemaps(TYPE)
17
18 %apply (TYPE IN_ARRAY1[ANY]) {(TYPE vector[3])};
19 %apply (TYPE* IN_ARRAY1, int DIM1) {(TYPE* series, int size)};
20 %apply (int DIM1, TYPE* IN_ARRAY1) {(int size, TYPE* series)};
21
22 %apply (TYPE INPLACE_ARRAY1[ANY]) {(TYPE array[3])};
23 %apply (TYPE* INPLACE_ARRAY1, int DIM1) {(TYPE* array, int size)};
24 %apply (int DIM1, TYPE* INPLACE_ARRAY1) {(int size, TYPE* array)};
25
26 %apply (TYPE ARGOUT_ARRAY1[ANY]) {(TYPE even[3])};
27 %apply (TYPE ARGOUT_ARRAY1[ANY]) {(TYPE odd[ 3])};
28 %apply (TYPE* ARGOUT_ARRAY1, int DIM1) {(TYPE* twoVec, int size)};
29 %apply (int DIM1, TYPE* ARGOUT_ARRAY1) {(int size, TYPE* threeVec)};
30
31 %enddef /* %apply_numpy_typemaps() macro */
32
33 %apply_numpy_typemaps(signed char )
34 %apply_numpy_typemaps(unsigned char )
35 %apply_numpy_typemaps(short )
36 %apply_numpy_typemaps(unsigned short )
37 %apply_numpy_typemaps(int )
38 %apply_numpy_typemaps(unsigned int )
39 %apply_numpy_typemaps(long )
40 %apply_numpy_typemaps(unsigned long )
41 %apply_numpy_typemaps(long long )
42 %apply_numpy_typemaps(unsigned long long)
43 %apply_numpy_typemaps(float )
44 %apply_numpy_typemaps(double )
45
46 // Include the header file to be wrapped
47 %include "Vector.h"