| 1 |
// -*- c++ -*- |
| 2 |
%module Flat |
| 3 |
|
| 4 |
%{ |
| 5 |
#define SWIG_FILE_WITH_INIT |
| 6 |
#include "Flat.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* INPLACE_ARRAY_FLAT, int DIM_FLAT) {(TYPE* array, int size)}; |
| 19 |
|
| 20 |
%enddef /* %apply_numpy_typemaps() macro */ |
| 21 |
|
| 22 |
%apply_numpy_typemaps(signed char ) |
| 23 |
%apply_numpy_typemaps(unsigned char ) |
| 24 |
%apply_numpy_typemaps(short ) |
| 25 |
%apply_numpy_typemaps(unsigned short ) |
| 26 |
%apply_numpy_typemaps(int ) |
| 27 |
%apply_numpy_typemaps(unsigned int ) |
| 28 |
%apply_numpy_typemaps(long ) |
| 29 |
%apply_numpy_typemaps(unsigned long ) |
| 30 |
%apply_numpy_typemaps(long long ) |
| 31 |
%apply_numpy_typemaps(unsigned long long) |
| 32 |
%apply_numpy_typemaps(float ) |
| 33 |
%apply_numpy_typemaps(double ) |
| 34 |
|
| 35 |
// Include the header file to be wrapped |
| 36 |
%include "Flat.h" |