1 #if !defined(PETSC4PY_NUMPY_H) 2 #define PETSC4PY_NUMPY_H 3 4 #include <Python.h> 5 #include <numpy/arrayobject.h> 6 #include <petscsystypes.h> 7 8 # define NPY_PETSC_BOOL NPY_BOOL 9 10 #if defined(PETSC_USE_64BIT_INDICES) 11 # define NPY_PETSC_INT NPY_INT64 12 #else 13 # define NPY_PETSC_INT NPY_INT 14 #endif 15 16 #if defined(PETSC_USE_REAL_SINGLE) 17 # define NPY_PETSC_REAL NPY_FLOAT 18 # define NPY_PETSC_COMPLEX NPY_CFLOAT 19 #elif defined(PETSC_USE_REAL_DOUBLE) 20 # define NPY_PETSC_REAL NPY_DOUBLE 21 # define NPY_PETSC_COMPLEX NPY_CDOUBLE 22 #elif defined(PETSC_USE_REAL_LONG_DOUBLE) 23 # define NPY_PETSC_REAL NPY_LONGDOUBLE 24 # define NPY_PETSC_COMPLEX NPY_CLONGDOUBLE 25 #elif defined(PETSC_USE_REAL___FLOAT128) 26 # define NPY_PETSC_REAL NPY_FLOAT128 27 # define NPY_PETSC_COMPLEX NPY_COMPLEX256 28 #else 29 # error "unsupported real precision" 30 #endif 31 32 #if defined(PETSC_USE_COMPLEX) 33 # define NPY_PETSC_SCALAR NPY_PETSC_COMPLEX 34 #else 35 # define NPY_PETSC_SCALAR NPY_PETSC_REAL 36 #endif 37 38 #endif /* !PETSC4PY_NUMPY_H */ 39