Debian Codegraph @

tools/swig/test/Matrix.i

raw
1 // -*- c++ -*-
2 %module Matrix
3
4 %{
5 #define SWIG_FILE_WITH_INIT
6 #include "Matrix.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_ARRAY2[ANY][ANY]) {(TYPE matrix[ANY][ANY])};
19 %apply (TYPE* IN_ARRAY2, int DIM1, int DIM2) {(TYPE* matrix, int rows, int cols)};
20 %apply (int DIM1, int DIM2, TYPE* IN_ARRAY2) {(int rows, int cols, TYPE* matrix)};
21
22 %apply (TYPE INPLACE_ARRAY2[ANY][ANY]) {(TYPE array[3][3])};
23 %apply (TYPE* INPLACE_ARRAY2, int DIM1, int DIM2) {(TYPE* array, int rows, int cols)};
24 %apply (int DIM1, int DIM2, TYPE* INPLACE_ARRAY2) {(int rows, int cols, TYPE* array)};
25
26 %apply (TYPE ARGOUT_ARRAY2[ANY][ANY]) {(TYPE lower[3][3])};
27 %apply (TYPE ARGOUT_ARRAY2[ANY][ANY]) {(TYPE upper[3][3])};
28
29 %enddef /* %apply_numpy_typemaps() macro */
30
31 %apply_numpy_typemaps(signed char )
32 %apply_numpy_typemaps(unsigned char )
33 %apply_numpy_typemaps(short )
34 %apply_numpy_typemaps(unsigned short )
35 %apply_numpy_typemaps(int )
36 %apply_numpy_typemaps(unsigned int )
37 %apply_numpy_typemaps(long )
38 %apply_numpy_typemaps(unsigned long )
39 %apply_numpy_typemaps(long long )
40 %apply_numpy_typemaps(unsigned long long)
41 %apply_numpy_typemaps(float )
42 %apply_numpy_typemaps(double )
43
44 // Include the header file to be wrapped
45 %include "Matrix.h"