From d8d96eb83eaca5df38ebb70d5143022df4f20673 Mon Sep 17 00:00:00 2001 From: droodev Date: Sat, 9 Nov 2024 17:28:51 -0600 Subject: [PATCH] Removed added lib; added different initialization for MSVC C --- src/npy_util.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/npy_util.h b/src/npy_util.h index b2737f8..41a9fd6 100644 --- a/src/npy_util.h +++ b/src/npy_util.h @@ -1,14 +1,18 @@ -#include - // Array access macros. #define SM(x0, x1) (*(npy_complex128*)(((char*)PyArray_DATA(submatrix) + \ (x0) * PyArray_STRIDES(submatrix)[0] + \ (x1) * PyArray_STRIDES(submatrix)[1]))) #define SM_shape(x0) (int) PyArray_DIM(submatrix, x0) -// Complex numbers +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) +static const npy_complex128 complex_one = {1.0f, 0.0f}; +static const npy_complex128 complex_zero = {1.0f, 0.0f}; +#else /* !defined(_MSC_VER) || defined(__INTEL_COMPILER) */ static const npy_complex128 complex_one = 1 + 0 * I; static const npy_complex128 complex_zero = 0 + 0 * I; +#endif + +// Complex numbers // Add two numbers npy_complex128 complex_add(npy_complex128 a, npy_complex128 b) {