numpy  2.0.0
include/numpy/npy_common.h
Go to the documentation of this file.
00001 #ifndef _NPY_COMMON_H_
00002 #define _NPY_COMMON_H_
00003 
00004 /* numpconfig.h is auto-generated */
00005 #include "numpyconfig.h"
00006 
00007 #if defined(_MSC_VER)
00008         #define NPY_INLINE __inline
00009 #elif defined(__GNUC__)
00010         #if defined(__STRICT_ANSI__)
00011                 #define NPY_INLINE __inline__
00012         #else
00013                 #define NPY_INLINE inline
00014         #endif
00015 #else
00016         #define NPY_INLINE
00017 #endif
00018 
00019 /* Enable 64 bit file position support on win-amd64. Ticket #1660 */
00020 #if defined(_MSC_VER) && defined(_WIN64) && (_MSC_VER > 1400)
00021     #define npy_fseek _fseeki64
00022     #define npy_ftell _ftelli64
00023 #else
00024     #define npy_fseek fseek
00025     #define npy_ftell ftell
00026 #endif
00027 
00028 /* enums for detected endianness */
00029 enum {
00030         NPY_CPU_UNKNOWN_ENDIAN,
00031         NPY_CPU_LITTLE,
00032         NPY_CPU_BIG
00033 };
00034 
00035 /*
00036  * This is to typedef npy_intp to the appropriate pointer size for
00037  * this platform.  Py_intptr_t, Py_uintptr_t are defined in pyport.h.
00038  */
00039 typedef Py_intptr_t npy_intp;
00040 typedef Py_uintptr_t npy_uintp;
00041 #define NPY_SIZEOF_CHAR 1
00042 #define NPY_SIZEOF_BYTE 1
00043 #define NPY_SIZEOF_INTP NPY_SIZEOF_PY_INTPTR_T
00044 #define NPY_SIZEOF_UINTP NPY_SIZEOF_PY_INTPTR_T
00045 #define NPY_SIZEOF_CFLOAT NPY_SIZEOF_COMPLEX_FLOAT
00046 #define NPY_SIZEOF_CDOUBLE NPY_SIZEOF_COMPLEX_DOUBLE
00047 #define NPY_SIZEOF_CLONGDOUBLE NPY_SIZEOF_COMPLEX_LONGDOUBLE
00048 
00049 #ifdef constchar
00050 #undef constchar
00051 #endif
00052 
00053 #if (PY_VERSION_HEX < 0x02050000)
00054   #ifndef PY_SSIZE_T_MIN
00055     typedef int Py_ssize_t;
00056     #define PY_SSIZE_T_MAX INT_MAX
00057     #define PY_SSIZE_T_MIN INT_MIN
00058   #endif
00059 #define NPY_SSIZE_T_PYFMT "i"
00060 #define constchar const char
00061 #else
00062 #define NPY_SSIZE_T_PYFMT "n"
00063 #define constchar char
00064 #endif
00065 
00066 /* NPY_INTP_FMT Note:
00067  *      Unlike the other NPY_*_FMT macros which are used with
00068  *      PyOS_snprintf, NPY_INTP_FMT is used with PyErr_Format and
00069  *      PyString_Format. These functions use different formatting
00070  *      codes which are portably specified according to the Python
00071  *      documentation. See ticket #1795.
00072  *
00073  *      On Windows x64, the LONGLONG formatter should be used, but
00074  *      in Python 2.6 the %lld formatter is not supported. In this
00075  *      case we work around the problem by using the %zd formatter.
00076  */
00077 #if NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_INT
00078         #define NPY_INTP NPY_INT
00079         #define NPY_UINTP NPY_UINT
00080         #define PyIntpArrType_Type PyIntArrType_Type
00081         #define PyUIntpArrType_Type PyUIntArrType_Type
00082         #define NPY_MAX_INTP NPY_MAX_INT
00083         #define NPY_MIN_INTP NPY_MIN_INT
00084         #define NPY_MAX_UINTP NPY_MAX_UINT
00085         #define NPY_INTP_FMT "d"
00086 #elif NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONG
00087         #define NPY_INTP NPY_LONG
00088         #define NPY_UINTP NPY_ULONG
00089         #define PyIntpArrType_Type PyLongArrType_Type
00090         #define PyUIntpArrType_Type PyULongArrType_Type
00091         #define NPY_MAX_INTP NPY_MAX_LONG
00092         #define NPY_MIN_INTP NPY_MIN_LONG
00093         #define NPY_MAX_UINTP NPY_MAX_ULONG
00094         #define NPY_INTP_FMT "ld"
00095 #elif defined(PY_LONG_LONG) && (NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONGLONG)
00096         #define NPY_INTP NPY_LONGLONG
00097         #define NPY_UINTP NPY_ULONGLONG
00098         #define PyIntpArrType_Type PyLongLongArrType_Type
00099         #define PyUIntpArrType_Type PyULongLongArrType_Type
00100         #define NPY_MAX_INTP NPY_MAX_LONGLONG
00101         #define NPY_MIN_INTP NPY_MIN_LONGLONG
00102         #define NPY_MAX_UINTP NPY_MAX_ULONGLONG
00103     #if (PY_VERSION_HEX >= 0x02070000)
00104         #define NPY_INTP_FMT "lld"
00105     #else
00106         #define NPY_INTP_FMT "zd"
00107     #endif
00108 #endif
00109 
00110 /*
00111  * We can only use C99 formats for npy_int_p if it is the same as
00112  * intp_t, hence the condition on HAVE_UNITPTR_T
00113  */
00114 #if (NPY_USE_C99_FORMATS) == 1 \
00115         && (defined HAVE_UINTPTR_T) \
00116         && (defined HAVE_INTTYPES_H)
00117         #include <inttypes.h>
00118         #undef NPY_INTP_FMT
00119         #define NPY_INTP_FMT PRIdPTR
00120 #endif
00121 
00122 
00123 /*
00124  * Some platforms don't define bool, long long, or long double.
00125  * Handle that here.
00126  */
00127 #define NPY_BYTE_FMT "hhd"
00128 #define NPY_UBYTE_FMT "hhu"
00129 #define NPY_SHORT_FMT "hd"
00130 #define NPY_USHORT_FMT "hu"
00131 #define NPY_INT_FMT "d"
00132 #define NPY_UINT_FMT "u"
00133 #define NPY_LONG_FMT "ld"
00134 #define NPY_ULONG_FMT "lu"
00135 #define NPY_HALF_FMT "g"
00136 #define NPY_FLOAT_FMT "g"
00137 #define NPY_DOUBLE_FMT "g"
00138 
00139 
00140 #ifdef PY_LONG_LONG
00141 typedef PY_LONG_LONG npy_longlong;
00142 typedef unsigned PY_LONG_LONG npy_ulonglong;
00143 #  ifdef _MSC_VER
00144 #    define NPY_LONGLONG_FMT         "I64d"
00145 #    define NPY_ULONGLONG_FMT        "I64u"
00146 #  elif defined(__APPLE__) || defined(__FreeBSD__)
00147 /*   "%Ld" only parses 4 bytes -- "L" is floating modifier on MacOS X/BSD */
00148 #    define NPY_LONGLONG_FMT         "lld"
00149 #    define NPY_ULONGLONG_FMT        "llu"
00150 /*
00151      another possible variant -- *quad_t works on *BSD, but is deprecated:
00152      #define LONGLONG_FMT   "qd"
00153      #define ULONGLONG_FMT   "qu"
00154 */
00155 #  else
00156 #    define NPY_LONGLONG_FMT         "Ld"
00157 #    define NPY_ULONGLONG_FMT        "Lu"
00158 #  endif
00159 #  ifdef _MSC_VER
00160 #    define NPY_LONGLONG_SUFFIX(x)   (x##i64)
00161 #    define NPY_ULONGLONG_SUFFIX(x)  (x##Ui64)
00162 #  else
00163 #    define NPY_LONGLONG_SUFFIX(x)   (x##LL)
00164 #    define NPY_ULONGLONG_SUFFIX(x)  (x##ULL)
00165 #  endif
00166 #else
00167 typedef long npy_longlong;
00168 typedef unsigned long npy_ulonglong;
00169 #  define NPY_LONGLONG_SUFFIX(x)  (x##L)
00170 #  define NPY_ULONGLONG_SUFFIX(x) (x##UL)
00171 #endif
00172 
00173 
00174 typedef unsigned char npy_bool;
00175 #define NPY_FALSE 0
00176 #define NPY_TRUE 1
00177 
00178 
00179 #if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
00180         typedef double npy_longdouble;
00181         #define NPY_LONGDOUBLE_FMT "g"
00182 #else
00183         typedef long double npy_longdouble;
00184         #define NPY_LONGDOUBLE_FMT "Lg"
00185 #endif
00186 
00187 #ifndef Py_USING_UNICODE
00188 #error Must use Python with unicode enabled.
00189 #endif
00190 
00191 
00192 typedef signed char npy_byte;
00193 typedef unsigned char npy_ubyte;
00194 typedef unsigned short npy_ushort;
00195 typedef unsigned int npy_uint;
00196 typedef unsigned long npy_ulong;
00197 
00198 /* These are for completeness */
00199 typedef char npy_char;
00200 typedef short npy_short;
00201 typedef int npy_int;
00202 typedef long npy_long;
00203 typedef float npy_float;
00204 typedef double npy_double;
00205 
00206 /*
00207  * Disabling C99 complex usage: a lot of C code in numpy/scipy rely on being
00208  * able to do .real/.imag. Will have to convert code first.
00209  */
00210 #if 0
00211 #if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_DOUBLE)
00212 typedef complex npy_cdouble;
00213 #else
00214 typedef struct { double real, imag; } npy_cdouble;
00215 #endif
00216 
00217 #if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_FLOAT)
00218 typedef complex float npy_cfloat;
00219 #else
00220 typedef struct { float real, imag; } npy_cfloat;
00221 #endif
00222 
00223 #if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_LONG_DOUBLE)
00224 typedef complex long double npy_clongdouble;
00225 #else
00226 typedef struct {npy_longdouble real, imag;} npy_clongdouble;
00227 #endif
00228 #endif
00229 #if NPY_SIZEOF_COMPLEX_DOUBLE != 2 * NPY_SIZEOF_DOUBLE
00230 #error npy_cdouble definition is not compatible with C99 complex definition ! \
00231         Please contact Numpy maintainers and give detailed information about your \
00232         compiler and platform
00233 #endif
00234 typedef struct { double real, imag; } npy_cdouble;
00235 
00236 #if NPY_SIZEOF_COMPLEX_FLOAT != 2 * NPY_SIZEOF_FLOAT
00237 #error npy_cfloat definition is not compatible with C99 complex definition ! \
00238         Please contact Numpy maintainers and give detailed information about your \
00239         compiler and platform
00240 #endif
00241 typedef struct { float real, imag; } npy_cfloat;
00242 
00243 #if NPY_SIZEOF_COMPLEX_LONGDOUBLE != 2 * NPY_SIZEOF_LONGDOUBLE
00244 #error npy_clongdouble definition is not compatible with C99 complex definition ! \
00245         Please contact Numpy maintainers and give detailed information about your \
00246         compiler and platform
00247 #endif
00248 typedef struct { npy_longdouble real, imag; } npy_clongdouble;
00249 
00250 /*
00251  * numarray-style bit-width typedefs
00252  */
00253 #define NPY_MAX_INT8 127
00254 #define NPY_MIN_INT8 -128
00255 #define NPY_MAX_UINT8 255
00256 #define NPY_MAX_INT16 32767
00257 #define NPY_MIN_INT16 -32768
00258 #define NPY_MAX_UINT16 65535
00259 #define NPY_MAX_INT32 2147483647
00260 #define NPY_MIN_INT32 (-NPY_MAX_INT32 - 1)
00261 #define NPY_MAX_UINT32 4294967295U
00262 #define NPY_MAX_INT64 NPY_LONGLONG_SUFFIX(9223372036854775807)
00263 #define NPY_MIN_INT64 (-NPY_MAX_INT64 - NPY_LONGLONG_SUFFIX(1))
00264 #define NPY_MAX_UINT64 NPY_ULONGLONG_SUFFIX(18446744073709551615)
00265 #define NPY_MAX_INT128 NPY_LONGLONG_SUFFIX(85070591730234615865843651857942052864)
00266 #define NPY_MIN_INT128 (-NPY_MAX_INT128 - NPY_LONGLONG_SUFFIX(1))
00267 #define NPY_MAX_UINT128 NPY_ULONGLONG_SUFFIX(170141183460469231731687303715884105728)
00268 #define NPY_MAX_INT256 NPY_LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967)
00269 #define NPY_MIN_INT256 (-NPY_MAX_INT256 - NPY_LONGLONG_SUFFIX(1))
00270 #define NPY_MAX_UINT256 NPY_ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935)
00271 #define NPY_MIN_DATETIME NPY_MIN_INT64
00272 #define NPY_MAX_DATETIME NPY_MAX_INT64
00273 #define NPY_MIN_TIMEDELTA NPY_MIN_INT64
00274 #define NPY_MAX_TIMEDELTA NPY_MAX_INT64
00275 
00276         /* Need to find the number of bits for each type and
00277            make definitions accordingly.
00278 
00279            C states that sizeof(char) == 1 by definition
00280 
00281            So, just using the sizeof keyword won't help.
00282 
00283            It also looks like Python itself uses sizeof(char) quite a
00284            bit, which by definition should be 1 all the time.
00285 
00286            Idea: Make Use of CHAR_BIT which should tell us how many
00287            BITS per CHARACTER
00288         */
00289 
00290         /* Include platform definitions -- These are in the C89/90 standard */
00291 #include <limits.h>
00292 #define NPY_MAX_BYTE SCHAR_MAX
00293 #define NPY_MIN_BYTE SCHAR_MIN
00294 #define NPY_MAX_UBYTE UCHAR_MAX
00295 #define NPY_MAX_SHORT SHRT_MAX
00296 #define NPY_MIN_SHORT SHRT_MIN
00297 #define NPY_MAX_USHORT USHRT_MAX
00298 #define NPY_MAX_INT   INT_MAX
00299 #ifndef INT_MIN
00300 #define INT_MIN (-INT_MAX - 1)
00301 #endif
00302 #define NPY_MIN_INT   INT_MIN
00303 #define NPY_MAX_UINT  UINT_MAX
00304 #define NPY_MAX_LONG  LONG_MAX
00305 #define NPY_MIN_LONG  LONG_MIN
00306 #define NPY_MAX_ULONG  ULONG_MAX
00307 
00308 #define NPY_SIZEOF_HALF 2
00309 #define NPY_SIZEOF_DATETIME 8
00310 #define NPY_SIZEOF_TIMEDELTA 8
00311 
00312 #define NPY_BITSOF_BOOL (sizeof(npy_bool) * CHAR_BIT)
00313 #define NPY_BITSOF_CHAR CHAR_BIT
00314 #define NPY_BITSOF_BYTE (NPY_SIZEOF_BYTE * CHAR_BIT)
00315 #define NPY_BITSOF_SHORT (NPY_SIZEOF_SHORT * CHAR_BIT)
00316 #define NPY_BITSOF_INT (NPY_SIZEOF_INT * CHAR_BIT)
00317 #define NPY_BITSOF_LONG (NPY_SIZEOF_LONG * CHAR_BIT)
00318 #define NPY_BITSOF_LONGLONG (NPY_SIZEOF_LONGLONG * CHAR_BIT)
00319 #define NPY_BITSOF_INTP (NPY_SIZEOF_INTP * CHAR_BIT)
00320 #define NPY_BITSOF_HALF (NPY_SIZEOF_HALF * CHAR_BIT)
00321 #define NPY_BITSOF_FLOAT (NPY_SIZEOF_FLOAT * CHAR_BIT)
00322 #define NPY_BITSOF_DOUBLE (NPY_SIZEOF_DOUBLE * CHAR_BIT)
00323 #define NPY_BITSOF_LONGDOUBLE (NPY_SIZEOF_LONGDOUBLE * CHAR_BIT)
00324 #define NPY_BITSOF_CFLOAT (NPY_SIZEOF_CFLOAT * CHAR_BIT)
00325 #define NPY_BITSOF_CDOUBLE (NPY_SIZEOF_CDOUBLE * CHAR_BIT)
00326 #define NPY_BITSOF_CLONGDOUBLE (NPY_SIZEOF_CLONGDOUBLE * CHAR_BIT)
00327 #define NPY_BITSOF_DATETIME (NPY_SIZEOF_DATETIME * CHAR_BIT)
00328 #define NPY_BITSOF_TIMEDELTA (NPY_SIZEOF_TIMEDELTA * CHAR_BIT)
00329 
00330 #if NPY_BITSOF_LONG == 8
00331 #define NPY_INT8 NPY_LONG
00332 #define NPY_UINT8 NPY_ULONG
00333         typedef long npy_int8;
00334         typedef unsigned long npy_uint8;
00335 #define PyInt8ScalarObject PyLongScalarObject
00336 #define PyInt8ArrType_Type PyLongArrType_Type
00337 #define PyUInt8ScalarObject PyULongScalarObject
00338 #define PyUInt8ArrType_Type PyULongArrType_Type
00339 #define NPY_INT8_FMT NPY_LONG_FMT
00340 #define NPY_UINT8_FMT NPY_ULONG_FMT
00341 #elif NPY_BITSOF_LONG == 16
00342 #define NPY_INT16 NPY_LONG
00343 #define NPY_UINT16 NPY_ULONG
00344         typedef long npy_int16;
00345         typedef unsigned long npy_uint16;
00346 #define PyInt16ScalarObject PyLongScalarObject
00347 #define PyInt16ArrType_Type PyLongArrType_Type
00348 #define PyUInt16ScalarObject PyULongScalarObject
00349 #define PyUInt16ArrType_Type PyULongArrType_Type
00350 #define NPY_INT16_FMT NPY_LONG_FMT
00351 #define NPY_UINT16_FMT NPY_ULONG_FMT
00352 #elif NPY_BITSOF_LONG == 32
00353 #define NPY_INT32 NPY_LONG
00354 #define NPY_UINT32 NPY_ULONG
00355         typedef long npy_int32;
00356         typedef unsigned long npy_uint32;
00357         typedef unsigned long npy_ucs4;
00358 #define PyInt32ScalarObject PyLongScalarObject
00359 #define PyInt32ArrType_Type PyLongArrType_Type
00360 #define PyUInt32ScalarObject PyULongScalarObject
00361 #define PyUInt32ArrType_Type PyULongArrType_Type
00362 #define NPY_INT32_FMT NPY_LONG_FMT
00363 #define NPY_UINT32_FMT NPY_ULONG_FMT
00364 #elif NPY_BITSOF_LONG == 64
00365 #define NPY_INT64 NPY_LONG
00366 #define NPY_UINT64 NPY_ULONG
00367         typedef long npy_int64;
00368         typedef unsigned long npy_uint64;
00369 #define PyInt64ScalarObject PyLongScalarObject
00370 #define PyInt64ArrType_Type PyLongArrType_Type
00371 #define PyUInt64ScalarObject PyULongScalarObject
00372 #define PyUInt64ArrType_Type PyULongArrType_Type
00373 #define NPY_INT64_FMT NPY_LONG_FMT
00374 #define NPY_UINT64_FMT NPY_ULONG_FMT
00375 #define MyPyLong_FromInt64 PyLong_FromLong
00376 #define MyPyLong_AsInt64 PyLong_AsLong
00377 #elif NPY_BITSOF_LONG == 128
00378 #define NPY_INT128 NPY_LONG
00379 #define NPY_UINT128 NPY_ULONG
00380         typedef long npy_int128;
00381         typedef unsigned long npy_uint128;
00382 #define PyInt128ScalarObject PyLongScalarObject
00383 #define PyInt128ArrType_Type PyLongArrType_Type
00384 #define PyUInt128ScalarObject PyULongScalarObject
00385 #define PyUInt128ArrType_Type PyULongArrType_Type
00386 #define NPY_INT128_FMT NPY_LONG_FMT
00387 #define NPY_UINT128_FMT NPY_ULONG_FMT
00388 #endif
00389 
00390 #if NPY_BITSOF_LONGLONG == 8
00391 #  ifndef NPY_INT8
00392 #    define NPY_INT8 NPY_LONGLONG
00393 #    define NPY_UINT8 NPY_ULONGLONG
00394         typedef npy_longlong npy_int8;
00395         typedef npy_ulonglong npy_uint8;
00396 #    define PyInt8ScalarObject PyLongLongScalarObject
00397 #    define PyInt8ArrType_Type PyLongLongArrType_Type
00398 #    define PyUInt8ScalarObject PyULongLongScalarObject
00399 #    define PyUInt8ArrType_Type PyULongLongArrType_Type
00400 #define NPY_INT8_FMT NPY_LONGLONG_FMT
00401 #define NPY_UINT8_FMT NPY_ULONGLONG_FMT
00402 #  endif
00403 #  define NPY_MAX_LONGLONG NPY_MAX_INT8
00404 #  define NPY_MIN_LONGLONG NPY_MIN_INT8
00405 #  define NPY_MAX_ULONGLONG NPY_MAX_UINT8
00406 #elif NPY_BITSOF_LONGLONG == 16
00407 #  ifndef NPY_INT16
00408 #    define NPY_INT16 NPY_LONGLONG
00409 #    define NPY_UINT16 NPY_ULONGLONG
00410         typedef npy_longlong npy_int16;
00411         typedef npy_ulonglong npy_uint16;
00412 #    define PyInt16ScalarObject PyLongLongScalarObject
00413 #    define PyInt16ArrType_Type PyLongLongArrType_Type
00414 #    define PyUInt16ScalarObject PyULongLongScalarObject
00415 #    define PyUInt16ArrType_Type PyULongLongArrType_Type
00416 #define NPY_INT16_FMT NPY_LONGLONG_FMT
00417 #define NPY_UINT16_FMT NPY_ULONGLONG_FMT
00418 #  endif
00419 #  define NPY_MAX_LONGLONG NPY_MAX_INT16
00420 #  define NPY_MIN_LONGLONG NPY_MIN_INT16
00421 #  define NPY_MAX_ULONGLONG NPY_MAX_UINT16
00422 #elif NPY_BITSOF_LONGLONG == 32
00423 #  ifndef NPY_INT32
00424 #    define NPY_INT32 NPY_LONGLONG
00425 #    define NPY_UINT32 NPY_ULONGLONG
00426         typedef npy_longlong npy_int32;
00427         typedef npy_ulonglong npy_uint32;
00428         typedef npy_ulonglong npy_ucs4;
00429 #    define PyInt32ScalarObject PyLongLongScalarObject
00430 #    define PyInt32ArrType_Type PyLongLongArrType_Type
00431 #    define PyUInt32ScalarObject PyULongLongScalarObject
00432 #    define PyUInt32ArrType_Type PyULongLongArrType_Type
00433 #define NPY_INT32_FMT NPY_LONGLONG_FMT
00434 #define NPY_UINT32_FMT NPY_ULONGLONG_FMT
00435 #  endif
00436 #  define NPY_MAX_LONGLONG NPY_MAX_INT32
00437 #  define NPY_MIN_LONGLONG NPY_MIN_INT32
00438 #  define NPY_MAX_ULONGLONG NPY_MAX_UINT32
00439 #elif NPY_BITSOF_LONGLONG == 64
00440 #  ifndef NPY_INT64
00441 #    define NPY_INT64 NPY_LONGLONG
00442 #    define NPY_UINT64 NPY_ULONGLONG
00443         typedef npy_longlong npy_int64;
00444         typedef npy_ulonglong npy_uint64;
00445 #    define PyInt64ScalarObject PyLongLongScalarObject
00446 #    define PyInt64ArrType_Type PyLongLongArrType_Type
00447 #    define PyUInt64ScalarObject PyULongLongScalarObject
00448 #    define PyUInt64ArrType_Type PyULongLongArrType_Type
00449 #define NPY_INT64_FMT NPY_LONGLONG_FMT
00450 #define NPY_UINT64_FMT NPY_ULONGLONG_FMT
00451 #    define MyPyLong_FromInt64 PyLong_FromLongLong
00452 #    define MyPyLong_AsInt64 PyLong_AsLongLong
00453 #  endif
00454 #  define NPY_MAX_LONGLONG NPY_MAX_INT64
00455 #  define NPY_MIN_LONGLONG NPY_MIN_INT64
00456 #  define NPY_MAX_ULONGLONG NPY_MAX_UINT64
00457 #elif NPY_BITSOF_LONGLONG == 128
00458 #  ifndef NPY_INT128
00459 #    define NPY_INT128 NPY_LONGLONG
00460 #    define NPY_UINT128 NPY_ULONGLONG
00461         typedef npy_longlong npy_int128;
00462         typedef npy_ulonglong npy_uint128;
00463 #    define PyInt128ScalarObject PyLongLongScalarObject
00464 #    define PyInt128ArrType_Type PyLongLongArrType_Type
00465 #    define PyUInt128ScalarObject PyULongLongScalarObject
00466 #    define PyUInt128ArrType_Type PyULongLongArrType_Type
00467 #define NPY_INT128_FMT NPY_LONGLONG_FMT
00468 #define NPY_UINT128_FMT NPY_ULONGLONG_FMT
00469 #  endif
00470 #  define NPY_MAX_LONGLONG NPY_MAX_INT128
00471 #  define NPY_MIN_LONGLONG NPY_MIN_INT128
00472 #  define NPY_MAX_ULONGLONG NPY_MAX_UINT128
00473 #elif NPY_BITSOF_LONGLONG == 256
00474 #  define NPY_INT256 NPY_LONGLONG
00475 #  define NPY_UINT256 NPY_ULONGLONG
00476         typedef npy_longlong npy_int256;
00477         typedef npy_ulonglong npy_uint256;
00478 #  define PyInt256ScalarObject PyLongLongScalarObject
00479 #  define PyInt256ArrType_Type PyLongLongArrType_Type
00480 #  define PyUInt256ScalarObject PyULongLongScalarObject
00481 #  define PyUInt256ArrType_Type PyULongLongArrType_Type
00482 #define NPY_INT256_FMT NPY_LONGLONG_FMT
00483 #define NPY_UINT256_FMT NPY_ULONGLONG_FMT
00484 #  define NPY_MAX_LONGLONG NPY_MAX_INT256
00485 #  define NPY_MIN_LONGLONG NPY_MIN_INT256
00486 #  define NPY_MAX_ULONGLONG NPY_MAX_UINT256
00487 #endif
00488 
00489 #if NPY_BITSOF_INT == 8
00490 #ifndef NPY_INT8
00491 #define NPY_INT8 NPY_INT
00492 #define NPY_UINT8 NPY_UINT
00493         typedef int npy_int8;
00494         typedef unsigned int npy_uint8;
00495 #    define PyInt8ScalarObject PyIntScalarObject
00496 #    define PyInt8ArrType_Type PyIntArrType_Type
00497 #    define PyUInt8ScalarObject PyUIntScalarObject
00498 #    define PyUInt8ArrType_Type PyUIntArrType_Type
00499 #define NPY_INT8_FMT NPY_INT_FMT
00500 #define NPY_UINT8_FMT NPY_UINT_FMT
00501 #endif
00502 #elif NPY_BITSOF_INT == 16
00503 #ifndef NPY_INT16
00504 #define NPY_INT16 NPY_INT
00505 #define NPY_UINT16 NPY_UINT
00506         typedef int npy_int16;
00507         typedef unsigned int npy_uint16;
00508 #    define PyInt16ScalarObject PyIntScalarObject
00509 #    define PyInt16ArrType_Type PyIntArrType_Type
00510 #    define PyUInt16ScalarObject PyIntUScalarObject
00511 #    define PyUInt16ArrType_Type PyIntUArrType_Type
00512 #define NPY_INT16_FMT NPY_INT_FMT
00513 #define NPY_UINT16_FMT NPY_UINT_FMT
00514 #endif
00515 #elif NPY_BITSOF_INT == 32
00516 #ifndef NPY_INT32
00517 #define NPY_INT32 NPY_INT
00518 #define NPY_UINT32 NPY_UINT
00519         typedef int npy_int32;
00520         typedef unsigned int npy_uint32;
00521         typedef unsigned int npy_ucs4;
00522 #    define PyInt32ScalarObject PyIntScalarObject
00523 #    define PyInt32ArrType_Type PyIntArrType_Type
00524 #    define PyUInt32ScalarObject PyUIntScalarObject
00525 #    define PyUInt32ArrType_Type PyUIntArrType_Type
00526 #define NPY_INT32_FMT NPY_INT_FMT
00527 #define NPY_UINT32_FMT NPY_UINT_FMT
00528 #endif
00529 #elif NPY_BITSOF_INT == 64
00530 #ifndef NPY_INT64
00531 #define NPY_INT64 NPY_INT
00532 #define NPY_UINT64 NPY_UINT
00533         typedef int npy_int64;
00534         typedef unsigned int npy_uint64;
00535 #    define PyInt64ScalarObject PyIntScalarObject
00536 #    define PyInt64ArrType_Type PyIntArrType_Type
00537 #    define PyUInt64ScalarObject PyUIntScalarObject
00538 #    define PyUInt64ArrType_Type PyUIntArrType_Type
00539 #define NPY_INT64_FMT NPY_INT_FMT
00540 #define NPY_UINT64_FMT NPY_UINT_FMT
00541 #    define MyPyLong_FromInt64 PyLong_FromLong
00542 #    define MyPyLong_AsInt64 PyLong_AsLong
00543 #endif
00544 #elif NPY_BITSOF_INT == 128
00545 #ifndef NPY_INT128
00546 #define NPY_INT128 NPY_INT
00547 #define NPY_UINT128 NPY_UINT
00548         typedef int npy_int128;
00549         typedef unsigned int npy_uint128;
00550 #    define PyInt128ScalarObject PyIntScalarObject
00551 #    define PyInt128ArrType_Type PyIntArrType_Type
00552 #    define PyUInt128ScalarObject PyUIntScalarObject
00553 #    define PyUInt128ArrType_Type PyUIntArrType_Type
00554 #define NPY_INT128_FMT NPY_INT_FMT
00555 #define NPY_UINT128_FMT NPY_UINT_FMT
00556 #endif
00557 #endif
00558 
00559 #if NPY_BITSOF_SHORT == 8
00560 #ifndef NPY_INT8
00561 #define NPY_INT8 NPY_SHORT
00562 #define NPY_UINT8 NPY_USHORT
00563         typedef short npy_int8;
00564         typedef unsigned short npy_uint8;
00565 #    define PyInt8ScalarObject PyShortScalarObject
00566 #    define PyInt8ArrType_Type PyShortArrType_Type
00567 #    define PyUInt8ScalarObject PyUShortScalarObject
00568 #    define PyUInt8ArrType_Type PyUShortArrType_Type
00569 #define NPY_INT8_FMT NPY_SHORT_FMT
00570 #define NPY_UINT8_FMT NPY_USHORT_FMT
00571 #endif
00572 #elif NPY_BITSOF_SHORT == 16
00573 #ifndef NPY_INT16
00574 #define NPY_INT16 NPY_SHORT
00575 #define NPY_UINT16 NPY_USHORT
00576         typedef short npy_int16;
00577         typedef unsigned short npy_uint16;
00578 #    define PyInt16ScalarObject PyShortScalarObject
00579 #    define PyInt16ArrType_Type PyShortArrType_Type
00580 #    define PyUInt16ScalarObject PyUShortScalarObject
00581 #    define PyUInt16ArrType_Type PyUShortArrType_Type
00582 #define NPY_INT16_FMT NPY_SHORT_FMT
00583 #define NPY_UINT16_FMT NPY_USHORT_FMT
00584 #endif
00585 #elif NPY_BITSOF_SHORT == 32
00586 #ifndef NPY_INT32
00587 #define NPY_INT32 NPY_SHORT
00588 #define NPY_UINT32 NPY_USHORT
00589         typedef short npy_int32;
00590         typedef unsigned short npy_uint32;
00591         typedef unsigned short npy_ucs4;
00592 #    define PyInt32ScalarObject PyShortScalarObject
00593 #    define PyInt32ArrType_Type PyShortArrType_Type
00594 #    define PyUInt32ScalarObject PyUShortScalarObject
00595 #    define PyUInt32ArrType_Type PyUShortArrType_Type
00596 #define NPY_INT32_FMT NPY_SHORT_FMT
00597 #define NPY_UINT32_FMT NPY_USHORT_FMT
00598 #endif
00599 #elif NPY_BITSOF_SHORT == 64
00600 #ifndef NPY_INT64
00601 #define NPY_INT64 NPY_SHORT
00602 #define NPY_UINT64 NPY_USHORT
00603         typedef short npy_int64;
00604         typedef unsigned short npy_uint64;
00605 #    define PyInt64ScalarObject PyShortScalarObject
00606 #    define PyInt64ArrType_Type PyShortArrType_Type
00607 #    define PyUInt64ScalarObject PyUShortScalarObject
00608 #    define PyUInt64ArrType_Type PyUShortArrType_Type
00609 #define NPY_INT64_FMT NPY_SHORT_FMT
00610 #define NPY_UINT64_FMT NPY_USHORT_FMT
00611 #    define MyPyLong_FromInt64 PyLong_FromLong
00612 #    define MyPyLong_AsInt64 PyLong_AsLong
00613 #endif
00614 #elif NPY_BITSOF_SHORT == 128
00615 #ifndef NPY_INT128
00616 #define NPY_INT128 NPY_SHORT
00617 #define NPY_UINT128 NPY_USHORT
00618         typedef short npy_int128;
00619         typedef unsigned short npy_uint128;
00620 #    define PyInt128ScalarObject PyShortScalarObject
00621 #    define PyInt128ArrType_Type PyShortArrType_Type
00622 #    define PyUInt128ScalarObject PyUShortScalarObject
00623 #    define PyUInt128ArrType_Type PyUShortArrType_Type
00624 #define NPY_INT128_FMT NPY_SHORT_FMT
00625 #define NPY_UINT128_FMT NPY_USHORT_FMT
00626 #endif
00627 #endif
00628 
00629 
00630 #if NPY_BITSOF_CHAR == 8
00631 #ifndef NPY_INT8
00632 #define NPY_INT8 NPY_BYTE
00633 #define NPY_UINT8 NPY_UBYTE
00634         typedef signed char npy_int8;
00635         typedef unsigned char npy_uint8;
00636 #    define PyInt8ScalarObject PyByteScalarObject
00637 #    define PyInt8ArrType_Type PyByteArrType_Type
00638 #    define PyUInt8ScalarObject PyUByteScalarObject
00639 #    define PyUInt8ArrType_Type PyUByteArrType_Type
00640 #define NPY_INT8_FMT NPY_BYTE_FMT
00641 #define NPY_UINT8_FMT NPY_UBYTE_FMT
00642 #endif
00643 #elif NPY_BITSOF_CHAR == 16
00644 #ifndef NPY_INT16
00645 #define NPY_INT16 NPY_BYTE
00646 #define NPY_UINT16 NPY_UBYTE
00647         typedef signed char npy_int16;
00648         typedef unsigned char npy_uint16;
00649 #    define PyInt16ScalarObject PyByteScalarObject
00650 #    define PyInt16ArrType_Type PyByteArrType_Type
00651 #    define PyUInt16ScalarObject PyUByteScalarObject
00652 #    define PyUInt16ArrType_Type PyUByteArrType_Type
00653 #define NPY_INT16_FMT NPY_BYTE_FMT
00654 #define NPY_UINT16_FMT NPY_UBYTE_FMT
00655 #endif
00656 #elif NPY_BITSOF_CHAR == 32
00657 #ifndef NPY_INT32
00658 #define NPY_INT32 NPY_BYTE
00659 #define NPY_UINT32 NPY_UBYTE
00660         typedef signed char npy_int32;
00661         typedef unsigned char npy_uint32;
00662         typedef unsigned char npy_ucs4;
00663 #    define PyInt32ScalarObject PyByteScalarObject
00664 #    define PyInt32ArrType_Type PyByteArrType_Type
00665 #    define PyUInt32ScalarObject PyUByteScalarObject
00666 #    define PyUInt32ArrType_Type PyUByteArrType_Type
00667 #define NPY_INT32_FMT NPY_BYTE_FMT
00668 #define NPY_UINT32_FMT NPY_UBYTE_FMT
00669 #endif
00670 #elif NPY_BITSOF_CHAR == 64
00671 #ifndef NPY_INT64
00672 #define NPY_INT64 NPY_BYTE
00673 #define NPY_UINT64 NPY_UBYTE
00674         typedef signed char npy_int64;
00675         typedef unsigned char npy_uint64;
00676 #    define PyInt64ScalarObject PyByteScalarObject
00677 #    define PyInt64ArrType_Type PyByteArrType_Type
00678 #    define PyUInt64ScalarObject PyUByteScalarObject
00679 #    define PyUInt64ArrType_Type PyUByteArrType_Type
00680 #define NPY_INT64_FMT NPY_BYTE_FMT
00681 #define NPY_UINT64_FMT NPY_UBYTE_FMT
00682 #    define MyPyLong_FromInt64 PyLong_FromLong
00683 #    define MyPyLong_AsInt64 PyLong_AsLong
00684 #endif
00685 #elif NPY_BITSOF_CHAR == 128
00686 #ifndef NPY_INT128
00687 #define NPY_INT128 NPY_BYTE
00688 #define NPY_UINT128 NPY_UBYTE
00689         typedef signed char npy_int128;
00690         typedef unsigned char npy_uint128;
00691 #    define PyInt128ScalarObject PyByteScalarObject
00692 #    define PyInt128ArrType_Type PyByteArrType_Type
00693 #    define PyUInt128ScalarObject PyUByteScalarObject
00694 #    define PyUInt128ArrType_Type PyUByteArrType_Type
00695 #define NPY_INT128_FMT NPY_BYTE_FMT
00696 #define NPY_UINT128_FMT NPY_UBYTE_FMT
00697 #endif
00698 #endif
00699 
00700 
00701 
00702 #if NPY_BITSOF_DOUBLE == 32
00703 #ifndef NPY_FLOAT32
00704 #define NPY_FLOAT32 NPY_DOUBLE
00705 #define NPY_COMPLEX64 NPY_CDOUBLE
00706         typedef double npy_float32;
00707         typedef npy_cdouble npy_complex64;
00708 #    define PyFloat32ScalarObject PyDoubleScalarObject
00709 #    define PyComplex64ScalarObject PyCDoubleScalarObject
00710 #    define PyFloat32ArrType_Type PyDoubleArrType_Type
00711 #    define PyComplex64ArrType_Type PyCDoubleArrType_Type
00712 #define NPY_FLOAT32_FMT NPY_DOUBLE_FMT
00713 #define NPY_COMPLEX64_FMT NPY_CDOUBLE_FMT
00714 #endif
00715 #elif NPY_BITSOF_DOUBLE == 64
00716 #ifndef NPY_FLOAT64
00717 #define NPY_FLOAT64 NPY_DOUBLE
00718 #define NPY_COMPLEX128 NPY_CDOUBLE
00719         typedef double npy_float64;
00720         typedef npy_cdouble npy_complex128;
00721 #    define PyFloat64ScalarObject PyDoubleScalarObject
00722 #    define PyComplex128ScalarObject PyCDoubleScalarObject
00723 #    define PyFloat64ArrType_Type PyDoubleArrType_Type
00724 #    define PyComplex128ArrType_Type PyCDoubleArrType_Type
00725 #define NPY_FLOAT64_FMT NPY_DOUBLE_FMT
00726 #define NPY_COMPLEX128_FMT NPY_CDOUBLE_FMT
00727 #endif
00728 #elif NPY_BITSOF_DOUBLE == 80
00729 #ifndef NPY_FLOAT80
00730 #define NPY_FLOAT80 NPY_DOUBLE
00731 #define NPY_COMPLEX160 NPY_CDOUBLE
00732         typedef double npy_float80;
00733         typedef npy_cdouble npy_complex160;
00734 #    define PyFloat80ScalarObject PyDoubleScalarObject
00735 #    define PyComplex160ScalarObject PyCDoubleScalarObject
00736 #    define PyFloat80ArrType_Type PyDoubleArrType_Type
00737 #    define PyComplex160ArrType_Type PyCDoubleArrType_Type
00738 #define NPY_FLOAT80_FMT NPY_DOUBLE_FMT
00739 #define NPY_COMPLEX160_FMT NPY_CDOUBLE_FMT
00740 #endif
00741 #elif NPY_BITSOF_DOUBLE == 96
00742 #ifndef NPY_FLOAT96
00743 #define NPY_FLOAT96 NPY_DOUBLE
00744 #define NPY_COMPLEX192 NPY_CDOUBLE
00745         typedef double npy_float96;
00746         typedef npy_cdouble npy_complex192;
00747 #    define PyFloat96ScalarObject PyDoubleScalarObject
00748 #    define PyComplex192ScalarObject PyCDoubleScalarObject
00749 #    define PyFloat96ArrType_Type PyDoubleArrType_Type
00750 #    define PyComplex192ArrType_Type PyCDoubleArrType_Type
00751 #define NPY_FLOAT96_FMT NPY_DOUBLE_FMT
00752 #define NPY_COMPLEX192_FMT NPY_CDOUBLE_FMT
00753 #endif
00754 #elif NPY_BITSOF_DOUBLE == 128
00755 #ifndef NPY_FLOAT128
00756 #define NPY_FLOAT128 NPY_DOUBLE
00757 #define NPY_COMPLEX256 NPY_CDOUBLE
00758         typedef double npy_float128;
00759         typedef npy_cdouble npy_complex256;
00760 #    define PyFloat128ScalarObject PyDoubleScalarObject
00761 #    define PyComplex256ScalarObject PyCDoubleScalarObject
00762 #    define PyFloat128ArrType_Type PyDoubleArrType_Type
00763 #    define PyComplex256ArrType_Type PyCDoubleArrType_Type
00764 #define NPY_FLOAT128_FMT NPY_DOUBLE_FMT
00765 #define NPY_COMPLEX256_FMT NPY_CDOUBLE_FMT
00766 #endif
00767 #endif
00768 
00769 
00770 
00771 #if NPY_BITSOF_FLOAT == 32
00772 #ifndef NPY_FLOAT32
00773 #define NPY_FLOAT32 NPY_FLOAT
00774 #define NPY_COMPLEX64 NPY_CFLOAT
00775         typedef float npy_float32;
00776         typedef npy_cfloat npy_complex64;
00777 #    define PyFloat32ScalarObject PyFloatScalarObject
00778 #    define PyComplex64ScalarObject PyCFloatScalarObject
00779 #    define PyFloat32ArrType_Type PyFloatArrType_Type
00780 #    define PyComplex64ArrType_Type PyCFloatArrType_Type
00781 #define NPY_FLOAT32_FMT NPY_FLOAT_FMT
00782 #define NPY_COMPLEX64_FMT NPY_CFLOAT_FMT
00783 #endif
00784 #elif NPY_BITSOF_FLOAT == 64
00785 #ifndef NPY_FLOAT64
00786 #define NPY_FLOAT64 NPY_FLOAT
00787 #define NPY_COMPLEX128 NPY_CFLOAT
00788         typedef float npy_float64;
00789         typedef npy_cfloat npy_complex128;
00790 #    define PyFloat64ScalarObject PyFloatScalarObject
00791 #    define PyComplex128ScalarObject PyCFloatScalarObject
00792 #    define PyFloat64ArrType_Type PyFloatArrType_Type
00793 #    define PyComplex128ArrType_Type PyCFloatArrType_Type
00794 #define NPY_FLOAT64_FMT NPY_FLOAT_FMT
00795 #define NPY_COMPLEX128_FMT NPY_CFLOAT_FMT
00796 #endif
00797 #elif NPY_BITSOF_FLOAT == 80
00798 #ifndef NPY_FLOAT80
00799 #define NPY_FLOAT80 NPY_FLOAT
00800 #define NPY_COMPLEX160 NPY_CFLOAT
00801         typedef float npy_float80;
00802         typedef npy_cfloat npy_complex160;
00803 #    define PyFloat80ScalarObject PyFloatScalarObject
00804 #    define PyComplex160ScalarObject PyCFloatScalarObject
00805 #    define PyFloat80ArrType_Type PyFloatArrType_Type
00806 #    define PyComplex160ArrType_Type PyCFloatArrType_Type
00807 #define NPY_FLOAT80_FMT NPY_FLOAT_FMT
00808 #define NPY_COMPLEX160_FMT NPY_CFLOAT_FMT
00809 #endif
00810 #elif NPY_BITSOF_FLOAT == 96
00811 #ifndef NPY_FLOAT96
00812 #define NPY_FLOAT96 NPY_FLOAT
00813 #define NPY_COMPLEX192 NPY_CFLOAT
00814         typedef float npy_float96;
00815         typedef npy_cfloat npy_complex192;
00816 #    define PyFloat96ScalarObject PyFloatScalarObject
00817 #    define PyComplex192ScalarObject PyCFloatScalarObject
00818 #    define PyFloat96ArrType_Type PyFloatArrType_Type
00819 #    define PyComplex192ArrType_Type PyCFloatArrType_Type
00820 #define NPY_FLOAT96_FMT NPY_FLOAT_FMT
00821 #define NPY_COMPLEX192_FMT NPY_CFLOAT_FMT
00822 #endif
00823 #elif NPY_BITSOF_FLOAT == 128
00824 #ifndef NPY_FLOAT128
00825 #define NPY_FLOAT128 NPY_FLOAT
00826 #define NPY_COMPLEX256 NPY_CFLOAT
00827         typedef float npy_float128;
00828         typedef npy_cfloat npy_complex256;
00829 #    define PyFloat128ScalarObject PyFloatScalarObject
00830 #    define PyComplex256ScalarObject PyCFloatScalarObject
00831 #    define PyFloat128ArrType_Type PyFloatArrType_Type
00832 #    define PyComplex256ArrType_Type PyCFloatArrType_Type
00833 #define NPY_FLOAT128_FMT NPY_FLOAT_FMT
00834 #define NPY_COMPLEX256_FMT NPY_CFLOAT_FMT
00835 #endif
00836 #endif
00837 
00838 /* half/float16 isn't a floating-point type in C */
00839 #define NPY_FLOAT16 NPY_HALF
00840 typedef npy_uint16 npy_half;
00841 typedef npy_half npy_float16;
00842 
00843 #if NPY_BITSOF_LONGDOUBLE == 32
00844 #ifndef NPY_FLOAT32
00845 #define NPY_FLOAT32 NPY_LONGDOUBLE
00846 #define NPY_COMPLEX64 NPY_CLONGDOUBLE
00847         typedef npy_longdouble npy_float32;
00848         typedef npy_clongdouble npy_complex64;
00849 #    define PyFloat32ScalarObject PyLongDoubleScalarObject
00850 #    define PyComplex64ScalarObject PyCLongDoubleScalarObject
00851 #    define PyFloat32ArrType_Type PyLongDoubleArrType_Type
00852 #    define PyComplex64ArrType_Type PyCLongDoubleArrType_Type
00853 #define NPY_FLOAT32_FMT NPY_LONGDOUBLE_FMT
00854 #define NPY_COMPLEX64_FMT NPY_CLONGDOUBLE_FMT
00855 #endif
00856 #elif NPY_BITSOF_LONGDOUBLE == 64
00857 #ifndef NPY_FLOAT64
00858 #define NPY_FLOAT64 NPY_LONGDOUBLE
00859 #define NPY_COMPLEX128 NPY_CLONGDOUBLE
00860         typedef npy_longdouble npy_float64;
00861         typedef npy_clongdouble npy_complex128;
00862 #    define PyFloat64ScalarObject PyLongDoubleScalarObject
00863 #    define PyComplex128ScalarObject PyCLongDoubleScalarObject
00864 #    define PyFloat64ArrType_Type PyLongDoubleArrType_Type
00865 #    define PyComplex128ArrType_Type PyCLongDoubleArrType_Type
00866 #define NPY_FLOAT64_FMT NPY_LONGDOUBLE_FMT
00867 #define NPY_COMPLEX128_FMT NPY_CLONGDOUBLE_FMT
00868 #endif
00869 #elif NPY_BITSOF_LONGDOUBLE == 80
00870 #ifndef NPY_FLOAT80
00871 #define NPY_FLOAT80 NPY_LONGDOUBLE
00872 #define NPY_COMPLEX160 NPY_CLONGDOUBLE
00873         typedef npy_longdouble npy_float80;
00874         typedef npy_clongdouble npy_complex160;
00875 #    define PyFloat80ScalarObject PyLongDoubleScalarObject
00876 #    define PyComplex160ScalarObject PyCLongDoubleScalarObject
00877 #    define PyFloat80ArrType_Type PyLongDoubleArrType_Type
00878 #    define PyComplex160ArrType_Type PyCLongDoubleArrType_Type
00879 #define NPY_FLOAT80_FMT NPY_LONGDOUBLE_FMT
00880 #define NPY_COMPLEX160_FMT NPY_CLONGDOUBLE_FMT
00881 #endif
00882 #elif NPY_BITSOF_LONGDOUBLE == 96
00883 #ifndef NPY_FLOAT96
00884 #define NPY_FLOAT96 NPY_LONGDOUBLE
00885 #define NPY_COMPLEX192 NPY_CLONGDOUBLE
00886         typedef npy_longdouble npy_float96;
00887         typedef npy_clongdouble npy_complex192;
00888 #    define PyFloat96ScalarObject PyLongDoubleScalarObject
00889 #    define PyComplex192ScalarObject PyCLongDoubleScalarObject
00890 #    define PyFloat96ArrType_Type PyLongDoubleArrType_Type
00891 #    define PyComplex192ArrType_Type PyCLongDoubleArrType_Type
00892 #define NPY_FLOAT96_FMT NPY_LONGDOUBLE_FMT
00893 #define NPY_COMPLEX192_FMT NPY_CLONGDOUBLE_FMT
00894 #endif
00895 #elif NPY_BITSOF_LONGDOUBLE == 128
00896 #ifndef NPY_FLOAT128
00897 #define NPY_FLOAT128 NPY_LONGDOUBLE
00898 #define NPY_COMPLEX256 NPY_CLONGDOUBLE
00899         typedef npy_longdouble npy_float128;
00900         typedef npy_clongdouble npy_complex256;
00901 #    define PyFloat128ScalarObject PyLongDoubleScalarObject
00902 #    define PyComplex256ScalarObject PyCLongDoubleScalarObject
00903 #    define PyFloat128ArrType_Type PyLongDoubleArrType_Type
00904 #    define PyComplex256ArrType_Type PyCLongDoubleArrType_Type
00905 #define NPY_FLOAT128_FMT NPY_LONGDOUBLE_FMT
00906 #define NPY_COMPLEX256_FMT NPY_CLONGDOUBLE_FMT
00907 #endif
00908 #elif NPY_BITSOF_LONGDOUBLE == 256
00909 #define NPY_FLOAT256 NPY_LONGDOUBLE
00910 #define NPY_COMPLEX512 NPY_CLONGDOUBLE
00911         typedef npy_longdouble npy_float256;
00912         typedef npy_clongdouble npy_complex512;
00913 #    define PyFloat256ScalarObject PyLongDoubleScalarObject
00914 #    define PyComplex512ScalarObject PyCLongDoubleScalarObject
00915 #    define PyFloat256ArrType_Type PyLongDoubleArrType_Type
00916 #    define PyComplex512ArrType_Type PyCLongDoubleArrType_Type
00917 #define NPY_FLOAT256_FMT NPY_LONGDOUBLE_FMT
00918 #define NPY_COMPLEX512_FMT NPY_CLONGDOUBLE_FMT
00919 #endif
00920 
00921 /* datetime typedefs */
00922 typedef npy_int64 npy_timedelta;
00923 typedef npy_int64 npy_datetime;
00924 #define NPY_DATETIME_FMT NPY_INT64_FMT
00925 #define NPY_TIMEDELTA_FMT NPY_INT64_FMT
00926 
00927 /* End of typedefs for numarray style bit-width names */
00928 
00929 #endif
00930