Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/__multiarray_api.c +314 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/__multiarray_api.h +1566 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/__ufunc_api.h +314 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/_dtype_api.h +408 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/_numpyconfig.h +32 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h +12 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/arrayscalars.h +186 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/experimental_dtype_api.h +365 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/halffloat.h +70 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h +251 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h +1945 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/noprefix.h +211 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_common.h +1086 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_cpu.h +129 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_endian.h +77 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_math.h +563 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_no_deprecated_api.h +20 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_os.h +42 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/numpyconfig.h +138 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/old_defines.h +187 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/ufuncobject.h +359 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/utils.h +37 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/_locales.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test__exceptions.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_array_coercion.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_cpu_features.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_custom_dtypes.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_defchararray.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_dlpack.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_getlimits.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_indexerrors.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_item_selection.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_limited_api.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_mem_overlap.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_mem_policy.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_memmap.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_multiarray.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_nditer.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_nep50_promotions.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_numeric.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_numerictypes.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_numpy_2_0_compat.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_overrides.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_print.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_protocols.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalar_methods.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalarbuffer.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalarinherit.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalarmath.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalarprint.cpython-310.pyc +0 -0
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/__multiarray_api.c
ADDED
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* These pointers will be stored in the C-object for use in other
|
3 |
+
extension modules
|
4 |
+
*/
|
5 |
+
|
6 |
+
void *PyArray_API[] = {
|
7 |
+
(void *) PyArray_GetNDArrayCVersion,
|
8 |
+
(void *) &PyBigArray_Type,
|
9 |
+
(void *) &PyArray_Type,
|
10 |
+
(void *) &PyArrayDescr_Type,
|
11 |
+
(void *) &PyArrayFlags_Type,
|
12 |
+
(void *) &PyArrayIter_Type,
|
13 |
+
(void *) &PyArrayMultiIter_Type,
|
14 |
+
(int *) &NPY_NUMUSERTYPES,
|
15 |
+
(void *) &PyBoolArrType_Type,
|
16 |
+
(void *) &_PyArrayScalar_BoolValues,
|
17 |
+
(void *) &PyGenericArrType_Type,
|
18 |
+
(void *) &PyNumberArrType_Type,
|
19 |
+
(void *) &PyIntegerArrType_Type,
|
20 |
+
(void *) &PySignedIntegerArrType_Type,
|
21 |
+
(void *) &PyUnsignedIntegerArrType_Type,
|
22 |
+
(void *) &PyInexactArrType_Type,
|
23 |
+
(void *) &PyFloatingArrType_Type,
|
24 |
+
(void *) &PyComplexFloatingArrType_Type,
|
25 |
+
(void *) &PyFlexibleArrType_Type,
|
26 |
+
(void *) &PyCharacterArrType_Type,
|
27 |
+
(void *) &PyByteArrType_Type,
|
28 |
+
(void *) &PyShortArrType_Type,
|
29 |
+
(void *) &PyIntArrType_Type,
|
30 |
+
(void *) &PyLongArrType_Type,
|
31 |
+
(void *) &PyLongLongArrType_Type,
|
32 |
+
(void *) &PyUByteArrType_Type,
|
33 |
+
(void *) &PyUShortArrType_Type,
|
34 |
+
(void *) &PyUIntArrType_Type,
|
35 |
+
(void *) &PyULongArrType_Type,
|
36 |
+
(void *) &PyULongLongArrType_Type,
|
37 |
+
(void *) &PyFloatArrType_Type,
|
38 |
+
(void *) &PyDoubleArrType_Type,
|
39 |
+
(void *) &PyLongDoubleArrType_Type,
|
40 |
+
(void *) &PyCFloatArrType_Type,
|
41 |
+
(void *) &PyCDoubleArrType_Type,
|
42 |
+
(void *) &PyCLongDoubleArrType_Type,
|
43 |
+
(void *) &PyObjectArrType_Type,
|
44 |
+
(void *) &PyStringArrType_Type,
|
45 |
+
(void *) &PyUnicodeArrType_Type,
|
46 |
+
(void *) &PyVoidArrType_Type,
|
47 |
+
(void *) PyArray_SetNumericOps,
|
48 |
+
(void *) PyArray_GetNumericOps,
|
49 |
+
(void *) PyArray_INCREF,
|
50 |
+
(void *) PyArray_XDECREF,
|
51 |
+
(void *) PyArray_SetStringFunction,
|
52 |
+
(void *) PyArray_DescrFromType,
|
53 |
+
(void *) PyArray_TypeObjectFromType,
|
54 |
+
(void *) PyArray_Zero,
|
55 |
+
(void *) PyArray_One,
|
56 |
+
(void *) PyArray_CastToType,
|
57 |
+
(void *) PyArray_CastTo,
|
58 |
+
(void *) PyArray_CastAnyTo,
|
59 |
+
(void *) PyArray_CanCastSafely,
|
60 |
+
(void *) PyArray_CanCastTo,
|
61 |
+
(void *) PyArray_ObjectType,
|
62 |
+
(void *) PyArray_DescrFromObject,
|
63 |
+
(void *) PyArray_ConvertToCommonType,
|
64 |
+
(void *) PyArray_DescrFromScalar,
|
65 |
+
(void *) PyArray_DescrFromTypeObject,
|
66 |
+
(void *) PyArray_Size,
|
67 |
+
(void *) PyArray_Scalar,
|
68 |
+
(void *) PyArray_FromScalar,
|
69 |
+
(void *) PyArray_ScalarAsCtype,
|
70 |
+
(void *) PyArray_CastScalarToCtype,
|
71 |
+
(void *) PyArray_CastScalarDirect,
|
72 |
+
(void *) PyArray_ScalarFromObject,
|
73 |
+
(void *) PyArray_GetCastFunc,
|
74 |
+
(void *) PyArray_FromDims,
|
75 |
+
(void *) PyArray_FromDimsAndDataAndDescr,
|
76 |
+
(void *) PyArray_FromAny,
|
77 |
+
(void *) PyArray_EnsureArray,
|
78 |
+
(void *) PyArray_EnsureAnyArray,
|
79 |
+
(void *) PyArray_FromFile,
|
80 |
+
(void *) PyArray_FromString,
|
81 |
+
(void *) PyArray_FromBuffer,
|
82 |
+
(void *) PyArray_FromIter,
|
83 |
+
(void *) PyArray_Return,
|
84 |
+
(void *) PyArray_GetField,
|
85 |
+
(void *) PyArray_SetField,
|
86 |
+
(void *) PyArray_Byteswap,
|
87 |
+
(void *) PyArray_Resize,
|
88 |
+
(void *) PyArray_MoveInto,
|
89 |
+
(void *) PyArray_CopyInto,
|
90 |
+
(void *) PyArray_CopyAnyInto,
|
91 |
+
(void *) PyArray_CopyObject,
|
92 |
+
(void *) PyArray_NewCopy,
|
93 |
+
(void *) PyArray_ToList,
|
94 |
+
(void *) PyArray_ToString,
|
95 |
+
(void *) PyArray_ToFile,
|
96 |
+
(void *) PyArray_Dump,
|
97 |
+
(void *) PyArray_Dumps,
|
98 |
+
(void *) PyArray_ValidType,
|
99 |
+
(void *) PyArray_UpdateFlags,
|
100 |
+
(void *) PyArray_New,
|
101 |
+
(void *) PyArray_NewFromDescr,
|
102 |
+
(void *) PyArray_DescrNew,
|
103 |
+
(void *) PyArray_DescrNewFromType,
|
104 |
+
(void *) PyArray_GetPriority,
|
105 |
+
(void *) PyArray_IterNew,
|
106 |
+
(void *) PyArray_MultiIterNew,
|
107 |
+
(void *) PyArray_PyIntAsInt,
|
108 |
+
(void *) PyArray_PyIntAsIntp,
|
109 |
+
(void *) PyArray_Broadcast,
|
110 |
+
(void *) PyArray_FillObjectArray,
|
111 |
+
(void *) PyArray_FillWithScalar,
|
112 |
+
(void *) PyArray_CheckStrides,
|
113 |
+
(void *) PyArray_DescrNewByteorder,
|
114 |
+
(void *) PyArray_IterAllButAxis,
|
115 |
+
(void *) PyArray_CheckFromAny,
|
116 |
+
(void *) PyArray_FromArray,
|
117 |
+
(void *) PyArray_FromInterface,
|
118 |
+
(void *) PyArray_FromStructInterface,
|
119 |
+
(void *) PyArray_FromArrayAttr,
|
120 |
+
(void *) PyArray_ScalarKind,
|
121 |
+
(void *) PyArray_CanCoerceScalar,
|
122 |
+
(void *) PyArray_NewFlagsObject,
|
123 |
+
(void *) PyArray_CanCastScalar,
|
124 |
+
(void *) PyArray_CompareUCS4,
|
125 |
+
(void *) PyArray_RemoveSmallest,
|
126 |
+
(void *) PyArray_ElementStrides,
|
127 |
+
(void *) PyArray_Item_INCREF,
|
128 |
+
(void *) PyArray_Item_XDECREF,
|
129 |
+
(void *) PyArray_FieldNames,
|
130 |
+
(void *) PyArray_Transpose,
|
131 |
+
(void *) PyArray_TakeFrom,
|
132 |
+
(void *) PyArray_PutTo,
|
133 |
+
(void *) PyArray_PutMask,
|
134 |
+
(void *) PyArray_Repeat,
|
135 |
+
(void *) PyArray_Choose,
|
136 |
+
(void *) PyArray_Sort,
|
137 |
+
(void *) PyArray_ArgSort,
|
138 |
+
(void *) PyArray_SearchSorted,
|
139 |
+
(void *) PyArray_ArgMax,
|
140 |
+
(void *) PyArray_ArgMin,
|
141 |
+
(void *) PyArray_Reshape,
|
142 |
+
(void *) PyArray_Newshape,
|
143 |
+
(void *) PyArray_Squeeze,
|
144 |
+
(void *) PyArray_View,
|
145 |
+
(void *) PyArray_SwapAxes,
|
146 |
+
(void *) PyArray_Max,
|
147 |
+
(void *) PyArray_Min,
|
148 |
+
(void *) PyArray_Ptp,
|
149 |
+
(void *) PyArray_Mean,
|
150 |
+
(void *) PyArray_Trace,
|
151 |
+
(void *) PyArray_Diagonal,
|
152 |
+
(void *) PyArray_Clip,
|
153 |
+
(void *) PyArray_Conjugate,
|
154 |
+
(void *) PyArray_Nonzero,
|
155 |
+
(void *) PyArray_Std,
|
156 |
+
(void *) PyArray_Sum,
|
157 |
+
(void *) PyArray_CumSum,
|
158 |
+
(void *) PyArray_Prod,
|
159 |
+
(void *) PyArray_CumProd,
|
160 |
+
(void *) PyArray_All,
|
161 |
+
(void *) PyArray_Any,
|
162 |
+
(void *) PyArray_Compress,
|
163 |
+
(void *) PyArray_Flatten,
|
164 |
+
(void *) PyArray_Ravel,
|
165 |
+
(void *) PyArray_MultiplyList,
|
166 |
+
(void *) PyArray_MultiplyIntList,
|
167 |
+
(void *) PyArray_GetPtr,
|
168 |
+
(void *) PyArray_CompareLists,
|
169 |
+
(void *) PyArray_AsCArray,
|
170 |
+
(void *) PyArray_As1D,
|
171 |
+
(void *) PyArray_As2D,
|
172 |
+
(void *) PyArray_Free,
|
173 |
+
(void *) PyArray_Converter,
|
174 |
+
(void *) PyArray_IntpFromSequence,
|
175 |
+
(void *) PyArray_Concatenate,
|
176 |
+
(void *) PyArray_InnerProduct,
|
177 |
+
(void *) PyArray_MatrixProduct,
|
178 |
+
(void *) PyArray_CopyAndTranspose,
|
179 |
+
(void *) PyArray_Correlate,
|
180 |
+
(void *) PyArray_TypestrConvert,
|
181 |
+
(void *) PyArray_DescrConverter,
|
182 |
+
(void *) PyArray_DescrConverter2,
|
183 |
+
(void *) PyArray_IntpConverter,
|
184 |
+
(void *) PyArray_BufferConverter,
|
185 |
+
(void *) PyArray_AxisConverter,
|
186 |
+
(void *) PyArray_BoolConverter,
|
187 |
+
(void *) PyArray_ByteorderConverter,
|
188 |
+
(void *) PyArray_OrderConverter,
|
189 |
+
(void *) PyArray_EquivTypes,
|
190 |
+
(void *) PyArray_Zeros,
|
191 |
+
(void *) PyArray_Empty,
|
192 |
+
(void *) PyArray_Where,
|
193 |
+
(void *) PyArray_Arange,
|
194 |
+
(void *) PyArray_ArangeObj,
|
195 |
+
(void *) PyArray_SortkindConverter,
|
196 |
+
(void *) PyArray_LexSort,
|
197 |
+
(void *) PyArray_Round,
|
198 |
+
(void *) PyArray_EquivTypenums,
|
199 |
+
(void *) PyArray_RegisterDataType,
|
200 |
+
(void *) PyArray_RegisterCastFunc,
|
201 |
+
(void *) PyArray_RegisterCanCast,
|
202 |
+
(void *) PyArray_InitArrFuncs,
|
203 |
+
(void *) PyArray_IntTupleFromIntp,
|
204 |
+
(void *) PyArray_TypeNumFromName,
|
205 |
+
(void *) PyArray_ClipmodeConverter,
|
206 |
+
(void *) PyArray_OutputConverter,
|
207 |
+
(void *) PyArray_BroadcastToShape,
|
208 |
+
(void *) _PyArray_SigintHandler,
|
209 |
+
(void *) _PyArray_GetSigintBuf,
|
210 |
+
(void *) PyArray_DescrAlignConverter,
|
211 |
+
(void *) PyArray_DescrAlignConverter2,
|
212 |
+
(void *) PyArray_SearchsideConverter,
|
213 |
+
(void *) PyArray_CheckAxis,
|
214 |
+
(void *) PyArray_OverflowMultiplyList,
|
215 |
+
(void *) PyArray_CompareString,
|
216 |
+
(void *) PyArray_MultiIterFromObjects,
|
217 |
+
(void *) PyArray_GetEndianness,
|
218 |
+
(void *) PyArray_GetNDArrayCFeatureVersion,
|
219 |
+
(void *) PyArray_Correlate2,
|
220 |
+
(void *) PyArray_NeighborhoodIterNew,
|
221 |
+
(void *) &PyTimeIntegerArrType_Type,
|
222 |
+
(void *) &PyDatetimeArrType_Type,
|
223 |
+
(void *) &PyTimedeltaArrType_Type,
|
224 |
+
(void *) &PyHalfArrType_Type,
|
225 |
+
(void *) &NpyIter_Type,
|
226 |
+
(void *) PyArray_SetDatetimeParseFunction,
|
227 |
+
(void *) PyArray_DatetimeToDatetimeStruct,
|
228 |
+
(void *) PyArray_TimedeltaToTimedeltaStruct,
|
229 |
+
(void *) PyArray_DatetimeStructToDatetime,
|
230 |
+
(void *) PyArray_TimedeltaStructToTimedelta,
|
231 |
+
(void *) NpyIter_New,
|
232 |
+
(void *) NpyIter_MultiNew,
|
233 |
+
(void *) NpyIter_AdvancedNew,
|
234 |
+
(void *) NpyIter_Copy,
|
235 |
+
(void *) NpyIter_Deallocate,
|
236 |
+
(void *) NpyIter_HasDelayedBufAlloc,
|
237 |
+
(void *) NpyIter_HasExternalLoop,
|
238 |
+
(void *) NpyIter_EnableExternalLoop,
|
239 |
+
(void *) NpyIter_GetInnerStrideArray,
|
240 |
+
(void *) NpyIter_GetInnerLoopSizePtr,
|
241 |
+
(void *) NpyIter_Reset,
|
242 |
+
(void *) NpyIter_ResetBasePointers,
|
243 |
+
(void *) NpyIter_ResetToIterIndexRange,
|
244 |
+
(void *) NpyIter_GetNDim,
|
245 |
+
(void *) NpyIter_GetNOp,
|
246 |
+
(void *) NpyIter_GetIterNext,
|
247 |
+
(void *) NpyIter_GetIterSize,
|
248 |
+
(void *) NpyIter_GetIterIndexRange,
|
249 |
+
(void *) NpyIter_GetIterIndex,
|
250 |
+
(void *) NpyIter_GotoIterIndex,
|
251 |
+
(void *) NpyIter_HasMultiIndex,
|
252 |
+
(void *) NpyIter_GetShape,
|
253 |
+
(void *) NpyIter_GetGetMultiIndex,
|
254 |
+
(void *) NpyIter_GotoMultiIndex,
|
255 |
+
(void *) NpyIter_RemoveMultiIndex,
|
256 |
+
(void *) NpyIter_HasIndex,
|
257 |
+
(void *) NpyIter_IsBuffered,
|
258 |
+
(void *) NpyIter_IsGrowInner,
|
259 |
+
(void *) NpyIter_GetBufferSize,
|
260 |
+
(void *) NpyIter_GetIndexPtr,
|
261 |
+
(void *) NpyIter_GotoIndex,
|
262 |
+
(void *) NpyIter_GetDataPtrArray,
|
263 |
+
(void *) NpyIter_GetDescrArray,
|
264 |
+
(void *) NpyIter_GetOperandArray,
|
265 |
+
(void *) NpyIter_GetIterView,
|
266 |
+
(void *) NpyIter_GetReadFlags,
|
267 |
+
(void *) NpyIter_GetWriteFlags,
|
268 |
+
(void *) NpyIter_DebugPrint,
|
269 |
+
(void *) NpyIter_IterationNeedsAPI,
|
270 |
+
(void *) NpyIter_GetInnerFixedStrideArray,
|
271 |
+
(void *) NpyIter_RemoveAxis,
|
272 |
+
(void *) NpyIter_GetAxisStrideArray,
|
273 |
+
(void *) NpyIter_RequiresBuffering,
|
274 |
+
(void *) NpyIter_GetInitialDataPtrArray,
|
275 |
+
(void *) NpyIter_CreateCompatibleStrides,
|
276 |
+
(void *) PyArray_CastingConverter,
|
277 |
+
(void *) PyArray_CountNonzero,
|
278 |
+
(void *) PyArray_PromoteTypes,
|
279 |
+
(void *) PyArray_MinScalarType,
|
280 |
+
(void *) PyArray_ResultType,
|
281 |
+
(void *) PyArray_CanCastArrayTo,
|
282 |
+
(void *) PyArray_CanCastTypeTo,
|
283 |
+
(void *) PyArray_EinsteinSum,
|
284 |
+
(void *) PyArray_NewLikeArray,
|
285 |
+
(void *) PyArray_GetArrayParamsFromObject,
|
286 |
+
(void *) PyArray_ConvertClipmodeSequence,
|
287 |
+
(void *) PyArray_MatrixProduct2,
|
288 |
+
(void *) NpyIter_IsFirstVisit,
|
289 |
+
(void *) PyArray_SetBaseObject,
|
290 |
+
(void *) PyArray_CreateSortedStridePerm,
|
291 |
+
(void *) PyArray_RemoveAxesInPlace,
|
292 |
+
(void *) PyArray_DebugPrint,
|
293 |
+
(void *) PyArray_FailUnlessWriteable,
|
294 |
+
(void *) PyArray_SetUpdateIfCopyBase,
|
295 |
+
(void *) PyDataMem_NEW,
|
296 |
+
(void *) PyDataMem_FREE,
|
297 |
+
(void *) PyDataMem_RENEW,
|
298 |
+
(void *) PyDataMem_SetEventHook,
|
299 |
+
(NPY_CASTING *) &NPY_DEFAULT_ASSIGN_CASTING,
|
300 |
+
(void *) PyArray_MapIterSwapAxes,
|
301 |
+
(void *) PyArray_MapIterArray,
|
302 |
+
(void *) PyArray_MapIterNext,
|
303 |
+
(void *) PyArray_Partition,
|
304 |
+
(void *) PyArray_ArgPartition,
|
305 |
+
(void *) PyArray_SelectkindConverter,
|
306 |
+
(void *) PyDataMem_NEW_ZEROED,
|
307 |
+
(void *) PyArray_CheckAnyScalarExact,
|
308 |
+
(void *) PyArray_MapIterArrayCopyIfOverlap,
|
309 |
+
(void *) PyArray_ResolveWritebackIfCopy,
|
310 |
+
(void *) PyArray_SetWritebackIfCopyBase,
|
311 |
+
(void *) PyDataMem_SetHandler,
|
312 |
+
(void *) PyDataMem_GetHandler,
|
313 |
+
(PyObject* *) &PyDataMem_DefaultHandler
|
314 |
+
};
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/__multiarray_api.h
ADDED
@@ -0,0 +1,1566 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
#if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUTE)
|
3 |
+
|
4 |
+
typedef struct {
|
5 |
+
PyObject_HEAD
|
6 |
+
npy_bool obval;
|
7 |
+
} PyBoolScalarObject;
|
8 |
+
|
9 |
+
extern NPY_NO_EXPORT PyTypeObject PyArrayMapIter_Type;
|
10 |
+
extern NPY_NO_EXPORT PyTypeObject PyArrayNeighborhoodIter_Type;
|
11 |
+
extern NPY_NO_EXPORT PyBoolScalarObject _PyArrayScalar_BoolValues[2];
|
12 |
+
|
13 |
+
NPY_NO_EXPORT unsigned int PyArray_GetNDArrayCVersion \
|
14 |
+
(void);
|
15 |
+
extern NPY_NO_EXPORT PyTypeObject PyBigArray_Type;
|
16 |
+
|
17 |
+
extern NPY_NO_EXPORT PyTypeObject PyArray_Type;
|
18 |
+
|
19 |
+
extern NPY_NO_EXPORT PyArray_DTypeMeta PyArrayDescr_TypeFull;
|
20 |
+
#define PyArrayDescr_Type (*(PyTypeObject *)(&PyArrayDescr_TypeFull))
|
21 |
+
|
22 |
+
extern NPY_NO_EXPORT PyTypeObject PyArrayFlags_Type;
|
23 |
+
|
24 |
+
extern NPY_NO_EXPORT PyTypeObject PyArrayIter_Type;
|
25 |
+
|
26 |
+
extern NPY_NO_EXPORT PyTypeObject PyArrayMultiIter_Type;
|
27 |
+
|
28 |
+
extern NPY_NO_EXPORT int NPY_NUMUSERTYPES;
|
29 |
+
|
30 |
+
extern NPY_NO_EXPORT PyTypeObject PyBoolArrType_Type;
|
31 |
+
|
32 |
+
extern NPY_NO_EXPORT PyBoolScalarObject _PyArrayScalar_BoolValues[2];
|
33 |
+
|
34 |
+
extern NPY_NO_EXPORT PyTypeObject PyGenericArrType_Type;
|
35 |
+
|
36 |
+
extern NPY_NO_EXPORT PyTypeObject PyNumberArrType_Type;
|
37 |
+
|
38 |
+
extern NPY_NO_EXPORT PyTypeObject PyIntegerArrType_Type;
|
39 |
+
|
40 |
+
extern NPY_NO_EXPORT PyTypeObject PySignedIntegerArrType_Type;
|
41 |
+
|
42 |
+
extern NPY_NO_EXPORT PyTypeObject PyUnsignedIntegerArrType_Type;
|
43 |
+
|
44 |
+
extern NPY_NO_EXPORT PyTypeObject PyInexactArrType_Type;
|
45 |
+
|
46 |
+
extern NPY_NO_EXPORT PyTypeObject PyFloatingArrType_Type;
|
47 |
+
|
48 |
+
extern NPY_NO_EXPORT PyTypeObject PyComplexFloatingArrType_Type;
|
49 |
+
|
50 |
+
extern NPY_NO_EXPORT PyTypeObject PyFlexibleArrType_Type;
|
51 |
+
|
52 |
+
extern NPY_NO_EXPORT PyTypeObject PyCharacterArrType_Type;
|
53 |
+
|
54 |
+
extern NPY_NO_EXPORT PyTypeObject PyByteArrType_Type;
|
55 |
+
|
56 |
+
extern NPY_NO_EXPORT PyTypeObject PyShortArrType_Type;
|
57 |
+
|
58 |
+
extern NPY_NO_EXPORT PyTypeObject PyIntArrType_Type;
|
59 |
+
|
60 |
+
extern NPY_NO_EXPORT PyTypeObject PyLongArrType_Type;
|
61 |
+
|
62 |
+
extern NPY_NO_EXPORT PyTypeObject PyLongLongArrType_Type;
|
63 |
+
|
64 |
+
extern NPY_NO_EXPORT PyTypeObject PyUByteArrType_Type;
|
65 |
+
|
66 |
+
extern NPY_NO_EXPORT PyTypeObject PyUShortArrType_Type;
|
67 |
+
|
68 |
+
extern NPY_NO_EXPORT PyTypeObject PyUIntArrType_Type;
|
69 |
+
|
70 |
+
extern NPY_NO_EXPORT PyTypeObject PyULongArrType_Type;
|
71 |
+
|
72 |
+
extern NPY_NO_EXPORT PyTypeObject PyULongLongArrType_Type;
|
73 |
+
|
74 |
+
extern NPY_NO_EXPORT PyTypeObject PyFloatArrType_Type;
|
75 |
+
|
76 |
+
extern NPY_NO_EXPORT PyTypeObject PyDoubleArrType_Type;
|
77 |
+
|
78 |
+
extern NPY_NO_EXPORT PyTypeObject PyLongDoubleArrType_Type;
|
79 |
+
|
80 |
+
extern NPY_NO_EXPORT PyTypeObject PyCFloatArrType_Type;
|
81 |
+
|
82 |
+
extern NPY_NO_EXPORT PyTypeObject PyCDoubleArrType_Type;
|
83 |
+
|
84 |
+
extern NPY_NO_EXPORT PyTypeObject PyCLongDoubleArrType_Type;
|
85 |
+
|
86 |
+
extern NPY_NO_EXPORT PyTypeObject PyObjectArrType_Type;
|
87 |
+
|
88 |
+
extern NPY_NO_EXPORT PyTypeObject PyStringArrType_Type;
|
89 |
+
|
90 |
+
extern NPY_NO_EXPORT PyTypeObject PyUnicodeArrType_Type;
|
91 |
+
|
92 |
+
extern NPY_NO_EXPORT PyTypeObject PyVoidArrType_Type;
|
93 |
+
|
94 |
+
NPY_NO_EXPORT int PyArray_SetNumericOps \
|
95 |
+
(PyObject *);
|
96 |
+
NPY_NO_EXPORT PyObject * PyArray_GetNumericOps \
|
97 |
+
(void);
|
98 |
+
NPY_NO_EXPORT int PyArray_INCREF \
|
99 |
+
(PyArrayObject *);
|
100 |
+
NPY_NO_EXPORT int PyArray_XDECREF \
|
101 |
+
(PyArrayObject *);
|
102 |
+
NPY_NO_EXPORT void PyArray_SetStringFunction \
|
103 |
+
(PyObject *, int);
|
104 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_DescrFromType \
|
105 |
+
(int);
|
106 |
+
NPY_NO_EXPORT PyObject * PyArray_TypeObjectFromType \
|
107 |
+
(int);
|
108 |
+
NPY_NO_EXPORT char * PyArray_Zero \
|
109 |
+
(PyArrayObject *);
|
110 |
+
NPY_NO_EXPORT char * PyArray_One \
|
111 |
+
(PyArrayObject *);
|
112 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_CastToType \
|
113 |
+
(PyArrayObject *, PyArray_Descr *, int);
|
114 |
+
NPY_NO_EXPORT int PyArray_CastTo \
|
115 |
+
(PyArrayObject *, PyArrayObject *);
|
116 |
+
NPY_NO_EXPORT int PyArray_CastAnyTo \
|
117 |
+
(PyArrayObject *, PyArrayObject *);
|
118 |
+
NPY_NO_EXPORT int PyArray_CanCastSafely \
|
119 |
+
(int, int);
|
120 |
+
NPY_NO_EXPORT npy_bool PyArray_CanCastTo \
|
121 |
+
(PyArray_Descr *, PyArray_Descr *);
|
122 |
+
NPY_NO_EXPORT int PyArray_ObjectType \
|
123 |
+
(PyObject *, int);
|
124 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_DescrFromObject \
|
125 |
+
(PyObject *, PyArray_Descr *);
|
126 |
+
NPY_NO_EXPORT PyArrayObject ** PyArray_ConvertToCommonType \
|
127 |
+
(PyObject *, int *);
|
128 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_DescrFromScalar \
|
129 |
+
(PyObject *);
|
130 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_DescrFromTypeObject \
|
131 |
+
(PyObject *);
|
132 |
+
NPY_NO_EXPORT npy_intp PyArray_Size \
|
133 |
+
(PyObject *);
|
134 |
+
NPY_NO_EXPORT PyObject * PyArray_Scalar \
|
135 |
+
(void *, PyArray_Descr *, PyObject *);
|
136 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_FromScalar \
|
137 |
+
(PyObject *, PyArray_Descr *);
|
138 |
+
NPY_NO_EXPORT void PyArray_ScalarAsCtype \
|
139 |
+
(PyObject *, void *);
|
140 |
+
NPY_NO_EXPORT int PyArray_CastScalarToCtype \
|
141 |
+
(PyObject *, void *, PyArray_Descr *);
|
142 |
+
NPY_NO_EXPORT int PyArray_CastScalarDirect \
|
143 |
+
(PyObject *, PyArray_Descr *, void *, int);
|
144 |
+
NPY_NO_EXPORT PyObject * PyArray_ScalarFromObject \
|
145 |
+
(PyObject *);
|
146 |
+
NPY_NO_EXPORT PyArray_VectorUnaryFunc * PyArray_GetCastFunc \
|
147 |
+
(PyArray_Descr *, int);
|
148 |
+
NPY_NO_EXPORT PyObject * PyArray_FromDims \
|
149 |
+
(int NPY_UNUSED(nd), int *NPY_UNUSED(d), int NPY_UNUSED(type));
|
150 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(3) PyObject * PyArray_FromDimsAndDataAndDescr \
|
151 |
+
(int NPY_UNUSED(nd), int *NPY_UNUSED(d), PyArray_Descr *, char *NPY_UNUSED(data));
|
152 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_FromAny \
|
153 |
+
(PyObject *, PyArray_Descr *, int, int, int, PyObject *);
|
154 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(1) PyObject * PyArray_EnsureArray \
|
155 |
+
(PyObject *);
|
156 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(1) PyObject * PyArray_EnsureAnyArray \
|
157 |
+
(PyObject *);
|
158 |
+
NPY_NO_EXPORT PyObject * PyArray_FromFile \
|
159 |
+
(FILE *, PyArray_Descr *, npy_intp, char *);
|
160 |
+
NPY_NO_EXPORT PyObject * PyArray_FromString \
|
161 |
+
(char *, npy_intp, PyArray_Descr *, npy_intp, char *);
|
162 |
+
NPY_NO_EXPORT PyObject * PyArray_FromBuffer \
|
163 |
+
(PyObject *, PyArray_Descr *, npy_intp, npy_intp);
|
164 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_FromIter \
|
165 |
+
(PyObject *, PyArray_Descr *, npy_intp);
|
166 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(1) PyObject * PyArray_Return \
|
167 |
+
(PyArrayObject *);
|
168 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_GetField \
|
169 |
+
(PyArrayObject *, PyArray_Descr *, int);
|
170 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) int PyArray_SetField \
|
171 |
+
(PyArrayObject *, PyArray_Descr *, int, PyObject *);
|
172 |
+
NPY_NO_EXPORT PyObject * PyArray_Byteswap \
|
173 |
+
(PyArrayObject *, npy_bool);
|
174 |
+
NPY_NO_EXPORT PyObject * PyArray_Resize \
|
175 |
+
(PyArrayObject *, PyArray_Dims *, int, NPY_ORDER NPY_UNUSED(order));
|
176 |
+
NPY_NO_EXPORT int PyArray_MoveInto \
|
177 |
+
(PyArrayObject *, PyArrayObject *);
|
178 |
+
NPY_NO_EXPORT int PyArray_CopyInto \
|
179 |
+
(PyArrayObject *, PyArrayObject *);
|
180 |
+
NPY_NO_EXPORT int PyArray_CopyAnyInto \
|
181 |
+
(PyArrayObject *, PyArrayObject *);
|
182 |
+
NPY_NO_EXPORT int PyArray_CopyObject \
|
183 |
+
(PyArrayObject *, PyObject *);
|
184 |
+
NPY_NO_EXPORT PyObject * PyArray_NewCopy \
|
185 |
+
(PyArrayObject *, NPY_ORDER);
|
186 |
+
NPY_NO_EXPORT PyObject * PyArray_ToList \
|
187 |
+
(PyArrayObject *);
|
188 |
+
NPY_NO_EXPORT PyObject * PyArray_ToString \
|
189 |
+
(PyArrayObject *, NPY_ORDER);
|
190 |
+
NPY_NO_EXPORT int PyArray_ToFile \
|
191 |
+
(PyArrayObject *, FILE *, char *, char *);
|
192 |
+
NPY_NO_EXPORT int PyArray_Dump \
|
193 |
+
(PyObject *, PyObject *, int);
|
194 |
+
NPY_NO_EXPORT PyObject * PyArray_Dumps \
|
195 |
+
(PyObject *, int);
|
196 |
+
NPY_NO_EXPORT int PyArray_ValidType \
|
197 |
+
(int);
|
198 |
+
NPY_NO_EXPORT void PyArray_UpdateFlags \
|
199 |
+
(PyArrayObject *, int);
|
200 |
+
NPY_NO_EXPORT PyObject * PyArray_New \
|
201 |
+
(PyTypeObject *, int, npy_intp const *, int, npy_intp const *, void *, int, int, PyObject *);
|
202 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_NewFromDescr \
|
203 |
+
(PyTypeObject *, PyArray_Descr *, int, npy_intp const *, npy_intp const *, void *, int, PyObject *);
|
204 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_DescrNew \
|
205 |
+
(PyArray_Descr *);
|
206 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_DescrNewFromType \
|
207 |
+
(int);
|
208 |
+
NPY_NO_EXPORT double PyArray_GetPriority \
|
209 |
+
(PyObject *, double);
|
210 |
+
NPY_NO_EXPORT PyObject * PyArray_IterNew \
|
211 |
+
(PyObject *);
|
212 |
+
NPY_NO_EXPORT PyObject* PyArray_MultiIterNew \
|
213 |
+
(int, ...);
|
214 |
+
NPY_NO_EXPORT int PyArray_PyIntAsInt \
|
215 |
+
(PyObject *);
|
216 |
+
NPY_NO_EXPORT npy_intp PyArray_PyIntAsIntp \
|
217 |
+
(PyObject *);
|
218 |
+
NPY_NO_EXPORT int PyArray_Broadcast \
|
219 |
+
(PyArrayMultiIterObject *);
|
220 |
+
NPY_NO_EXPORT void PyArray_FillObjectArray \
|
221 |
+
(PyArrayObject *, PyObject *);
|
222 |
+
NPY_NO_EXPORT int PyArray_FillWithScalar \
|
223 |
+
(PyArrayObject *, PyObject *);
|
224 |
+
NPY_NO_EXPORT npy_bool PyArray_CheckStrides \
|
225 |
+
(int, int, npy_intp, npy_intp, npy_intp const *, npy_intp const *);
|
226 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_DescrNewByteorder \
|
227 |
+
(PyArray_Descr *, char);
|
228 |
+
NPY_NO_EXPORT PyObject * PyArray_IterAllButAxis \
|
229 |
+
(PyObject *, int *);
|
230 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_CheckFromAny \
|
231 |
+
(PyObject *, PyArray_Descr *, int, int, int, PyObject *);
|
232 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_FromArray \
|
233 |
+
(PyArrayObject *, PyArray_Descr *, int);
|
234 |
+
NPY_NO_EXPORT PyObject * PyArray_FromInterface \
|
235 |
+
(PyObject *);
|
236 |
+
NPY_NO_EXPORT PyObject * PyArray_FromStructInterface \
|
237 |
+
(PyObject *);
|
238 |
+
NPY_NO_EXPORT PyObject * PyArray_FromArrayAttr \
|
239 |
+
(PyObject *, PyArray_Descr *, PyObject *);
|
240 |
+
NPY_NO_EXPORT NPY_SCALARKIND PyArray_ScalarKind \
|
241 |
+
(int, PyArrayObject **);
|
242 |
+
NPY_NO_EXPORT int PyArray_CanCoerceScalar \
|
243 |
+
(int, int, NPY_SCALARKIND);
|
244 |
+
NPY_NO_EXPORT PyObject * PyArray_NewFlagsObject \
|
245 |
+
(PyObject *);
|
246 |
+
NPY_NO_EXPORT npy_bool PyArray_CanCastScalar \
|
247 |
+
(PyTypeObject *, PyTypeObject *);
|
248 |
+
NPY_NO_EXPORT int PyArray_CompareUCS4 \
|
249 |
+
(npy_ucs4 const *, npy_ucs4 const *, size_t);
|
250 |
+
NPY_NO_EXPORT int PyArray_RemoveSmallest \
|
251 |
+
(PyArrayMultiIterObject *);
|
252 |
+
NPY_NO_EXPORT int PyArray_ElementStrides \
|
253 |
+
(PyObject *);
|
254 |
+
NPY_NO_EXPORT void PyArray_Item_INCREF \
|
255 |
+
(char *, PyArray_Descr *);
|
256 |
+
NPY_NO_EXPORT void PyArray_Item_XDECREF \
|
257 |
+
(char *, PyArray_Descr *);
|
258 |
+
NPY_NO_EXPORT PyObject * PyArray_FieldNames \
|
259 |
+
(PyObject *);
|
260 |
+
NPY_NO_EXPORT PyObject * PyArray_Transpose \
|
261 |
+
(PyArrayObject *, PyArray_Dims *);
|
262 |
+
NPY_NO_EXPORT PyObject * PyArray_TakeFrom \
|
263 |
+
(PyArrayObject *, PyObject *, int, PyArrayObject *, NPY_CLIPMODE);
|
264 |
+
NPY_NO_EXPORT PyObject * PyArray_PutTo \
|
265 |
+
(PyArrayObject *, PyObject*, PyObject *, NPY_CLIPMODE);
|
266 |
+
NPY_NO_EXPORT PyObject * PyArray_PutMask \
|
267 |
+
(PyArrayObject *, PyObject*, PyObject*);
|
268 |
+
NPY_NO_EXPORT PyObject * PyArray_Repeat \
|
269 |
+
(PyArrayObject *, PyObject *, int);
|
270 |
+
NPY_NO_EXPORT PyObject * PyArray_Choose \
|
271 |
+
(PyArrayObject *, PyObject *, PyArrayObject *, NPY_CLIPMODE);
|
272 |
+
NPY_NO_EXPORT int PyArray_Sort \
|
273 |
+
(PyArrayObject *, int, NPY_SORTKIND);
|
274 |
+
NPY_NO_EXPORT PyObject * PyArray_ArgSort \
|
275 |
+
(PyArrayObject *, int, NPY_SORTKIND);
|
276 |
+
NPY_NO_EXPORT PyObject * PyArray_SearchSorted \
|
277 |
+
(PyArrayObject *, PyObject *, NPY_SEARCHSIDE, PyObject *);
|
278 |
+
NPY_NO_EXPORT PyObject * PyArray_ArgMax \
|
279 |
+
(PyArrayObject *, int, PyArrayObject *);
|
280 |
+
NPY_NO_EXPORT PyObject * PyArray_ArgMin \
|
281 |
+
(PyArrayObject *, int, PyArrayObject *);
|
282 |
+
NPY_NO_EXPORT PyObject * PyArray_Reshape \
|
283 |
+
(PyArrayObject *, PyObject *);
|
284 |
+
NPY_NO_EXPORT PyObject * PyArray_Newshape \
|
285 |
+
(PyArrayObject *, PyArray_Dims *, NPY_ORDER);
|
286 |
+
NPY_NO_EXPORT PyObject * PyArray_Squeeze \
|
287 |
+
(PyArrayObject *);
|
288 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) PyObject * PyArray_View \
|
289 |
+
(PyArrayObject *, PyArray_Descr *, PyTypeObject *);
|
290 |
+
NPY_NO_EXPORT PyObject * PyArray_SwapAxes \
|
291 |
+
(PyArrayObject *, int, int);
|
292 |
+
NPY_NO_EXPORT PyObject * PyArray_Max \
|
293 |
+
(PyArrayObject *, int, PyArrayObject *);
|
294 |
+
NPY_NO_EXPORT PyObject * PyArray_Min \
|
295 |
+
(PyArrayObject *, int, PyArrayObject *);
|
296 |
+
NPY_NO_EXPORT PyObject * PyArray_Ptp \
|
297 |
+
(PyArrayObject *, int, PyArrayObject *);
|
298 |
+
NPY_NO_EXPORT PyObject * PyArray_Mean \
|
299 |
+
(PyArrayObject *, int, int, PyArrayObject *);
|
300 |
+
NPY_NO_EXPORT PyObject * PyArray_Trace \
|
301 |
+
(PyArrayObject *, int, int, int, int, PyArrayObject *);
|
302 |
+
NPY_NO_EXPORT PyObject * PyArray_Diagonal \
|
303 |
+
(PyArrayObject *, int, int, int);
|
304 |
+
NPY_NO_EXPORT PyObject * PyArray_Clip \
|
305 |
+
(PyArrayObject *, PyObject *, PyObject *, PyArrayObject *);
|
306 |
+
NPY_NO_EXPORT PyObject * PyArray_Conjugate \
|
307 |
+
(PyArrayObject *, PyArrayObject *);
|
308 |
+
NPY_NO_EXPORT PyObject * PyArray_Nonzero \
|
309 |
+
(PyArrayObject *);
|
310 |
+
NPY_NO_EXPORT PyObject * PyArray_Std \
|
311 |
+
(PyArrayObject *, int, int, PyArrayObject *, int);
|
312 |
+
NPY_NO_EXPORT PyObject * PyArray_Sum \
|
313 |
+
(PyArrayObject *, int, int, PyArrayObject *);
|
314 |
+
NPY_NO_EXPORT PyObject * PyArray_CumSum \
|
315 |
+
(PyArrayObject *, int, int, PyArrayObject *);
|
316 |
+
NPY_NO_EXPORT PyObject * PyArray_Prod \
|
317 |
+
(PyArrayObject *, int, int, PyArrayObject *);
|
318 |
+
NPY_NO_EXPORT PyObject * PyArray_CumProd \
|
319 |
+
(PyArrayObject *, int, int, PyArrayObject *);
|
320 |
+
NPY_NO_EXPORT PyObject * PyArray_All \
|
321 |
+
(PyArrayObject *, int, PyArrayObject *);
|
322 |
+
NPY_NO_EXPORT PyObject * PyArray_Any \
|
323 |
+
(PyArrayObject *, int, PyArrayObject *);
|
324 |
+
NPY_NO_EXPORT PyObject * PyArray_Compress \
|
325 |
+
(PyArrayObject *, PyObject *, int, PyArrayObject *);
|
326 |
+
NPY_NO_EXPORT PyObject * PyArray_Flatten \
|
327 |
+
(PyArrayObject *, NPY_ORDER);
|
328 |
+
NPY_NO_EXPORT PyObject * PyArray_Ravel \
|
329 |
+
(PyArrayObject *, NPY_ORDER);
|
330 |
+
NPY_NO_EXPORT npy_intp PyArray_MultiplyList \
|
331 |
+
(npy_intp const *, int);
|
332 |
+
NPY_NO_EXPORT int PyArray_MultiplyIntList \
|
333 |
+
(int const *, int);
|
334 |
+
NPY_NO_EXPORT void * PyArray_GetPtr \
|
335 |
+
(PyArrayObject *, npy_intp const*);
|
336 |
+
NPY_NO_EXPORT int PyArray_CompareLists \
|
337 |
+
(npy_intp const *, npy_intp const *, int);
|
338 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(5) int PyArray_AsCArray \
|
339 |
+
(PyObject **, void *, npy_intp *, int, PyArray_Descr*);
|
340 |
+
NPY_NO_EXPORT int PyArray_As1D \
|
341 |
+
(PyObject **NPY_UNUSED(op), char **NPY_UNUSED(ptr), int *NPY_UNUSED(d1), int NPY_UNUSED(typecode));
|
342 |
+
NPY_NO_EXPORT int PyArray_As2D \
|
343 |
+
(PyObject **NPY_UNUSED(op), char ***NPY_UNUSED(ptr), int *NPY_UNUSED(d1), int *NPY_UNUSED(d2), int NPY_UNUSED(typecode));
|
344 |
+
NPY_NO_EXPORT int PyArray_Free \
|
345 |
+
(PyObject *, void *);
|
346 |
+
NPY_NO_EXPORT int PyArray_Converter \
|
347 |
+
(PyObject *, PyObject **);
|
348 |
+
NPY_NO_EXPORT int PyArray_IntpFromSequence \
|
349 |
+
(PyObject *, npy_intp *, int);
|
350 |
+
NPY_NO_EXPORT PyObject * PyArray_Concatenate \
|
351 |
+
(PyObject *, int);
|
352 |
+
NPY_NO_EXPORT PyObject * PyArray_InnerProduct \
|
353 |
+
(PyObject *, PyObject *);
|
354 |
+
NPY_NO_EXPORT PyObject * PyArray_MatrixProduct \
|
355 |
+
(PyObject *, PyObject *);
|
356 |
+
NPY_NO_EXPORT PyObject * PyArray_CopyAndTranspose \
|
357 |
+
(PyObject *);
|
358 |
+
NPY_NO_EXPORT PyObject * PyArray_Correlate \
|
359 |
+
(PyObject *, PyObject *, int);
|
360 |
+
NPY_NO_EXPORT int PyArray_TypestrConvert \
|
361 |
+
(int, int);
|
362 |
+
NPY_NO_EXPORT int PyArray_DescrConverter \
|
363 |
+
(PyObject *, PyArray_Descr **);
|
364 |
+
NPY_NO_EXPORT int PyArray_DescrConverter2 \
|
365 |
+
(PyObject *, PyArray_Descr **);
|
366 |
+
NPY_NO_EXPORT int PyArray_IntpConverter \
|
367 |
+
(PyObject *, PyArray_Dims *);
|
368 |
+
NPY_NO_EXPORT int PyArray_BufferConverter \
|
369 |
+
(PyObject *, PyArray_Chunk *);
|
370 |
+
NPY_NO_EXPORT int PyArray_AxisConverter \
|
371 |
+
(PyObject *, int *);
|
372 |
+
NPY_NO_EXPORT int PyArray_BoolConverter \
|
373 |
+
(PyObject *, npy_bool *);
|
374 |
+
NPY_NO_EXPORT int PyArray_ByteorderConverter \
|
375 |
+
(PyObject *, char *);
|
376 |
+
NPY_NO_EXPORT int PyArray_OrderConverter \
|
377 |
+
(PyObject *, NPY_ORDER *);
|
378 |
+
NPY_NO_EXPORT unsigned char PyArray_EquivTypes \
|
379 |
+
(PyArray_Descr *, PyArray_Descr *);
|
380 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(3) PyObject * PyArray_Zeros \
|
381 |
+
(int, npy_intp const *, PyArray_Descr *, int);
|
382 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(3) PyObject * PyArray_Empty \
|
383 |
+
(int, npy_intp const *, PyArray_Descr *, int);
|
384 |
+
NPY_NO_EXPORT PyObject * PyArray_Where \
|
385 |
+
(PyObject *, PyObject *, PyObject *);
|
386 |
+
NPY_NO_EXPORT PyObject * PyArray_Arange \
|
387 |
+
(double, double, double, int);
|
388 |
+
NPY_NO_EXPORT PyObject * PyArray_ArangeObj \
|
389 |
+
(PyObject *, PyObject *, PyObject *, PyArray_Descr *);
|
390 |
+
NPY_NO_EXPORT int PyArray_SortkindConverter \
|
391 |
+
(PyObject *, NPY_SORTKIND *);
|
392 |
+
NPY_NO_EXPORT PyObject * PyArray_LexSort \
|
393 |
+
(PyObject *, int);
|
394 |
+
NPY_NO_EXPORT PyObject * PyArray_Round \
|
395 |
+
(PyArrayObject *, int, PyArrayObject *);
|
396 |
+
NPY_NO_EXPORT unsigned char PyArray_EquivTypenums \
|
397 |
+
(int, int);
|
398 |
+
NPY_NO_EXPORT int PyArray_RegisterDataType \
|
399 |
+
(PyArray_Descr *);
|
400 |
+
NPY_NO_EXPORT int PyArray_RegisterCastFunc \
|
401 |
+
(PyArray_Descr *, int, PyArray_VectorUnaryFunc *);
|
402 |
+
NPY_NO_EXPORT int PyArray_RegisterCanCast \
|
403 |
+
(PyArray_Descr *, int, NPY_SCALARKIND);
|
404 |
+
NPY_NO_EXPORT void PyArray_InitArrFuncs \
|
405 |
+
(PyArray_ArrFuncs *);
|
406 |
+
NPY_NO_EXPORT PyObject * PyArray_IntTupleFromIntp \
|
407 |
+
(int, npy_intp const *);
|
408 |
+
NPY_NO_EXPORT int PyArray_TypeNumFromName \
|
409 |
+
(char const *);
|
410 |
+
NPY_NO_EXPORT int PyArray_ClipmodeConverter \
|
411 |
+
(PyObject *, NPY_CLIPMODE *);
|
412 |
+
NPY_NO_EXPORT int PyArray_OutputConverter \
|
413 |
+
(PyObject *, PyArrayObject **);
|
414 |
+
NPY_NO_EXPORT PyObject * PyArray_BroadcastToShape \
|
415 |
+
(PyObject *, npy_intp *, int);
|
416 |
+
NPY_NO_EXPORT void _PyArray_SigintHandler \
|
417 |
+
(int);
|
418 |
+
NPY_NO_EXPORT void* _PyArray_GetSigintBuf \
|
419 |
+
(void);
|
420 |
+
NPY_NO_EXPORT int PyArray_DescrAlignConverter \
|
421 |
+
(PyObject *, PyArray_Descr **);
|
422 |
+
NPY_NO_EXPORT int PyArray_DescrAlignConverter2 \
|
423 |
+
(PyObject *, PyArray_Descr **);
|
424 |
+
NPY_NO_EXPORT int PyArray_SearchsideConverter \
|
425 |
+
(PyObject *, void *);
|
426 |
+
NPY_NO_EXPORT PyObject * PyArray_CheckAxis \
|
427 |
+
(PyArrayObject *, int *, int);
|
428 |
+
NPY_NO_EXPORT npy_intp PyArray_OverflowMultiplyList \
|
429 |
+
(npy_intp const *, int);
|
430 |
+
NPY_NO_EXPORT int PyArray_CompareString \
|
431 |
+
(const char *, const char *, size_t);
|
432 |
+
NPY_NO_EXPORT PyObject* PyArray_MultiIterFromObjects \
|
433 |
+
(PyObject **, int, int, ...);
|
434 |
+
NPY_NO_EXPORT int PyArray_GetEndianness \
|
435 |
+
(void);
|
436 |
+
NPY_NO_EXPORT unsigned int PyArray_GetNDArrayCFeatureVersion \
|
437 |
+
(void);
|
438 |
+
NPY_NO_EXPORT PyObject * PyArray_Correlate2 \
|
439 |
+
(PyObject *, PyObject *, int);
|
440 |
+
NPY_NO_EXPORT PyObject* PyArray_NeighborhoodIterNew \
|
441 |
+
(PyArrayIterObject *, const npy_intp *, int, PyArrayObject*);
|
442 |
+
extern NPY_NO_EXPORT PyTypeObject PyTimeIntegerArrType_Type;
|
443 |
+
|
444 |
+
extern NPY_NO_EXPORT PyTypeObject PyDatetimeArrType_Type;
|
445 |
+
|
446 |
+
extern NPY_NO_EXPORT PyTypeObject PyTimedeltaArrType_Type;
|
447 |
+
|
448 |
+
extern NPY_NO_EXPORT PyTypeObject PyHalfArrType_Type;
|
449 |
+
|
450 |
+
extern NPY_NO_EXPORT PyTypeObject NpyIter_Type;
|
451 |
+
|
452 |
+
NPY_NO_EXPORT void PyArray_SetDatetimeParseFunction \
|
453 |
+
(PyObject *NPY_UNUSED(op));
|
454 |
+
NPY_NO_EXPORT void PyArray_DatetimeToDatetimeStruct \
|
455 |
+
(npy_datetime NPY_UNUSED(val), NPY_DATETIMEUNIT NPY_UNUSED(fr), npy_datetimestruct *);
|
456 |
+
NPY_NO_EXPORT void PyArray_TimedeltaToTimedeltaStruct \
|
457 |
+
(npy_timedelta NPY_UNUSED(val), NPY_DATETIMEUNIT NPY_UNUSED(fr), npy_timedeltastruct *);
|
458 |
+
NPY_NO_EXPORT npy_datetime PyArray_DatetimeStructToDatetime \
|
459 |
+
(NPY_DATETIMEUNIT NPY_UNUSED(fr), npy_datetimestruct *NPY_UNUSED(d));
|
460 |
+
NPY_NO_EXPORT npy_datetime PyArray_TimedeltaStructToTimedelta \
|
461 |
+
(NPY_DATETIMEUNIT NPY_UNUSED(fr), npy_timedeltastruct *NPY_UNUSED(d));
|
462 |
+
NPY_NO_EXPORT NpyIter * NpyIter_New \
|
463 |
+
(PyArrayObject *, npy_uint32, NPY_ORDER, NPY_CASTING, PyArray_Descr*);
|
464 |
+
NPY_NO_EXPORT NpyIter * NpyIter_MultiNew \
|
465 |
+
(int, PyArrayObject **, npy_uint32, NPY_ORDER, NPY_CASTING, npy_uint32 *, PyArray_Descr **);
|
466 |
+
NPY_NO_EXPORT NpyIter * NpyIter_AdvancedNew \
|
467 |
+
(int, PyArrayObject **, npy_uint32, NPY_ORDER, NPY_CASTING, npy_uint32 *, PyArray_Descr **, int, int **, npy_intp *, npy_intp);
|
468 |
+
NPY_NO_EXPORT NpyIter * NpyIter_Copy \
|
469 |
+
(NpyIter *);
|
470 |
+
NPY_NO_EXPORT int NpyIter_Deallocate \
|
471 |
+
(NpyIter *);
|
472 |
+
NPY_NO_EXPORT npy_bool NpyIter_HasDelayedBufAlloc \
|
473 |
+
(NpyIter *);
|
474 |
+
NPY_NO_EXPORT npy_bool NpyIter_HasExternalLoop \
|
475 |
+
(NpyIter *);
|
476 |
+
NPY_NO_EXPORT int NpyIter_EnableExternalLoop \
|
477 |
+
(NpyIter *);
|
478 |
+
NPY_NO_EXPORT npy_intp * NpyIter_GetInnerStrideArray \
|
479 |
+
(NpyIter *);
|
480 |
+
NPY_NO_EXPORT npy_intp * NpyIter_GetInnerLoopSizePtr \
|
481 |
+
(NpyIter *);
|
482 |
+
NPY_NO_EXPORT int NpyIter_Reset \
|
483 |
+
(NpyIter *, char **);
|
484 |
+
NPY_NO_EXPORT int NpyIter_ResetBasePointers \
|
485 |
+
(NpyIter *, char **, char **);
|
486 |
+
NPY_NO_EXPORT int NpyIter_ResetToIterIndexRange \
|
487 |
+
(NpyIter *, npy_intp, npy_intp, char **);
|
488 |
+
NPY_NO_EXPORT int NpyIter_GetNDim \
|
489 |
+
(NpyIter *);
|
490 |
+
NPY_NO_EXPORT int NpyIter_GetNOp \
|
491 |
+
(NpyIter *);
|
492 |
+
NPY_NO_EXPORT NpyIter_IterNextFunc * NpyIter_GetIterNext \
|
493 |
+
(NpyIter *, char **);
|
494 |
+
NPY_NO_EXPORT npy_intp NpyIter_GetIterSize \
|
495 |
+
(NpyIter *);
|
496 |
+
NPY_NO_EXPORT void NpyIter_GetIterIndexRange \
|
497 |
+
(NpyIter *, npy_intp *, npy_intp *);
|
498 |
+
NPY_NO_EXPORT npy_intp NpyIter_GetIterIndex \
|
499 |
+
(NpyIter *);
|
500 |
+
NPY_NO_EXPORT int NpyIter_GotoIterIndex \
|
501 |
+
(NpyIter *, npy_intp);
|
502 |
+
NPY_NO_EXPORT npy_bool NpyIter_HasMultiIndex \
|
503 |
+
(NpyIter *);
|
504 |
+
NPY_NO_EXPORT int NpyIter_GetShape \
|
505 |
+
(NpyIter *, npy_intp *);
|
506 |
+
NPY_NO_EXPORT NpyIter_GetMultiIndexFunc * NpyIter_GetGetMultiIndex \
|
507 |
+
(NpyIter *, char **);
|
508 |
+
NPY_NO_EXPORT int NpyIter_GotoMultiIndex \
|
509 |
+
(NpyIter *, npy_intp const *);
|
510 |
+
NPY_NO_EXPORT int NpyIter_RemoveMultiIndex \
|
511 |
+
(NpyIter *);
|
512 |
+
NPY_NO_EXPORT npy_bool NpyIter_HasIndex \
|
513 |
+
(NpyIter *);
|
514 |
+
NPY_NO_EXPORT npy_bool NpyIter_IsBuffered \
|
515 |
+
(NpyIter *);
|
516 |
+
NPY_NO_EXPORT npy_bool NpyIter_IsGrowInner \
|
517 |
+
(NpyIter *);
|
518 |
+
NPY_NO_EXPORT npy_intp NpyIter_GetBufferSize \
|
519 |
+
(NpyIter *);
|
520 |
+
NPY_NO_EXPORT npy_intp * NpyIter_GetIndexPtr \
|
521 |
+
(NpyIter *);
|
522 |
+
NPY_NO_EXPORT int NpyIter_GotoIndex \
|
523 |
+
(NpyIter *, npy_intp);
|
524 |
+
NPY_NO_EXPORT char ** NpyIter_GetDataPtrArray \
|
525 |
+
(NpyIter *);
|
526 |
+
NPY_NO_EXPORT PyArray_Descr ** NpyIter_GetDescrArray \
|
527 |
+
(NpyIter *);
|
528 |
+
NPY_NO_EXPORT PyArrayObject ** NpyIter_GetOperandArray \
|
529 |
+
(NpyIter *);
|
530 |
+
NPY_NO_EXPORT PyArrayObject * NpyIter_GetIterView \
|
531 |
+
(NpyIter *, npy_intp);
|
532 |
+
NPY_NO_EXPORT void NpyIter_GetReadFlags \
|
533 |
+
(NpyIter *, char *);
|
534 |
+
NPY_NO_EXPORT void NpyIter_GetWriteFlags \
|
535 |
+
(NpyIter *, char *);
|
536 |
+
NPY_NO_EXPORT void NpyIter_DebugPrint \
|
537 |
+
(NpyIter *);
|
538 |
+
NPY_NO_EXPORT npy_bool NpyIter_IterationNeedsAPI \
|
539 |
+
(NpyIter *);
|
540 |
+
NPY_NO_EXPORT void NpyIter_GetInnerFixedStrideArray \
|
541 |
+
(NpyIter *, npy_intp *);
|
542 |
+
NPY_NO_EXPORT int NpyIter_RemoveAxis \
|
543 |
+
(NpyIter *, int);
|
544 |
+
NPY_NO_EXPORT npy_intp * NpyIter_GetAxisStrideArray \
|
545 |
+
(NpyIter *, int);
|
546 |
+
NPY_NO_EXPORT npy_bool NpyIter_RequiresBuffering \
|
547 |
+
(NpyIter *);
|
548 |
+
NPY_NO_EXPORT char ** NpyIter_GetInitialDataPtrArray \
|
549 |
+
(NpyIter *);
|
550 |
+
NPY_NO_EXPORT int NpyIter_CreateCompatibleStrides \
|
551 |
+
(NpyIter *, npy_intp, npy_intp *);
|
552 |
+
NPY_NO_EXPORT int PyArray_CastingConverter \
|
553 |
+
(PyObject *, NPY_CASTING *);
|
554 |
+
NPY_NO_EXPORT npy_intp PyArray_CountNonzero \
|
555 |
+
(PyArrayObject *);
|
556 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_PromoteTypes \
|
557 |
+
(PyArray_Descr *, PyArray_Descr *);
|
558 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_MinScalarType \
|
559 |
+
(PyArrayObject *);
|
560 |
+
NPY_NO_EXPORT PyArray_Descr * PyArray_ResultType \
|
561 |
+
(npy_intp, PyArrayObject *arrs[], npy_intp, PyArray_Descr *descrs[]);
|
562 |
+
NPY_NO_EXPORT npy_bool PyArray_CanCastArrayTo \
|
563 |
+
(PyArrayObject *, PyArray_Descr *, NPY_CASTING);
|
564 |
+
NPY_NO_EXPORT npy_bool PyArray_CanCastTypeTo \
|
565 |
+
(PyArray_Descr *, PyArray_Descr *, NPY_CASTING);
|
566 |
+
NPY_NO_EXPORT PyArrayObject * PyArray_EinsteinSum \
|
567 |
+
(char *, npy_intp, PyArrayObject **, PyArray_Descr *, NPY_ORDER, NPY_CASTING, PyArrayObject *);
|
568 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(3) PyObject * PyArray_NewLikeArray \
|
569 |
+
(PyArrayObject *, NPY_ORDER, PyArray_Descr *, int);
|
570 |
+
NPY_NO_EXPORT int PyArray_GetArrayParamsFromObject \
|
571 |
+
(PyObject *NPY_UNUSED(op), PyArray_Descr *NPY_UNUSED(requested_dtype), npy_bool NPY_UNUSED(writeable), PyArray_Descr **NPY_UNUSED(out_dtype), int *NPY_UNUSED(out_ndim), npy_intp *NPY_UNUSED(out_dims), PyArrayObject **NPY_UNUSED(out_arr), PyObject *NPY_UNUSED(context));
|
572 |
+
NPY_NO_EXPORT int PyArray_ConvertClipmodeSequence \
|
573 |
+
(PyObject *, NPY_CLIPMODE *, int);
|
574 |
+
NPY_NO_EXPORT PyObject * PyArray_MatrixProduct2 \
|
575 |
+
(PyObject *, PyObject *, PyArrayObject*);
|
576 |
+
NPY_NO_EXPORT npy_bool NpyIter_IsFirstVisit \
|
577 |
+
(NpyIter *, int);
|
578 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) int PyArray_SetBaseObject \
|
579 |
+
(PyArrayObject *, PyObject *);
|
580 |
+
NPY_NO_EXPORT void PyArray_CreateSortedStridePerm \
|
581 |
+
(int, npy_intp const *, npy_stride_sort_item *);
|
582 |
+
NPY_NO_EXPORT void PyArray_RemoveAxesInPlace \
|
583 |
+
(PyArrayObject *, const npy_bool *);
|
584 |
+
NPY_NO_EXPORT void PyArray_DebugPrint \
|
585 |
+
(PyArrayObject *);
|
586 |
+
NPY_NO_EXPORT int PyArray_FailUnlessWriteable \
|
587 |
+
(PyArrayObject *, const char *);
|
588 |
+
NPY_NO_EXPORT NPY_STEALS_REF_TO_ARG(2) int PyArray_SetUpdateIfCopyBase \
|
589 |
+
(PyArrayObject *, PyArrayObject *);
|
590 |
+
NPY_NO_EXPORT void * PyDataMem_NEW \
|
591 |
+
(size_t);
|
592 |
+
NPY_NO_EXPORT void PyDataMem_FREE \
|
593 |
+
(void *);
|
594 |
+
NPY_NO_EXPORT void * PyDataMem_RENEW \
|
595 |
+
(void *, size_t);
|
596 |
+
NPY_NO_EXPORT PyDataMem_EventHookFunc * PyDataMem_SetEventHook \
|
597 |
+
(PyDataMem_EventHookFunc *, void *, void **);
|
598 |
+
extern NPY_NO_EXPORT NPY_CASTING NPY_DEFAULT_ASSIGN_CASTING;
|
599 |
+
|
600 |
+
NPY_NO_EXPORT void PyArray_MapIterSwapAxes \
|
601 |
+
(PyArrayMapIterObject *, PyArrayObject **, int);
|
602 |
+
NPY_NO_EXPORT PyObject * PyArray_MapIterArray \
|
603 |
+
(PyArrayObject *, PyObject *);
|
604 |
+
NPY_NO_EXPORT void PyArray_MapIterNext \
|
605 |
+
(PyArrayMapIterObject *);
|
606 |
+
NPY_NO_EXPORT int PyArray_Partition \
|
607 |
+
(PyArrayObject *, PyArrayObject *, int, NPY_SELECTKIND);
|
608 |
+
NPY_NO_EXPORT PyObject * PyArray_ArgPartition \
|
609 |
+
(PyArrayObject *, PyArrayObject *, int, NPY_SELECTKIND);
|
610 |
+
NPY_NO_EXPORT int PyArray_SelectkindConverter \
|
611 |
+
(PyObject *, NPY_SELECTKIND *);
|
612 |
+
NPY_NO_EXPORT void * PyDataMem_NEW_ZEROED \
|
613 |
+
(size_t, size_t);
|
614 |
+
NPY_NO_EXPORT int PyArray_CheckAnyScalarExact \
|
615 |
+
(PyObject *);
|
616 |
+
NPY_NO_EXPORT PyObject * PyArray_MapIterArrayCopyIfOverlap \
|
617 |
+
(PyArrayObject *, PyObject *, int, PyArrayObject *);
|
618 |
+
NPY_NO_EXPORT int PyArray_ResolveWritebackIfCopy \
|
619 |
+
(PyArrayObject *);
|
620 |
+
NPY_NO_EXPORT int PyArray_SetWritebackIfCopyBase \
|
621 |
+
(PyArrayObject *, PyArrayObject *);
|
622 |
+
NPY_NO_EXPORT PyObject * PyDataMem_SetHandler \
|
623 |
+
(PyObject *);
|
624 |
+
NPY_NO_EXPORT PyObject * PyDataMem_GetHandler \
|
625 |
+
(void);
|
626 |
+
extern NPY_NO_EXPORT PyObject* PyDataMem_DefaultHandler;
|
627 |
+
|
628 |
+
|
629 |
+
#else
|
630 |
+
|
631 |
+
#if defined(PY_ARRAY_UNIQUE_SYMBOL)
|
632 |
+
#define PyArray_API PY_ARRAY_UNIQUE_SYMBOL
|
633 |
+
#endif
|
634 |
+
|
635 |
+
#if defined(NO_IMPORT) || defined(NO_IMPORT_ARRAY)
|
636 |
+
extern void **PyArray_API;
|
637 |
+
#else
|
638 |
+
#if defined(PY_ARRAY_UNIQUE_SYMBOL)
|
639 |
+
void **PyArray_API;
|
640 |
+
#else
|
641 |
+
static void **PyArray_API=NULL;
|
642 |
+
#endif
|
643 |
+
#endif
|
644 |
+
|
645 |
+
#define PyArray_GetNDArrayCVersion \
|
646 |
+
(*(unsigned int (*)(void)) \
|
647 |
+
PyArray_API[0])
|
648 |
+
#define PyBigArray_Type (*(PyTypeObject *)PyArray_API[1])
|
649 |
+
#define PyArray_Type (*(PyTypeObject *)PyArray_API[2])
|
650 |
+
#define PyArrayDescr_Type (*(PyTypeObject *)PyArray_API[3])
|
651 |
+
#define PyArrayFlags_Type (*(PyTypeObject *)PyArray_API[4])
|
652 |
+
#define PyArrayIter_Type (*(PyTypeObject *)PyArray_API[5])
|
653 |
+
#define PyArrayMultiIter_Type (*(PyTypeObject *)PyArray_API[6])
|
654 |
+
#define NPY_NUMUSERTYPES (*(int *)PyArray_API[7])
|
655 |
+
#define PyBoolArrType_Type (*(PyTypeObject *)PyArray_API[8])
|
656 |
+
#define _PyArrayScalar_BoolValues ((PyBoolScalarObject *)PyArray_API[9])
|
657 |
+
#define PyGenericArrType_Type (*(PyTypeObject *)PyArray_API[10])
|
658 |
+
#define PyNumberArrType_Type (*(PyTypeObject *)PyArray_API[11])
|
659 |
+
#define PyIntegerArrType_Type (*(PyTypeObject *)PyArray_API[12])
|
660 |
+
#define PySignedIntegerArrType_Type (*(PyTypeObject *)PyArray_API[13])
|
661 |
+
#define PyUnsignedIntegerArrType_Type (*(PyTypeObject *)PyArray_API[14])
|
662 |
+
#define PyInexactArrType_Type (*(PyTypeObject *)PyArray_API[15])
|
663 |
+
#define PyFloatingArrType_Type (*(PyTypeObject *)PyArray_API[16])
|
664 |
+
#define PyComplexFloatingArrType_Type (*(PyTypeObject *)PyArray_API[17])
|
665 |
+
#define PyFlexibleArrType_Type (*(PyTypeObject *)PyArray_API[18])
|
666 |
+
#define PyCharacterArrType_Type (*(PyTypeObject *)PyArray_API[19])
|
667 |
+
#define PyByteArrType_Type (*(PyTypeObject *)PyArray_API[20])
|
668 |
+
#define PyShortArrType_Type (*(PyTypeObject *)PyArray_API[21])
|
669 |
+
#define PyIntArrType_Type (*(PyTypeObject *)PyArray_API[22])
|
670 |
+
#define PyLongArrType_Type (*(PyTypeObject *)PyArray_API[23])
|
671 |
+
#define PyLongLongArrType_Type (*(PyTypeObject *)PyArray_API[24])
|
672 |
+
#define PyUByteArrType_Type (*(PyTypeObject *)PyArray_API[25])
|
673 |
+
#define PyUShortArrType_Type (*(PyTypeObject *)PyArray_API[26])
|
674 |
+
#define PyUIntArrType_Type (*(PyTypeObject *)PyArray_API[27])
|
675 |
+
#define PyULongArrType_Type (*(PyTypeObject *)PyArray_API[28])
|
676 |
+
#define PyULongLongArrType_Type (*(PyTypeObject *)PyArray_API[29])
|
677 |
+
#define PyFloatArrType_Type (*(PyTypeObject *)PyArray_API[30])
|
678 |
+
#define PyDoubleArrType_Type (*(PyTypeObject *)PyArray_API[31])
|
679 |
+
#define PyLongDoubleArrType_Type (*(PyTypeObject *)PyArray_API[32])
|
680 |
+
#define PyCFloatArrType_Type (*(PyTypeObject *)PyArray_API[33])
|
681 |
+
#define PyCDoubleArrType_Type (*(PyTypeObject *)PyArray_API[34])
|
682 |
+
#define PyCLongDoubleArrType_Type (*(PyTypeObject *)PyArray_API[35])
|
683 |
+
#define PyObjectArrType_Type (*(PyTypeObject *)PyArray_API[36])
|
684 |
+
#define PyStringArrType_Type (*(PyTypeObject *)PyArray_API[37])
|
685 |
+
#define PyUnicodeArrType_Type (*(PyTypeObject *)PyArray_API[38])
|
686 |
+
#define PyVoidArrType_Type (*(PyTypeObject *)PyArray_API[39])
|
687 |
+
#define PyArray_SetNumericOps \
|
688 |
+
(*(int (*)(PyObject *)) \
|
689 |
+
PyArray_API[40])
|
690 |
+
#define PyArray_GetNumericOps \
|
691 |
+
(*(PyObject * (*)(void)) \
|
692 |
+
PyArray_API[41])
|
693 |
+
#define PyArray_INCREF \
|
694 |
+
(*(int (*)(PyArrayObject *)) \
|
695 |
+
PyArray_API[42])
|
696 |
+
#define PyArray_XDECREF \
|
697 |
+
(*(int (*)(PyArrayObject *)) \
|
698 |
+
PyArray_API[43])
|
699 |
+
#define PyArray_SetStringFunction \
|
700 |
+
(*(void (*)(PyObject *, int)) \
|
701 |
+
PyArray_API[44])
|
702 |
+
#define PyArray_DescrFromType \
|
703 |
+
(*(PyArray_Descr * (*)(int)) \
|
704 |
+
PyArray_API[45])
|
705 |
+
#define PyArray_TypeObjectFromType \
|
706 |
+
(*(PyObject * (*)(int)) \
|
707 |
+
PyArray_API[46])
|
708 |
+
#define PyArray_Zero \
|
709 |
+
(*(char * (*)(PyArrayObject *)) \
|
710 |
+
PyArray_API[47])
|
711 |
+
#define PyArray_One \
|
712 |
+
(*(char * (*)(PyArrayObject *)) \
|
713 |
+
PyArray_API[48])
|
714 |
+
#define PyArray_CastToType \
|
715 |
+
(*(PyObject * (*)(PyArrayObject *, PyArray_Descr *, int)) \
|
716 |
+
PyArray_API[49])
|
717 |
+
#define PyArray_CastTo \
|
718 |
+
(*(int (*)(PyArrayObject *, PyArrayObject *)) \
|
719 |
+
PyArray_API[50])
|
720 |
+
#define PyArray_CastAnyTo \
|
721 |
+
(*(int (*)(PyArrayObject *, PyArrayObject *)) \
|
722 |
+
PyArray_API[51])
|
723 |
+
#define PyArray_CanCastSafely \
|
724 |
+
(*(int (*)(int, int)) \
|
725 |
+
PyArray_API[52])
|
726 |
+
#define PyArray_CanCastTo \
|
727 |
+
(*(npy_bool (*)(PyArray_Descr *, PyArray_Descr *)) \
|
728 |
+
PyArray_API[53])
|
729 |
+
#define PyArray_ObjectType \
|
730 |
+
(*(int (*)(PyObject *, int)) \
|
731 |
+
PyArray_API[54])
|
732 |
+
#define PyArray_DescrFromObject \
|
733 |
+
(*(PyArray_Descr * (*)(PyObject *, PyArray_Descr *)) \
|
734 |
+
PyArray_API[55])
|
735 |
+
#define PyArray_ConvertToCommonType \
|
736 |
+
(*(PyArrayObject ** (*)(PyObject *, int *)) \
|
737 |
+
PyArray_API[56])
|
738 |
+
#define PyArray_DescrFromScalar \
|
739 |
+
(*(PyArray_Descr * (*)(PyObject *)) \
|
740 |
+
PyArray_API[57])
|
741 |
+
#define PyArray_DescrFromTypeObject \
|
742 |
+
(*(PyArray_Descr * (*)(PyObject *)) \
|
743 |
+
PyArray_API[58])
|
744 |
+
#define PyArray_Size \
|
745 |
+
(*(npy_intp (*)(PyObject *)) \
|
746 |
+
PyArray_API[59])
|
747 |
+
#define PyArray_Scalar \
|
748 |
+
(*(PyObject * (*)(void *, PyArray_Descr *, PyObject *)) \
|
749 |
+
PyArray_API[60])
|
750 |
+
#define PyArray_FromScalar \
|
751 |
+
(*(PyObject * (*)(PyObject *, PyArray_Descr *)) \
|
752 |
+
PyArray_API[61])
|
753 |
+
#define PyArray_ScalarAsCtype \
|
754 |
+
(*(void (*)(PyObject *, void *)) \
|
755 |
+
PyArray_API[62])
|
756 |
+
#define PyArray_CastScalarToCtype \
|
757 |
+
(*(int (*)(PyObject *, void *, PyArray_Descr *)) \
|
758 |
+
PyArray_API[63])
|
759 |
+
#define PyArray_CastScalarDirect \
|
760 |
+
(*(int (*)(PyObject *, PyArray_Descr *, void *, int)) \
|
761 |
+
PyArray_API[64])
|
762 |
+
#define PyArray_ScalarFromObject \
|
763 |
+
(*(PyObject * (*)(PyObject *)) \
|
764 |
+
PyArray_API[65])
|
765 |
+
#define PyArray_GetCastFunc \
|
766 |
+
(*(PyArray_VectorUnaryFunc * (*)(PyArray_Descr *, int)) \
|
767 |
+
PyArray_API[66])
|
768 |
+
#define PyArray_FromDims \
|
769 |
+
(*(PyObject * (*)(int NPY_UNUSED(nd), int *NPY_UNUSED(d), int NPY_UNUSED(type))) \
|
770 |
+
PyArray_API[67])
|
771 |
+
#define PyArray_FromDimsAndDataAndDescr \
|
772 |
+
(*(PyObject * (*)(int NPY_UNUSED(nd), int *NPY_UNUSED(d), PyArray_Descr *, char *NPY_UNUSED(data))) \
|
773 |
+
PyArray_API[68])
|
774 |
+
#define PyArray_FromAny \
|
775 |
+
(*(PyObject * (*)(PyObject *, PyArray_Descr *, int, int, int, PyObject *)) \
|
776 |
+
PyArray_API[69])
|
777 |
+
#define PyArray_EnsureArray \
|
778 |
+
(*(PyObject * (*)(PyObject *)) \
|
779 |
+
PyArray_API[70])
|
780 |
+
#define PyArray_EnsureAnyArray \
|
781 |
+
(*(PyObject * (*)(PyObject *)) \
|
782 |
+
PyArray_API[71])
|
783 |
+
#define PyArray_FromFile \
|
784 |
+
(*(PyObject * (*)(FILE *, PyArray_Descr *, npy_intp, char *)) \
|
785 |
+
PyArray_API[72])
|
786 |
+
#define PyArray_FromString \
|
787 |
+
(*(PyObject * (*)(char *, npy_intp, PyArray_Descr *, npy_intp, char *)) \
|
788 |
+
PyArray_API[73])
|
789 |
+
#define PyArray_FromBuffer \
|
790 |
+
(*(PyObject * (*)(PyObject *, PyArray_Descr *, npy_intp, npy_intp)) \
|
791 |
+
PyArray_API[74])
|
792 |
+
#define PyArray_FromIter \
|
793 |
+
(*(PyObject * (*)(PyObject *, PyArray_Descr *, npy_intp)) \
|
794 |
+
PyArray_API[75])
|
795 |
+
#define PyArray_Return \
|
796 |
+
(*(PyObject * (*)(PyArrayObject *)) \
|
797 |
+
PyArray_API[76])
|
798 |
+
#define PyArray_GetField \
|
799 |
+
(*(PyObject * (*)(PyArrayObject *, PyArray_Descr *, int)) \
|
800 |
+
PyArray_API[77])
|
801 |
+
#define PyArray_SetField \
|
802 |
+
(*(int (*)(PyArrayObject *, PyArray_Descr *, int, PyObject *)) \
|
803 |
+
PyArray_API[78])
|
804 |
+
#define PyArray_Byteswap \
|
805 |
+
(*(PyObject * (*)(PyArrayObject *, npy_bool)) \
|
806 |
+
PyArray_API[79])
|
807 |
+
#define PyArray_Resize \
|
808 |
+
(*(PyObject * (*)(PyArrayObject *, PyArray_Dims *, int, NPY_ORDER NPY_UNUSED(order))) \
|
809 |
+
PyArray_API[80])
|
810 |
+
#define PyArray_MoveInto \
|
811 |
+
(*(int (*)(PyArrayObject *, PyArrayObject *)) \
|
812 |
+
PyArray_API[81])
|
813 |
+
#define PyArray_CopyInto \
|
814 |
+
(*(int (*)(PyArrayObject *, PyArrayObject *)) \
|
815 |
+
PyArray_API[82])
|
816 |
+
#define PyArray_CopyAnyInto \
|
817 |
+
(*(int (*)(PyArrayObject *, PyArrayObject *)) \
|
818 |
+
PyArray_API[83])
|
819 |
+
#define PyArray_CopyObject \
|
820 |
+
(*(int (*)(PyArrayObject *, PyObject *)) \
|
821 |
+
PyArray_API[84])
|
822 |
+
#define PyArray_NewCopy \
|
823 |
+
(*(PyObject * (*)(PyArrayObject *, NPY_ORDER)) \
|
824 |
+
PyArray_API[85])
|
825 |
+
#define PyArray_ToList \
|
826 |
+
(*(PyObject * (*)(PyArrayObject *)) \
|
827 |
+
PyArray_API[86])
|
828 |
+
#define PyArray_ToString \
|
829 |
+
(*(PyObject * (*)(PyArrayObject *, NPY_ORDER)) \
|
830 |
+
PyArray_API[87])
|
831 |
+
#define PyArray_ToFile \
|
832 |
+
(*(int (*)(PyArrayObject *, FILE *, char *, char *)) \
|
833 |
+
PyArray_API[88])
|
834 |
+
#define PyArray_Dump \
|
835 |
+
(*(int (*)(PyObject *, PyObject *, int)) \
|
836 |
+
PyArray_API[89])
|
837 |
+
#define PyArray_Dumps \
|
838 |
+
(*(PyObject * (*)(PyObject *, int)) \
|
839 |
+
PyArray_API[90])
|
840 |
+
#define PyArray_ValidType \
|
841 |
+
(*(int (*)(int)) \
|
842 |
+
PyArray_API[91])
|
843 |
+
#define PyArray_UpdateFlags \
|
844 |
+
(*(void (*)(PyArrayObject *, int)) \
|
845 |
+
PyArray_API[92])
|
846 |
+
#define PyArray_New \
|
847 |
+
(*(PyObject * (*)(PyTypeObject *, int, npy_intp const *, int, npy_intp const *, void *, int, int, PyObject *)) \
|
848 |
+
PyArray_API[93])
|
849 |
+
#define PyArray_NewFromDescr \
|
850 |
+
(*(PyObject * (*)(PyTypeObject *, PyArray_Descr *, int, npy_intp const *, npy_intp const *, void *, int, PyObject *)) \
|
851 |
+
PyArray_API[94])
|
852 |
+
#define PyArray_DescrNew \
|
853 |
+
(*(PyArray_Descr * (*)(PyArray_Descr *)) \
|
854 |
+
PyArray_API[95])
|
855 |
+
#define PyArray_DescrNewFromType \
|
856 |
+
(*(PyArray_Descr * (*)(int)) \
|
857 |
+
PyArray_API[96])
|
858 |
+
#define PyArray_GetPriority \
|
859 |
+
(*(double (*)(PyObject *, double)) \
|
860 |
+
PyArray_API[97])
|
861 |
+
#define PyArray_IterNew \
|
862 |
+
(*(PyObject * (*)(PyObject *)) \
|
863 |
+
PyArray_API[98])
|
864 |
+
#define PyArray_MultiIterNew \
|
865 |
+
(*(PyObject* (*)(int, ...)) \
|
866 |
+
PyArray_API[99])
|
867 |
+
#define PyArray_PyIntAsInt \
|
868 |
+
(*(int (*)(PyObject *)) \
|
869 |
+
PyArray_API[100])
|
870 |
+
#define PyArray_PyIntAsIntp \
|
871 |
+
(*(npy_intp (*)(PyObject *)) \
|
872 |
+
PyArray_API[101])
|
873 |
+
#define PyArray_Broadcast \
|
874 |
+
(*(int (*)(PyArrayMultiIterObject *)) \
|
875 |
+
PyArray_API[102])
|
876 |
+
#define PyArray_FillObjectArray \
|
877 |
+
(*(void (*)(PyArrayObject *, PyObject *)) \
|
878 |
+
PyArray_API[103])
|
879 |
+
#define PyArray_FillWithScalar \
|
880 |
+
(*(int (*)(PyArrayObject *, PyObject *)) \
|
881 |
+
PyArray_API[104])
|
882 |
+
#define PyArray_CheckStrides \
|
883 |
+
(*(npy_bool (*)(int, int, npy_intp, npy_intp, npy_intp const *, npy_intp const *)) \
|
884 |
+
PyArray_API[105])
|
885 |
+
#define PyArray_DescrNewByteorder \
|
886 |
+
(*(PyArray_Descr * (*)(PyArray_Descr *, char)) \
|
887 |
+
PyArray_API[106])
|
888 |
+
#define PyArray_IterAllButAxis \
|
889 |
+
(*(PyObject * (*)(PyObject *, int *)) \
|
890 |
+
PyArray_API[107])
|
891 |
+
#define PyArray_CheckFromAny \
|
892 |
+
(*(PyObject * (*)(PyObject *, PyArray_Descr *, int, int, int, PyObject *)) \
|
893 |
+
PyArray_API[108])
|
894 |
+
#define PyArray_FromArray \
|
895 |
+
(*(PyObject * (*)(PyArrayObject *, PyArray_Descr *, int)) \
|
896 |
+
PyArray_API[109])
|
897 |
+
#define PyArray_FromInterface \
|
898 |
+
(*(PyObject * (*)(PyObject *)) \
|
899 |
+
PyArray_API[110])
|
900 |
+
#define PyArray_FromStructInterface \
|
901 |
+
(*(PyObject * (*)(PyObject *)) \
|
902 |
+
PyArray_API[111])
|
903 |
+
#define PyArray_FromArrayAttr \
|
904 |
+
(*(PyObject * (*)(PyObject *, PyArray_Descr *, PyObject *)) \
|
905 |
+
PyArray_API[112])
|
906 |
+
#define PyArray_ScalarKind \
|
907 |
+
(*(NPY_SCALARKIND (*)(int, PyArrayObject **)) \
|
908 |
+
PyArray_API[113])
|
909 |
+
#define PyArray_CanCoerceScalar \
|
910 |
+
(*(int (*)(int, int, NPY_SCALARKIND)) \
|
911 |
+
PyArray_API[114])
|
912 |
+
#define PyArray_NewFlagsObject \
|
913 |
+
(*(PyObject * (*)(PyObject *)) \
|
914 |
+
PyArray_API[115])
|
915 |
+
#define PyArray_CanCastScalar \
|
916 |
+
(*(npy_bool (*)(PyTypeObject *, PyTypeObject *)) \
|
917 |
+
PyArray_API[116])
|
918 |
+
#define PyArray_CompareUCS4 \
|
919 |
+
(*(int (*)(npy_ucs4 const *, npy_ucs4 const *, size_t)) \
|
920 |
+
PyArray_API[117])
|
921 |
+
#define PyArray_RemoveSmallest \
|
922 |
+
(*(int (*)(PyArrayMultiIterObject *)) \
|
923 |
+
PyArray_API[118])
|
924 |
+
#define PyArray_ElementStrides \
|
925 |
+
(*(int (*)(PyObject *)) \
|
926 |
+
PyArray_API[119])
|
927 |
+
#define PyArray_Item_INCREF \
|
928 |
+
(*(void (*)(char *, PyArray_Descr *)) \
|
929 |
+
PyArray_API[120])
|
930 |
+
#define PyArray_Item_XDECREF \
|
931 |
+
(*(void (*)(char *, PyArray_Descr *)) \
|
932 |
+
PyArray_API[121])
|
933 |
+
#define PyArray_FieldNames \
|
934 |
+
(*(PyObject * (*)(PyObject *)) \
|
935 |
+
PyArray_API[122])
|
936 |
+
#define PyArray_Transpose \
|
937 |
+
(*(PyObject * (*)(PyArrayObject *, PyArray_Dims *)) \
|
938 |
+
PyArray_API[123])
|
939 |
+
#define PyArray_TakeFrom \
|
940 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject *, int, PyArrayObject *, NPY_CLIPMODE)) \
|
941 |
+
PyArray_API[124])
|
942 |
+
#define PyArray_PutTo \
|
943 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject*, PyObject *, NPY_CLIPMODE)) \
|
944 |
+
PyArray_API[125])
|
945 |
+
#define PyArray_PutMask \
|
946 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject*, PyObject*)) \
|
947 |
+
PyArray_API[126])
|
948 |
+
#define PyArray_Repeat \
|
949 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject *, int)) \
|
950 |
+
PyArray_API[127])
|
951 |
+
#define PyArray_Choose \
|
952 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject *, PyArrayObject *, NPY_CLIPMODE)) \
|
953 |
+
PyArray_API[128])
|
954 |
+
#define PyArray_Sort \
|
955 |
+
(*(int (*)(PyArrayObject *, int, NPY_SORTKIND)) \
|
956 |
+
PyArray_API[129])
|
957 |
+
#define PyArray_ArgSort \
|
958 |
+
(*(PyObject * (*)(PyArrayObject *, int, NPY_SORTKIND)) \
|
959 |
+
PyArray_API[130])
|
960 |
+
#define PyArray_SearchSorted \
|
961 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject *, NPY_SEARCHSIDE, PyObject *)) \
|
962 |
+
PyArray_API[131])
|
963 |
+
#define PyArray_ArgMax \
|
964 |
+
(*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \
|
965 |
+
PyArray_API[132])
|
966 |
+
#define PyArray_ArgMin \
|
967 |
+
(*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \
|
968 |
+
PyArray_API[133])
|
969 |
+
#define PyArray_Reshape \
|
970 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject *)) \
|
971 |
+
PyArray_API[134])
|
972 |
+
#define PyArray_Newshape \
|
973 |
+
(*(PyObject * (*)(PyArrayObject *, PyArray_Dims *, NPY_ORDER)) \
|
974 |
+
PyArray_API[135])
|
975 |
+
#define PyArray_Squeeze \
|
976 |
+
(*(PyObject * (*)(PyArrayObject *)) \
|
977 |
+
PyArray_API[136])
|
978 |
+
#define PyArray_View \
|
979 |
+
(*(PyObject * (*)(PyArrayObject *, PyArray_Descr *, PyTypeObject *)) \
|
980 |
+
PyArray_API[137])
|
981 |
+
#define PyArray_SwapAxes \
|
982 |
+
(*(PyObject * (*)(PyArrayObject *, int, int)) \
|
983 |
+
PyArray_API[138])
|
984 |
+
#define PyArray_Max \
|
985 |
+
(*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \
|
986 |
+
PyArray_API[139])
|
987 |
+
#define PyArray_Min \
|
988 |
+
(*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \
|
989 |
+
PyArray_API[140])
|
990 |
+
#define PyArray_Ptp \
|
991 |
+
(*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \
|
992 |
+
PyArray_API[141])
|
993 |
+
#define PyArray_Mean \
|
994 |
+
(*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \
|
995 |
+
PyArray_API[142])
|
996 |
+
#define PyArray_Trace \
|
997 |
+
(*(PyObject * (*)(PyArrayObject *, int, int, int, int, PyArrayObject *)) \
|
998 |
+
PyArray_API[143])
|
999 |
+
#define PyArray_Diagonal \
|
1000 |
+
(*(PyObject * (*)(PyArrayObject *, int, int, int)) \
|
1001 |
+
PyArray_API[144])
|
1002 |
+
#define PyArray_Clip \
|
1003 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject *, PyObject *, PyArrayObject *)) \
|
1004 |
+
PyArray_API[145])
|
1005 |
+
#define PyArray_Conjugate \
|
1006 |
+
(*(PyObject * (*)(PyArrayObject *, PyArrayObject *)) \
|
1007 |
+
PyArray_API[146])
|
1008 |
+
#define PyArray_Nonzero \
|
1009 |
+
(*(PyObject * (*)(PyArrayObject *)) \
|
1010 |
+
PyArray_API[147])
|
1011 |
+
#define PyArray_Std \
|
1012 |
+
(*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *, int)) \
|
1013 |
+
PyArray_API[148])
|
1014 |
+
#define PyArray_Sum \
|
1015 |
+
(*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \
|
1016 |
+
PyArray_API[149])
|
1017 |
+
#define PyArray_CumSum \
|
1018 |
+
(*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \
|
1019 |
+
PyArray_API[150])
|
1020 |
+
#define PyArray_Prod \
|
1021 |
+
(*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \
|
1022 |
+
PyArray_API[151])
|
1023 |
+
#define PyArray_CumProd \
|
1024 |
+
(*(PyObject * (*)(PyArrayObject *, int, int, PyArrayObject *)) \
|
1025 |
+
PyArray_API[152])
|
1026 |
+
#define PyArray_All \
|
1027 |
+
(*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \
|
1028 |
+
PyArray_API[153])
|
1029 |
+
#define PyArray_Any \
|
1030 |
+
(*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \
|
1031 |
+
PyArray_API[154])
|
1032 |
+
#define PyArray_Compress \
|
1033 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject *, int, PyArrayObject *)) \
|
1034 |
+
PyArray_API[155])
|
1035 |
+
#define PyArray_Flatten \
|
1036 |
+
(*(PyObject * (*)(PyArrayObject *, NPY_ORDER)) \
|
1037 |
+
PyArray_API[156])
|
1038 |
+
#define PyArray_Ravel \
|
1039 |
+
(*(PyObject * (*)(PyArrayObject *, NPY_ORDER)) \
|
1040 |
+
PyArray_API[157])
|
1041 |
+
#define PyArray_MultiplyList \
|
1042 |
+
(*(npy_intp (*)(npy_intp const *, int)) \
|
1043 |
+
PyArray_API[158])
|
1044 |
+
#define PyArray_MultiplyIntList \
|
1045 |
+
(*(int (*)(int const *, int)) \
|
1046 |
+
PyArray_API[159])
|
1047 |
+
#define PyArray_GetPtr \
|
1048 |
+
(*(void * (*)(PyArrayObject *, npy_intp const*)) \
|
1049 |
+
PyArray_API[160])
|
1050 |
+
#define PyArray_CompareLists \
|
1051 |
+
(*(int (*)(npy_intp const *, npy_intp const *, int)) \
|
1052 |
+
PyArray_API[161])
|
1053 |
+
#define PyArray_AsCArray \
|
1054 |
+
(*(int (*)(PyObject **, void *, npy_intp *, int, PyArray_Descr*)) \
|
1055 |
+
PyArray_API[162])
|
1056 |
+
#define PyArray_As1D \
|
1057 |
+
(*(int (*)(PyObject **NPY_UNUSED(op), char **NPY_UNUSED(ptr), int *NPY_UNUSED(d1), int NPY_UNUSED(typecode))) \
|
1058 |
+
PyArray_API[163])
|
1059 |
+
#define PyArray_As2D \
|
1060 |
+
(*(int (*)(PyObject **NPY_UNUSED(op), char ***NPY_UNUSED(ptr), int *NPY_UNUSED(d1), int *NPY_UNUSED(d2), int NPY_UNUSED(typecode))) \
|
1061 |
+
PyArray_API[164])
|
1062 |
+
#define PyArray_Free \
|
1063 |
+
(*(int (*)(PyObject *, void *)) \
|
1064 |
+
PyArray_API[165])
|
1065 |
+
#define PyArray_Converter \
|
1066 |
+
(*(int (*)(PyObject *, PyObject **)) \
|
1067 |
+
PyArray_API[166])
|
1068 |
+
#define PyArray_IntpFromSequence \
|
1069 |
+
(*(int (*)(PyObject *, npy_intp *, int)) \
|
1070 |
+
PyArray_API[167])
|
1071 |
+
#define PyArray_Concatenate \
|
1072 |
+
(*(PyObject * (*)(PyObject *, int)) \
|
1073 |
+
PyArray_API[168])
|
1074 |
+
#define PyArray_InnerProduct \
|
1075 |
+
(*(PyObject * (*)(PyObject *, PyObject *)) \
|
1076 |
+
PyArray_API[169])
|
1077 |
+
#define PyArray_MatrixProduct \
|
1078 |
+
(*(PyObject * (*)(PyObject *, PyObject *)) \
|
1079 |
+
PyArray_API[170])
|
1080 |
+
#define PyArray_CopyAndTranspose \
|
1081 |
+
(*(PyObject * (*)(PyObject *)) \
|
1082 |
+
PyArray_API[171])
|
1083 |
+
#define PyArray_Correlate \
|
1084 |
+
(*(PyObject * (*)(PyObject *, PyObject *, int)) \
|
1085 |
+
PyArray_API[172])
|
1086 |
+
#define PyArray_TypestrConvert \
|
1087 |
+
(*(int (*)(int, int)) \
|
1088 |
+
PyArray_API[173])
|
1089 |
+
#define PyArray_DescrConverter \
|
1090 |
+
(*(int (*)(PyObject *, PyArray_Descr **)) \
|
1091 |
+
PyArray_API[174])
|
1092 |
+
#define PyArray_DescrConverter2 \
|
1093 |
+
(*(int (*)(PyObject *, PyArray_Descr **)) \
|
1094 |
+
PyArray_API[175])
|
1095 |
+
#define PyArray_IntpConverter \
|
1096 |
+
(*(int (*)(PyObject *, PyArray_Dims *)) \
|
1097 |
+
PyArray_API[176])
|
1098 |
+
#define PyArray_BufferConverter \
|
1099 |
+
(*(int (*)(PyObject *, PyArray_Chunk *)) \
|
1100 |
+
PyArray_API[177])
|
1101 |
+
#define PyArray_AxisConverter \
|
1102 |
+
(*(int (*)(PyObject *, int *)) \
|
1103 |
+
PyArray_API[178])
|
1104 |
+
#define PyArray_BoolConverter \
|
1105 |
+
(*(int (*)(PyObject *, npy_bool *)) \
|
1106 |
+
PyArray_API[179])
|
1107 |
+
#define PyArray_ByteorderConverter \
|
1108 |
+
(*(int (*)(PyObject *, char *)) \
|
1109 |
+
PyArray_API[180])
|
1110 |
+
#define PyArray_OrderConverter \
|
1111 |
+
(*(int (*)(PyObject *, NPY_ORDER *)) \
|
1112 |
+
PyArray_API[181])
|
1113 |
+
#define PyArray_EquivTypes \
|
1114 |
+
(*(unsigned char (*)(PyArray_Descr *, PyArray_Descr *)) \
|
1115 |
+
PyArray_API[182])
|
1116 |
+
#define PyArray_Zeros \
|
1117 |
+
(*(PyObject * (*)(int, npy_intp const *, PyArray_Descr *, int)) \
|
1118 |
+
PyArray_API[183])
|
1119 |
+
#define PyArray_Empty \
|
1120 |
+
(*(PyObject * (*)(int, npy_intp const *, PyArray_Descr *, int)) \
|
1121 |
+
PyArray_API[184])
|
1122 |
+
#define PyArray_Where \
|
1123 |
+
(*(PyObject * (*)(PyObject *, PyObject *, PyObject *)) \
|
1124 |
+
PyArray_API[185])
|
1125 |
+
#define PyArray_Arange \
|
1126 |
+
(*(PyObject * (*)(double, double, double, int)) \
|
1127 |
+
PyArray_API[186])
|
1128 |
+
#define PyArray_ArangeObj \
|
1129 |
+
(*(PyObject * (*)(PyObject *, PyObject *, PyObject *, PyArray_Descr *)) \
|
1130 |
+
PyArray_API[187])
|
1131 |
+
#define PyArray_SortkindConverter \
|
1132 |
+
(*(int (*)(PyObject *, NPY_SORTKIND *)) \
|
1133 |
+
PyArray_API[188])
|
1134 |
+
#define PyArray_LexSort \
|
1135 |
+
(*(PyObject * (*)(PyObject *, int)) \
|
1136 |
+
PyArray_API[189])
|
1137 |
+
#define PyArray_Round \
|
1138 |
+
(*(PyObject * (*)(PyArrayObject *, int, PyArrayObject *)) \
|
1139 |
+
PyArray_API[190])
|
1140 |
+
#define PyArray_EquivTypenums \
|
1141 |
+
(*(unsigned char (*)(int, int)) \
|
1142 |
+
PyArray_API[191])
|
1143 |
+
#define PyArray_RegisterDataType \
|
1144 |
+
(*(int (*)(PyArray_Descr *)) \
|
1145 |
+
PyArray_API[192])
|
1146 |
+
#define PyArray_RegisterCastFunc \
|
1147 |
+
(*(int (*)(PyArray_Descr *, int, PyArray_VectorUnaryFunc *)) \
|
1148 |
+
PyArray_API[193])
|
1149 |
+
#define PyArray_RegisterCanCast \
|
1150 |
+
(*(int (*)(PyArray_Descr *, int, NPY_SCALARKIND)) \
|
1151 |
+
PyArray_API[194])
|
1152 |
+
#define PyArray_InitArrFuncs \
|
1153 |
+
(*(void (*)(PyArray_ArrFuncs *)) \
|
1154 |
+
PyArray_API[195])
|
1155 |
+
#define PyArray_IntTupleFromIntp \
|
1156 |
+
(*(PyObject * (*)(int, npy_intp const *)) \
|
1157 |
+
PyArray_API[196])
|
1158 |
+
#define PyArray_TypeNumFromName \
|
1159 |
+
(*(int (*)(char const *)) \
|
1160 |
+
PyArray_API[197])
|
1161 |
+
#define PyArray_ClipmodeConverter \
|
1162 |
+
(*(int (*)(PyObject *, NPY_CLIPMODE *)) \
|
1163 |
+
PyArray_API[198])
|
1164 |
+
#define PyArray_OutputConverter \
|
1165 |
+
(*(int (*)(PyObject *, PyArrayObject **)) \
|
1166 |
+
PyArray_API[199])
|
1167 |
+
#define PyArray_BroadcastToShape \
|
1168 |
+
(*(PyObject * (*)(PyObject *, npy_intp *, int)) \
|
1169 |
+
PyArray_API[200])
|
1170 |
+
#define _PyArray_SigintHandler \
|
1171 |
+
(*(void (*)(int)) \
|
1172 |
+
PyArray_API[201])
|
1173 |
+
#define _PyArray_GetSigintBuf \
|
1174 |
+
(*(void* (*)(void)) \
|
1175 |
+
PyArray_API[202])
|
1176 |
+
#define PyArray_DescrAlignConverter \
|
1177 |
+
(*(int (*)(PyObject *, PyArray_Descr **)) \
|
1178 |
+
PyArray_API[203])
|
1179 |
+
#define PyArray_DescrAlignConverter2 \
|
1180 |
+
(*(int (*)(PyObject *, PyArray_Descr **)) \
|
1181 |
+
PyArray_API[204])
|
1182 |
+
#define PyArray_SearchsideConverter \
|
1183 |
+
(*(int (*)(PyObject *, void *)) \
|
1184 |
+
PyArray_API[205])
|
1185 |
+
#define PyArray_CheckAxis \
|
1186 |
+
(*(PyObject * (*)(PyArrayObject *, int *, int)) \
|
1187 |
+
PyArray_API[206])
|
1188 |
+
#define PyArray_OverflowMultiplyList \
|
1189 |
+
(*(npy_intp (*)(npy_intp const *, int)) \
|
1190 |
+
PyArray_API[207])
|
1191 |
+
#define PyArray_CompareString \
|
1192 |
+
(*(int (*)(const char *, const char *, size_t)) \
|
1193 |
+
PyArray_API[208])
|
1194 |
+
#define PyArray_MultiIterFromObjects \
|
1195 |
+
(*(PyObject* (*)(PyObject **, int, int, ...)) \
|
1196 |
+
PyArray_API[209])
|
1197 |
+
#define PyArray_GetEndianness \
|
1198 |
+
(*(int (*)(void)) \
|
1199 |
+
PyArray_API[210])
|
1200 |
+
#define PyArray_GetNDArrayCFeatureVersion \
|
1201 |
+
(*(unsigned int (*)(void)) \
|
1202 |
+
PyArray_API[211])
|
1203 |
+
#define PyArray_Correlate2 \
|
1204 |
+
(*(PyObject * (*)(PyObject *, PyObject *, int)) \
|
1205 |
+
PyArray_API[212])
|
1206 |
+
#define PyArray_NeighborhoodIterNew \
|
1207 |
+
(*(PyObject* (*)(PyArrayIterObject *, const npy_intp *, int, PyArrayObject*)) \
|
1208 |
+
PyArray_API[213])
|
1209 |
+
#define PyTimeIntegerArrType_Type (*(PyTypeObject *)PyArray_API[214])
|
1210 |
+
#define PyDatetimeArrType_Type (*(PyTypeObject *)PyArray_API[215])
|
1211 |
+
#define PyTimedeltaArrType_Type (*(PyTypeObject *)PyArray_API[216])
|
1212 |
+
#define PyHalfArrType_Type (*(PyTypeObject *)PyArray_API[217])
|
1213 |
+
#define NpyIter_Type (*(PyTypeObject *)PyArray_API[218])
|
1214 |
+
#define PyArray_SetDatetimeParseFunction \
|
1215 |
+
(*(void (*)(PyObject *NPY_UNUSED(op))) \
|
1216 |
+
PyArray_API[219])
|
1217 |
+
#define PyArray_DatetimeToDatetimeStruct \
|
1218 |
+
(*(void (*)(npy_datetime NPY_UNUSED(val), NPY_DATETIMEUNIT NPY_UNUSED(fr), npy_datetimestruct *)) \
|
1219 |
+
PyArray_API[220])
|
1220 |
+
#define PyArray_TimedeltaToTimedeltaStruct \
|
1221 |
+
(*(void (*)(npy_timedelta NPY_UNUSED(val), NPY_DATETIMEUNIT NPY_UNUSED(fr), npy_timedeltastruct *)) \
|
1222 |
+
PyArray_API[221])
|
1223 |
+
#define PyArray_DatetimeStructToDatetime \
|
1224 |
+
(*(npy_datetime (*)(NPY_DATETIMEUNIT NPY_UNUSED(fr), npy_datetimestruct *NPY_UNUSED(d))) \
|
1225 |
+
PyArray_API[222])
|
1226 |
+
#define PyArray_TimedeltaStructToTimedelta \
|
1227 |
+
(*(npy_datetime (*)(NPY_DATETIMEUNIT NPY_UNUSED(fr), npy_timedeltastruct *NPY_UNUSED(d))) \
|
1228 |
+
PyArray_API[223])
|
1229 |
+
#define NpyIter_New \
|
1230 |
+
(*(NpyIter * (*)(PyArrayObject *, npy_uint32, NPY_ORDER, NPY_CASTING, PyArray_Descr*)) \
|
1231 |
+
PyArray_API[224])
|
1232 |
+
#define NpyIter_MultiNew \
|
1233 |
+
(*(NpyIter * (*)(int, PyArrayObject **, npy_uint32, NPY_ORDER, NPY_CASTING, npy_uint32 *, PyArray_Descr **)) \
|
1234 |
+
PyArray_API[225])
|
1235 |
+
#define NpyIter_AdvancedNew \
|
1236 |
+
(*(NpyIter * (*)(int, PyArrayObject **, npy_uint32, NPY_ORDER, NPY_CASTING, npy_uint32 *, PyArray_Descr **, int, int **, npy_intp *, npy_intp)) \
|
1237 |
+
PyArray_API[226])
|
1238 |
+
#define NpyIter_Copy \
|
1239 |
+
(*(NpyIter * (*)(NpyIter *)) \
|
1240 |
+
PyArray_API[227])
|
1241 |
+
#define NpyIter_Deallocate \
|
1242 |
+
(*(int (*)(NpyIter *)) \
|
1243 |
+
PyArray_API[228])
|
1244 |
+
#define NpyIter_HasDelayedBufAlloc \
|
1245 |
+
(*(npy_bool (*)(NpyIter *)) \
|
1246 |
+
PyArray_API[229])
|
1247 |
+
#define NpyIter_HasExternalLoop \
|
1248 |
+
(*(npy_bool (*)(NpyIter *)) \
|
1249 |
+
PyArray_API[230])
|
1250 |
+
#define NpyIter_EnableExternalLoop \
|
1251 |
+
(*(int (*)(NpyIter *)) \
|
1252 |
+
PyArray_API[231])
|
1253 |
+
#define NpyIter_GetInnerStrideArray \
|
1254 |
+
(*(npy_intp * (*)(NpyIter *)) \
|
1255 |
+
PyArray_API[232])
|
1256 |
+
#define NpyIter_GetInnerLoopSizePtr \
|
1257 |
+
(*(npy_intp * (*)(NpyIter *)) \
|
1258 |
+
PyArray_API[233])
|
1259 |
+
#define NpyIter_Reset \
|
1260 |
+
(*(int (*)(NpyIter *, char **)) \
|
1261 |
+
PyArray_API[234])
|
1262 |
+
#define NpyIter_ResetBasePointers \
|
1263 |
+
(*(int (*)(NpyIter *, char **, char **)) \
|
1264 |
+
PyArray_API[235])
|
1265 |
+
#define NpyIter_ResetToIterIndexRange \
|
1266 |
+
(*(int (*)(NpyIter *, npy_intp, npy_intp, char **)) \
|
1267 |
+
PyArray_API[236])
|
1268 |
+
#define NpyIter_GetNDim \
|
1269 |
+
(*(int (*)(NpyIter *)) \
|
1270 |
+
PyArray_API[237])
|
1271 |
+
#define NpyIter_GetNOp \
|
1272 |
+
(*(int (*)(NpyIter *)) \
|
1273 |
+
PyArray_API[238])
|
1274 |
+
#define NpyIter_GetIterNext \
|
1275 |
+
(*(NpyIter_IterNextFunc * (*)(NpyIter *, char **)) \
|
1276 |
+
PyArray_API[239])
|
1277 |
+
#define NpyIter_GetIterSize \
|
1278 |
+
(*(npy_intp (*)(NpyIter *)) \
|
1279 |
+
PyArray_API[240])
|
1280 |
+
#define NpyIter_GetIterIndexRange \
|
1281 |
+
(*(void (*)(NpyIter *, npy_intp *, npy_intp *)) \
|
1282 |
+
PyArray_API[241])
|
1283 |
+
#define NpyIter_GetIterIndex \
|
1284 |
+
(*(npy_intp (*)(NpyIter *)) \
|
1285 |
+
PyArray_API[242])
|
1286 |
+
#define NpyIter_GotoIterIndex \
|
1287 |
+
(*(int (*)(NpyIter *, npy_intp)) \
|
1288 |
+
PyArray_API[243])
|
1289 |
+
#define NpyIter_HasMultiIndex \
|
1290 |
+
(*(npy_bool (*)(NpyIter *)) \
|
1291 |
+
PyArray_API[244])
|
1292 |
+
#define NpyIter_GetShape \
|
1293 |
+
(*(int (*)(NpyIter *, npy_intp *)) \
|
1294 |
+
PyArray_API[245])
|
1295 |
+
#define NpyIter_GetGetMultiIndex \
|
1296 |
+
(*(NpyIter_GetMultiIndexFunc * (*)(NpyIter *, char **)) \
|
1297 |
+
PyArray_API[246])
|
1298 |
+
#define NpyIter_GotoMultiIndex \
|
1299 |
+
(*(int (*)(NpyIter *, npy_intp const *)) \
|
1300 |
+
PyArray_API[247])
|
1301 |
+
#define NpyIter_RemoveMultiIndex \
|
1302 |
+
(*(int (*)(NpyIter *)) \
|
1303 |
+
PyArray_API[248])
|
1304 |
+
#define NpyIter_HasIndex \
|
1305 |
+
(*(npy_bool (*)(NpyIter *)) \
|
1306 |
+
PyArray_API[249])
|
1307 |
+
#define NpyIter_IsBuffered \
|
1308 |
+
(*(npy_bool (*)(NpyIter *)) \
|
1309 |
+
PyArray_API[250])
|
1310 |
+
#define NpyIter_IsGrowInner \
|
1311 |
+
(*(npy_bool (*)(NpyIter *)) \
|
1312 |
+
PyArray_API[251])
|
1313 |
+
#define NpyIter_GetBufferSize \
|
1314 |
+
(*(npy_intp (*)(NpyIter *)) \
|
1315 |
+
PyArray_API[252])
|
1316 |
+
#define NpyIter_GetIndexPtr \
|
1317 |
+
(*(npy_intp * (*)(NpyIter *)) \
|
1318 |
+
PyArray_API[253])
|
1319 |
+
#define NpyIter_GotoIndex \
|
1320 |
+
(*(int (*)(NpyIter *, npy_intp)) \
|
1321 |
+
PyArray_API[254])
|
1322 |
+
#define NpyIter_GetDataPtrArray \
|
1323 |
+
(*(char ** (*)(NpyIter *)) \
|
1324 |
+
PyArray_API[255])
|
1325 |
+
#define NpyIter_GetDescrArray \
|
1326 |
+
(*(PyArray_Descr ** (*)(NpyIter *)) \
|
1327 |
+
PyArray_API[256])
|
1328 |
+
#define NpyIter_GetOperandArray \
|
1329 |
+
(*(PyArrayObject ** (*)(NpyIter *)) \
|
1330 |
+
PyArray_API[257])
|
1331 |
+
#define NpyIter_GetIterView \
|
1332 |
+
(*(PyArrayObject * (*)(NpyIter *, npy_intp)) \
|
1333 |
+
PyArray_API[258])
|
1334 |
+
#define NpyIter_GetReadFlags \
|
1335 |
+
(*(void (*)(NpyIter *, char *)) \
|
1336 |
+
PyArray_API[259])
|
1337 |
+
#define NpyIter_GetWriteFlags \
|
1338 |
+
(*(void (*)(NpyIter *, char *)) \
|
1339 |
+
PyArray_API[260])
|
1340 |
+
#define NpyIter_DebugPrint \
|
1341 |
+
(*(void (*)(NpyIter *)) \
|
1342 |
+
PyArray_API[261])
|
1343 |
+
#define NpyIter_IterationNeedsAPI \
|
1344 |
+
(*(npy_bool (*)(NpyIter *)) \
|
1345 |
+
PyArray_API[262])
|
1346 |
+
#define NpyIter_GetInnerFixedStrideArray \
|
1347 |
+
(*(void (*)(NpyIter *, npy_intp *)) \
|
1348 |
+
PyArray_API[263])
|
1349 |
+
#define NpyIter_RemoveAxis \
|
1350 |
+
(*(int (*)(NpyIter *, int)) \
|
1351 |
+
PyArray_API[264])
|
1352 |
+
#define NpyIter_GetAxisStrideArray \
|
1353 |
+
(*(npy_intp * (*)(NpyIter *, int)) \
|
1354 |
+
PyArray_API[265])
|
1355 |
+
#define NpyIter_RequiresBuffering \
|
1356 |
+
(*(npy_bool (*)(NpyIter *)) \
|
1357 |
+
PyArray_API[266])
|
1358 |
+
#define NpyIter_GetInitialDataPtrArray \
|
1359 |
+
(*(char ** (*)(NpyIter *)) \
|
1360 |
+
PyArray_API[267])
|
1361 |
+
#define NpyIter_CreateCompatibleStrides \
|
1362 |
+
(*(int (*)(NpyIter *, npy_intp, npy_intp *)) \
|
1363 |
+
PyArray_API[268])
|
1364 |
+
#define PyArray_CastingConverter \
|
1365 |
+
(*(int (*)(PyObject *, NPY_CASTING *)) \
|
1366 |
+
PyArray_API[269])
|
1367 |
+
#define PyArray_CountNonzero \
|
1368 |
+
(*(npy_intp (*)(PyArrayObject *)) \
|
1369 |
+
PyArray_API[270])
|
1370 |
+
#define PyArray_PromoteTypes \
|
1371 |
+
(*(PyArray_Descr * (*)(PyArray_Descr *, PyArray_Descr *)) \
|
1372 |
+
PyArray_API[271])
|
1373 |
+
#define PyArray_MinScalarType \
|
1374 |
+
(*(PyArray_Descr * (*)(PyArrayObject *)) \
|
1375 |
+
PyArray_API[272])
|
1376 |
+
#define PyArray_ResultType \
|
1377 |
+
(*(PyArray_Descr * (*)(npy_intp, PyArrayObject *arrs[], npy_intp, PyArray_Descr *descrs[])) \
|
1378 |
+
PyArray_API[273])
|
1379 |
+
#define PyArray_CanCastArrayTo \
|
1380 |
+
(*(npy_bool (*)(PyArrayObject *, PyArray_Descr *, NPY_CASTING)) \
|
1381 |
+
PyArray_API[274])
|
1382 |
+
#define PyArray_CanCastTypeTo \
|
1383 |
+
(*(npy_bool (*)(PyArray_Descr *, PyArray_Descr *, NPY_CASTING)) \
|
1384 |
+
PyArray_API[275])
|
1385 |
+
#define PyArray_EinsteinSum \
|
1386 |
+
(*(PyArrayObject * (*)(char *, npy_intp, PyArrayObject **, PyArray_Descr *, NPY_ORDER, NPY_CASTING, PyArrayObject *)) \
|
1387 |
+
PyArray_API[276])
|
1388 |
+
#define PyArray_NewLikeArray \
|
1389 |
+
(*(PyObject * (*)(PyArrayObject *, NPY_ORDER, PyArray_Descr *, int)) \
|
1390 |
+
PyArray_API[277])
|
1391 |
+
#define PyArray_GetArrayParamsFromObject \
|
1392 |
+
(*(int (*)(PyObject *NPY_UNUSED(op), PyArray_Descr *NPY_UNUSED(requested_dtype), npy_bool NPY_UNUSED(writeable), PyArray_Descr **NPY_UNUSED(out_dtype), int *NPY_UNUSED(out_ndim), npy_intp *NPY_UNUSED(out_dims), PyArrayObject **NPY_UNUSED(out_arr), PyObject *NPY_UNUSED(context))) \
|
1393 |
+
PyArray_API[278])
|
1394 |
+
#define PyArray_ConvertClipmodeSequence \
|
1395 |
+
(*(int (*)(PyObject *, NPY_CLIPMODE *, int)) \
|
1396 |
+
PyArray_API[279])
|
1397 |
+
#define PyArray_MatrixProduct2 \
|
1398 |
+
(*(PyObject * (*)(PyObject *, PyObject *, PyArrayObject*)) \
|
1399 |
+
PyArray_API[280])
|
1400 |
+
#define NpyIter_IsFirstVisit \
|
1401 |
+
(*(npy_bool (*)(NpyIter *, int)) \
|
1402 |
+
PyArray_API[281])
|
1403 |
+
#define PyArray_SetBaseObject \
|
1404 |
+
(*(int (*)(PyArrayObject *, PyObject *)) \
|
1405 |
+
PyArray_API[282])
|
1406 |
+
#define PyArray_CreateSortedStridePerm \
|
1407 |
+
(*(void (*)(int, npy_intp const *, npy_stride_sort_item *)) \
|
1408 |
+
PyArray_API[283])
|
1409 |
+
#define PyArray_RemoveAxesInPlace \
|
1410 |
+
(*(void (*)(PyArrayObject *, const npy_bool *)) \
|
1411 |
+
PyArray_API[284])
|
1412 |
+
#define PyArray_DebugPrint \
|
1413 |
+
(*(void (*)(PyArrayObject *)) \
|
1414 |
+
PyArray_API[285])
|
1415 |
+
#define PyArray_FailUnlessWriteable \
|
1416 |
+
(*(int (*)(PyArrayObject *, const char *)) \
|
1417 |
+
PyArray_API[286])
|
1418 |
+
#define PyArray_SetUpdateIfCopyBase \
|
1419 |
+
(*(int (*)(PyArrayObject *, PyArrayObject *)) \
|
1420 |
+
PyArray_API[287])
|
1421 |
+
#define PyDataMem_NEW \
|
1422 |
+
(*(void * (*)(size_t)) \
|
1423 |
+
PyArray_API[288])
|
1424 |
+
#define PyDataMem_FREE \
|
1425 |
+
(*(void (*)(void *)) \
|
1426 |
+
PyArray_API[289])
|
1427 |
+
#define PyDataMem_RENEW \
|
1428 |
+
(*(void * (*)(void *, size_t)) \
|
1429 |
+
PyArray_API[290])
|
1430 |
+
#define PyDataMem_SetEventHook \
|
1431 |
+
(*(PyDataMem_EventHookFunc * (*)(PyDataMem_EventHookFunc *, void *, void **)) \
|
1432 |
+
PyArray_API[291])
|
1433 |
+
#define NPY_DEFAULT_ASSIGN_CASTING (*(NPY_CASTING *)PyArray_API[292])
|
1434 |
+
#define PyArray_MapIterSwapAxes \
|
1435 |
+
(*(void (*)(PyArrayMapIterObject *, PyArrayObject **, int)) \
|
1436 |
+
PyArray_API[293])
|
1437 |
+
#define PyArray_MapIterArray \
|
1438 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject *)) \
|
1439 |
+
PyArray_API[294])
|
1440 |
+
#define PyArray_MapIterNext \
|
1441 |
+
(*(void (*)(PyArrayMapIterObject *)) \
|
1442 |
+
PyArray_API[295])
|
1443 |
+
#define PyArray_Partition \
|
1444 |
+
(*(int (*)(PyArrayObject *, PyArrayObject *, int, NPY_SELECTKIND)) \
|
1445 |
+
PyArray_API[296])
|
1446 |
+
#define PyArray_ArgPartition \
|
1447 |
+
(*(PyObject * (*)(PyArrayObject *, PyArrayObject *, int, NPY_SELECTKIND)) \
|
1448 |
+
PyArray_API[297])
|
1449 |
+
#define PyArray_SelectkindConverter \
|
1450 |
+
(*(int (*)(PyObject *, NPY_SELECTKIND *)) \
|
1451 |
+
PyArray_API[298])
|
1452 |
+
#define PyDataMem_NEW_ZEROED \
|
1453 |
+
(*(void * (*)(size_t, size_t)) \
|
1454 |
+
PyArray_API[299])
|
1455 |
+
#define PyArray_CheckAnyScalarExact \
|
1456 |
+
(*(int (*)(PyObject *)) \
|
1457 |
+
PyArray_API[300])
|
1458 |
+
#define PyArray_MapIterArrayCopyIfOverlap \
|
1459 |
+
(*(PyObject * (*)(PyArrayObject *, PyObject *, int, PyArrayObject *)) \
|
1460 |
+
PyArray_API[301])
|
1461 |
+
#define PyArray_ResolveWritebackIfCopy \
|
1462 |
+
(*(int (*)(PyArrayObject *)) \
|
1463 |
+
PyArray_API[302])
|
1464 |
+
#define PyArray_SetWritebackIfCopyBase \
|
1465 |
+
(*(int (*)(PyArrayObject *, PyArrayObject *)) \
|
1466 |
+
PyArray_API[303])
|
1467 |
+
|
1468 |
+
#if NPY_FEATURE_VERSION >= NPY_1_22_API_VERSION
|
1469 |
+
#define PyDataMem_SetHandler \
|
1470 |
+
(*(PyObject * (*)(PyObject *)) \
|
1471 |
+
PyArray_API[304])
|
1472 |
+
#endif
|
1473 |
+
|
1474 |
+
#if NPY_FEATURE_VERSION >= NPY_1_22_API_VERSION
|
1475 |
+
#define PyDataMem_GetHandler \
|
1476 |
+
(*(PyObject * (*)(void)) \
|
1477 |
+
PyArray_API[305])
|
1478 |
+
#endif
|
1479 |
+
#define PyDataMem_DefaultHandler (*(PyObject* *)PyArray_API[306])
|
1480 |
+
|
1481 |
+
#if !defined(NO_IMPORT_ARRAY) && !defined(NO_IMPORT)
|
1482 |
+
static int
|
1483 |
+
_import_array(void)
|
1484 |
+
{
|
1485 |
+
int st;
|
1486 |
+
PyObject *numpy = PyImport_ImportModule("numpy.core._multiarray_umath");
|
1487 |
+
PyObject *c_api = NULL;
|
1488 |
+
|
1489 |
+
if (numpy == NULL) {
|
1490 |
+
return -1;
|
1491 |
+
}
|
1492 |
+
c_api = PyObject_GetAttrString(numpy, "_ARRAY_API");
|
1493 |
+
Py_DECREF(numpy);
|
1494 |
+
if (c_api == NULL) {
|
1495 |
+
return -1;
|
1496 |
+
}
|
1497 |
+
|
1498 |
+
if (!PyCapsule_CheckExact(c_api)) {
|
1499 |
+
PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is not PyCapsule object");
|
1500 |
+
Py_DECREF(c_api);
|
1501 |
+
return -1;
|
1502 |
+
}
|
1503 |
+
PyArray_API = (void **)PyCapsule_GetPointer(c_api, NULL);
|
1504 |
+
Py_DECREF(c_api);
|
1505 |
+
if (PyArray_API == NULL) {
|
1506 |
+
PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is NULL pointer");
|
1507 |
+
return -1;
|
1508 |
+
}
|
1509 |
+
|
1510 |
+
/* Perform runtime check of C API version */
|
1511 |
+
if (NPY_VERSION != PyArray_GetNDArrayCVersion()) {
|
1512 |
+
PyErr_Format(PyExc_RuntimeError, "module compiled against "\
|
1513 |
+
"ABI version 0x%x but this version of numpy is 0x%x", \
|
1514 |
+
(int) NPY_VERSION, (int) PyArray_GetNDArrayCVersion());
|
1515 |
+
return -1;
|
1516 |
+
}
|
1517 |
+
if (NPY_FEATURE_VERSION > PyArray_GetNDArrayCFeatureVersion()) {
|
1518 |
+
PyErr_Format(PyExc_RuntimeError, "module compiled against "\
|
1519 |
+
"API version 0x%x but this version of numpy is 0x%x . "\
|
1520 |
+
"Check the section C-API incompatibility at the "\
|
1521 |
+
"Troubleshooting ImportError section at "\
|
1522 |
+
"https://numpy.org/devdocs/user/troubleshooting-importerror.html"\
|
1523 |
+
"#c-api-incompatibility "\
|
1524 |
+
"for indications on how to solve this problem .", \
|
1525 |
+
(int) NPY_FEATURE_VERSION, (int) PyArray_GetNDArrayCFeatureVersion());
|
1526 |
+
return -1;
|
1527 |
+
}
|
1528 |
+
|
1529 |
+
/*
|
1530 |
+
* Perform runtime check of endianness and check it matches the one set by
|
1531 |
+
* the headers (npy_endian.h) as a safeguard
|
1532 |
+
*/
|
1533 |
+
st = PyArray_GetEndianness();
|
1534 |
+
if (st == NPY_CPU_UNKNOWN_ENDIAN) {
|
1535 |
+
PyErr_SetString(PyExc_RuntimeError,
|
1536 |
+
"FATAL: module compiled as unknown endian");
|
1537 |
+
return -1;
|
1538 |
+
}
|
1539 |
+
#if NPY_BYTE_ORDER == NPY_BIG_ENDIAN
|
1540 |
+
if (st != NPY_CPU_BIG) {
|
1541 |
+
PyErr_SetString(PyExc_RuntimeError,
|
1542 |
+
"FATAL: module compiled as big endian, but "
|
1543 |
+
"detected different endianness at runtime");
|
1544 |
+
return -1;
|
1545 |
+
}
|
1546 |
+
#elif NPY_BYTE_ORDER == NPY_LITTLE_ENDIAN
|
1547 |
+
if (st != NPY_CPU_LITTLE) {
|
1548 |
+
PyErr_SetString(PyExc_RuntimeError,
|
1549 |
+
"FATAL: module compiled as little endian, but "
|
1550 |
+
"detected different endianness at runtime");
|
1551 |
+
return -1;
|
1552 |
+
}
|
1553 |
+
#endif
|
1554 |
+
|
1555 |
+
return 0;
|
1556 |
+
}
|
1557 |
+
|
1558 |
+
#define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return NULL; } }
|
1559 |
+
|
1560 |
+
#define import_array1(ret) {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return ret; } }
|
1561 |
+
|
1562 |
+
#define import_array2(msg, ret) {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, msg); return ret; } }
|
1563 |
+
|
1564 |
+
#endif
|
1565 |
+
|
1566 |
+
#endif
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/__ufunc_api.h
ADDED
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
#ifdef _UMATHMODULE
|
3 |
+
|
4 |
+
extern NPY_NO_EXPORT PyTypeObject PyUFunc_Type;
|
5 |
+
|
6 |
+
extern NPY_NO_EXPORT PyTypeObject PyUFunc_Type;
|
7 |
+
|
8 |
+
NPY_NO_EXPORT PyObject * PyUFunc_FromFuncAndData \
|
9 |
+
(PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, int);
|
10 |
+
NPY_NO_EXPORT int PyUFunc_RegisterLoopForType \
|
11 |
+
(PyUFuncObject *, int, PyUFuncGenericFunction, const int *, void *);
|
12 |
+
NPY_NO_EXPORT int PyUFunc_GenericFunction \
|
13 |
+
(PyUFuncObject *NPY_UNUSED(ufunc), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds), PyArrayObject **NPY_UNUSED(op));
|
14 |
+
NPY_NO_EXPORT void PyUFunc_f_f_As_d_d \
|
15 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
16 |
+
NPY_NO_EXPORT void PyUFunc_d_d \
|
17 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
18 |
+
NPY_NO_EXPORT void PyUFunc_f_f \
|
19 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
20 |
+
NPY_NO_EXPORT void PyUFunc_g_g \
|
21 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
22 |
+
NPY_NO_EXPORT void PyUFunc_F_F_As_D_D \
|
23 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
24 |
+
NPY_NO_EXPORT void PyUFunc_F_F \
|
25 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
26 |
+
NPY_NO_EXPORT void PyUFunc_D_D \
|
27 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
28 |
+
NPY_NO_EXPORT void PyUFunc_G_G \
|
29 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
30 |
+
NPY_NO_EXPORT void PyUFunc_O_O \
|
31 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
32 |
+
NPY_NO_EXPORT void PyUFunc_ff_f_As_dd_d \
|
33 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
34 |
+
NPY_NO_EXPORT void PyUFunc_ff_f \
|
35 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
36 |
+
NPY_NO_EXPORT void PyUFunc_dd_d \
|
37 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
38 |
+
NPY_NO_EXPORT void PyUFunc_gg_g \
|
39 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
40 |
+
NPY_NO_EXPORT void PyUFunc_FF_F_As_DD_D \
|
41 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
42 |
+
NPY_NO_EXPORT void PyUFunc_DD_D \
|
43 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
44 |
+
NPY_NO_EXPORT void PyUFunc_FF_F \
|
45 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
46 |
+
NPY_NO_EXPORT void PyUFunc_GG_G \
|
47 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
48 |
+
NPY_NO_EXPORT void PyUFunc_OO_O \
|
49 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
50 |
+
NPY_NO_EXPORT void PyUFunc_O_O_method \
|
51 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
52 |
+
NPY_NO_EXPORT void PyUFunc_OO_O_method \
|
53 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
54 |
+
NPY_NO_EXPORT void PyUFunc_On_Om \
|
55 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
56 |
+
NPY_NO_EXPORT int PyUFunc_GetPyValues \
|
57 |
+
(char *, int *, int *, PyObject **);
|
58 |
+
NPY_NO_EXPORT int PyUFunc_checkfperr \
|
59 |
+
(int, PyObject *, int *);
|
60 |
+
NPY_NO_EXPORT void PyUFunc_clearfperr \
|
61 |
+
(void);
|
62 |
+
NPY_NO_EXPORT int PyUFunc_getfperr \
|
63 |
+
(void);
|
64 |
+
NPY_NO_EXPORT int PyUFunc_handlefperr \
|
65 |
+
(int, PyObject *, int, int *);
|
66 |
+
NPY_NO_EXPORT int PyUFunc_ReplaceLoopBySignature \
|
67 |
+
(PyUFuncObject *, PyUFuncGenericFunction, const int *, PyUFuncGenericFunction *);
|
68 |
+
NPY_NO_EXPORT PyObject * PyUFunc_FromFuncAndDataAndSignature \
|
69 |
+
(PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, int, const char *);
|
70 |
+
NPY_NO_EXPORT int PyUFunc_SetUsesArraysAsData \
|
71 |
+
(void **NPY_UNUSED(data), size_t NPY_UNUSED(i));
|
72 |
+
NPY_NO_EXPORT void PyUFunc_e_e \
|
73 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
74 |
+
NPY_NO_EXPORT void PyUFunc_e_e_As_f_f \
|
75 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
76 |
+
NPY_NO_EXPORT void PyUFunc_e_e_As_d_d \
|
77 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
78 |
+
NPY_NO_EXPORT void PyUFunc_ee_e \
|
79 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
80 |
+
NPY_NO_EXPORT void PyUFunc_ee_e_As_ff_f \
|
81 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
82 |
+
NPY_NO_EXPORT void PyUFunc_ee_e_As_dd_d \
|
83 |
+
(char **, npy_intp const *, npy_intp const *, void *);
|
84 |
+
NPY_NO_EXPORT int PyUFunc_DefaultTypeResolver \
|
85 |
+
(PyUFuncObject *, NPY_CASTING, PyArrayObject **, PyObject *, PyArray_Descr **);
|
86 |
+
NPY_NO_EXPORT int PyUFunc_ValidateCasting \
|
87 |
+
(PyUFuncObject *, NPY_CASTING, PyArrayObject **, PyArray_Descr **);
|
88 |
+
NPY_NO_EXPORT int PyUFunc_RegisterLoopForDescr \
|
89 |
+
(PyUFuncObject *, PyArray_Descr *, PyUFuncGenericFunction, PyArray_Descr **, void *);
|
90 |
+
NPY_NO_EXPORT PyObject * PyUFunc_FromFuncAndDataAndSignatureAndIdentity \
|
91 |
+
(PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, const int, const char *, PyObject *);
|
92 |
+
|
93 |
+
#else
|
94 |
+
|
95 |
+
#if defined(PY_UFUNC_UNIQUE_SYMBOL)
|
96 |
+
#define PyUFunc_API PY_UFUNC_UNIQUE_SYMBOL
|
97 |
+
#endif
|
98 |
+
|
99 |
+
#if defined(NO_IMPORT) || defined(NO_IMPORT_UFUNC)
|
100 |
+
extern void **PyUFunc_API;
|
101 |
+
#else
|
102 |
+
#if defined(PY_UFUNC_UNIQUE_SYMBOL)
|
103 |
+
void **PyUFunc_API;
|
104 |
+
#else
|
105 |
+
static void **PyUFunc_API=NULL;
|
106 |
+
#endif
|
107 |
+
#endif
|
108 |
+
|
109 |
+
#define PyUFunc_Type (*(PyTypeObject *)PyUFunc_API[0])
|
110 |
+
#define PyUFunc_FromFuncAndData \
|
111 |
+
(*(PyObject * (*)(PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, int)) \
|
112 |
+
PyUFunc_API[1])
|
113 |
+
#define PyUFunc_RegisterLoopForType \
|
114 |
+
(*(int (*)(PyUFuncObject *, int, PyUFuncGenericFunction, const int *, void *)) \
|
115 |
+
PyUFunc_API[2])
|
116 |
+
#define PyUFunc_GenericFunction \
|
117 |
+
(*(int (*)(PyUFuncObject *NPY_UNUSED(ufunc), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds), PyArrayObject **NPY_UNUSED(op))) \
|
118 |
+
PyUFunc_API[3])
|
119 |
+
#define PyUFunc_f_f_As_d_d \
|
120 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
121 |
+
PyUFunc_API[4])
|
122 |
+
#define PyUFunc_d_d \
|
123 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
124 |
+
PyUFunc_API[5])
|
125 |
+
#define PyUFunc_f_f \
|
126 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
127 |
+
PyUFunc_API[6])
|
128 |
+
#define PyUFunc_g_g \
|
129 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
130 |
+
PyUFunc_API[7])
|
131 |
+
#define PyUFunc_F_F_As_D_D \
|
132 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
133 |
+
PyUFunc_API[8])
|
134 |
+
#define PyUFunc_F_F \
|
135 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
136 |
+
PyUFunc_API[9])
|
137 |
+
#define PyUFunc_D_D \
|
138 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
139 |
+
PyUFunc_API[10])
|
140 |
+
#define PyUFunc_G_G \
|
141 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
142 |
+
PyUFunc_API[11])
|
143 |
+
#define PyUFunc_O_O \
|
144 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
145 |
+
PyUFunc_API[12])
|
146 |
+
#define PyUFunc_ff_f_As_dd_d \
|
147 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
148 |
+
PyUFunc_API[13])
|
149 |
+
#define PyUFunc_ff_f \
|
150 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
151 |
+
PyUFunc_API[14])
|
152 |
+
#define PyUFunc_dd_d \
|
153 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
154 |
+
PyUFunc_API[15])
|
155 |
+
#define PyUFunc_gg_g \
|
156 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
157 |
+
PyUFunc_API[16])
|
158 |
+
#define PyUFunc_FF_F_As_DD_D \
|
159 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
160 |
+
PyUFunc_API[17])
|
161 |
+
#define PyUFunc_DD_D \
|
162 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
163 |
+
PyUFunc_API[18])
|
164 |
+
#define PyUFunc_FF_F \
|
165 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
166 |
+
PyUFunc_API[19])
|
167 |
+
#define PyUFunc_GG_G \
|
168 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
169 |
+
PyUFunc_API[20])
|
170 |
+
#define PyUFunc_OO_O \
|
171 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
172 |
+
PyUFunc_API[21])
|
173 |
+
#define PyUFunc_O_O_method \
|
174 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
175 |
+
PyUFunc_API[22])
|
176 |
+
#define PyUFunc_OO_O_method \
|
177 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
178 |
+
PyUFunc_API[23])
|
179 |
+
#define PyUFunc_On_Om \
|
180 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
181 |
+
PyUFunc_API[24])
|
182 |
+
#define PyUFunc_GetPyValues \
|
183 |
+
(*(int (*)(char *, int *, int *, PyObject **)) \
|
184 |
+
PyUFunc_API[25])
|
185 |
+
#define PyUFunc_checkfperr \
|
186 |
+
(*(int (*)(int, PyObject *, int *)) \
|
187 |
+
PyUFunc_API[26])
|
188 |
+
#define PyUFunc_clearfperr \
|
189 |
+
(*(void (*)(void)) \
|
190 |
+
PyUFunc_API[27])
|
191 |
+
#define PyUFunc_getfperr \
|
192 |
+
(*(int (*)(void)) \
|
193 |
+
PyUFunc_API[28])
|
194 |
+
#define PyUFunc_handlefperr \
|
195 |
+
(*(int (*)(int, PyObject *, int, int *)) \
|
196 |
+
PyUFunc_API[29])
|
197 |
+
#define PyUFunc_ReplaceLoopBySignature \
|
198 |
+
(*(int (*)(PyUFuncObject *, PyUFuncGenericFunction, const int *, PyUFuncGenericFunction *)) \
|
199 |
+
PyUFunc_API[30])
|
200 |
+
#define PyUFunc_FromFuncAndDataAndSignature \
|
201 |
+
(*(PyObject * (*)(PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, int, const char *)) \
|
202 |
+
PyUFunc_API[31])
|
203 |
+
#define PyUFunc_SetUsesArraysAsData \
|
204 |
+
(*(int (*)(void **NPY_UNUSED(data), size_t NPY_UNUSED(i))) \
|
205 |
+
PyUFunc_API[32])
|
206 |
+
#define PyUFunc_e_e \
|
207 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
208 |
+
PyUFunc_API[33])
|
209 |
+
#define PyUFunc_e_e_As_f_f \
|
210 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
211 |
+
PyUFunc_API[34])
|
212 |
+
#define PyUFunc_e_e_As_d_d \
|
213 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
214 |
+
PyUFunc_API[35])
|
215 |
+
#define PyUFunc_ee_e \
|
216 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
217 |
+
PyUFunc_API[36])
|
218 |
+
#define PyUFunc_ee_e_As_ff_f \
|
219 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
220 |
+
PyUFunc_API[37])
|
221 |
+
#define PyUFunc_ee_e_As_dd_d \
|
222 |
+
(*(void (*)(char **, npy_intp const *, npy_intp const *, void *)) \
|
223 |
+
PyUFunc_API[38])
|
224 |
+
#define PyUFunc_DefaultTypeResolver \
|
225 |
+
(*(int (*)(PyUFuncObject *, NPY_CASTING, PyArrayObject **, PyObject *, PyArray_Descr **)) \
|
226 |
+
PyUFunc_API[39])
|
227 |
+
#define PyUFunc_ValidateCasting \
|
228 |
+
(*(int (*)(PyUFuncObject *, NPY_CASTING, PyArrayObject **, PyArray_Descr **)) \
|
229 |
+
PyUFunc_API[40])
|
230 |
+
#define PyUFunc_RegisterLoopForDescr \
|
231 |
+
(*(int (*)(PyUFuncObject *, PyArray_Descr *, PyUFuncGenericFunction, PyArray_Descr **, void *)) \
|
232 |
+
PyUFunc_API[41])
|
233 |
+
|
234 |
+
#if NPY_FEATURE_VERSION >= NPY_1_16_API_VERSION
|
235 |
+
#define PyUFunc_FromFuncAndDataAndSignatureAndIdentity \
|
236 |
+
(*(PyObject * (*)(PyUFuncGenericFunction *, void **, char *, int, int, int, int, const char *, const char *, const int, const char *, PyObject *)) \
|
237 |
+
PyUFunc_API[42])
|
238 |
+
#endif
|
239 |
+
|
240 |
+
static inline int
|
241 |
+
_import_umath(void)
|
242 |
+
{
|
243 |
+
PyObject *numpy = PyImport_ImportModule("numpy.core._multiarray_umath");
|
244 |
+
PyObject *c_api = NULL;
|
245 |
+
|
246 |
+
if (numpy == NULL) {
|
247 |
+
PyErr_SetString(PyExc_ImportError,
|
248 |
+
"numpy.core._multiarray_umath failed to import");
|
249 |
+
return -1;
|
250 |
+
}
|
251 |
+
c_api = PyObject_GetAttrString(numpy, "_UFUNC_API");
|
252 |
+
Py_DECREF(numpy);
|
253 |
+
if (c_api == NULL) {
|
254 |
+
PyErr_SetString(PyExc_AttributeError, "_UFUNC_API not found");
|
255 |
+
return -1;
|
256 |
+
}
|
257 |
+
|
258 |
+
if (!PyCapsule_CheckExact(c_api)) {
|
259 |
+
PyErr_SetString(PyExc_RuntimeError, "_UFUNC_API is not PyCapsule object");
|
260 |
+
Py_DECREF(c_api);
|
261 |
+
return -1;
|
262 |
+
}
|
263 |
+
PyUFunc_API = (void **)PyCapsule_GetPointer(c_api, NULL);
|
264 |
+
Py_DECREF(c_api);
|
265 |
+
if (PyUFunc_API == NULL) {
|
266 |
+
PyErr_SetString(PyExc_RuntimeError, "_UFUNC_API is NULL pointer");
|
267 |
+
return -1;
|
268 |
+
}
|
269 |
+
return 0;
|
270 |
+
}
|
271 |
+
|
272 |
+
#define import_umath() \
|
273 |
+
do {\
|
274 |
+
UFUNC_NOFPE\
|
275 |
+
if (_import_umath() < 0) {\
|
276 |
+
PyErr_Print();\
|
277 |
+
PyErr_SetString(PyExc_ImportError,\
|
278 |
+
"numpy.core.umath failed to import");\
|
279 |
+
return NULL;\
|
280 |
+
}\
|
281 |
+
} while(0)
|
282 |
+
|
283 |
+
#define import_umath1(ret) \
|
284 |
+
do {\
|
285 |
+
UFUNC_NOFPE\
|
286 |
+
if (_import_umath() < 0) {\
|
287 |
+
PyErr_Print();\
|
288 |
+
PyErr_SetString(PyExc_ImportError,\
|
289 |
+
"numpy.core.umath failed to import");\
|
290 |
+
return ret;\
|
291 |
+
}\
|
292 |
+
} while(0)
|
293 |
+
|
294 |
+
#define import_umath2(ret, msg) \
|
295 |
+
do {\
|
296 |
+
UFUNC_NOFPE\
|
297 |
+
if (_import_umath() < 0) {\
|
298 |
+
PyErr_Print();\
|
299 |
+
PyErr_SetString(PyExc_ImportError, msg);\
|
300 |
+
return ret;\
|
301 |
+
}\
|
302 |
+
} while(0)
|
303 |
+
|
304 |
+
#define import_ufunc() \
|
305 |
+
do {\
|
306 |
+
UFUNC_NOFPE\
|
307 |
+
if (_import_umath() < 0) {\
|
308 |
+
PyErr_Print();\
|
309 |
+
PyErr_SetString(PyExc_ImportError,\
|
310 |
+
"numpy.core.umath failed to import");\
|
311 |
+
}\
|
312 |
+
} while(0)
|
313 |
+
|
314 |
+
#endif
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/_dtype_api.h
ADDED
@@ -0,0 +1,408 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* DType related API shared by the (experimental) public API And internal API.
|
3 |
+
*/
|
4 |
+
|
5 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY___DTYPE_API_H_
|
6 |
+
#define NUMPY_CORE_INCLUDE_NUMPY___DTYPE_API_H_
|
7 |
+
|
8 |
+
#define __EXPERIMENTAL_DTYPE_API_VERSION 11
|
9 |
+
|
10 |
+
struct PyArrayMethodObject_tag;
|
11 |
+
|
12 |
+
/*
|
13 |
+
* Largely opaque struct for DType classes (i.e. metaclass instances).
|
14 |
+
* The internal definition is currently in `ndarraytypes.h` (export is a bit
|
15 |
+
* more complex because `PyArray_Descr` is a DTypeMeta internally but not
|
16 |
+
* externally).
|
17 |
+
*/
|
18 |
+
#if !(defined(NPY_INTERNAL_BUILD) && NPY_INTERNAL_BUILD)
|
19 |
+
|
20 |
+
typedef struct PyArray_DTypeMeta_tag {
|
21 |
+
PyHeapTypeObject super;
|
22 |
+
|
23 |
+
/*
|
24 |
+
* Most DTypes will have a singleton default instance, for the
|
25 |
+
* parametric legacy DTypes (bytes, string, void, datetime) this
|
26 |
+
* may be a pointer to the *prototype* instance?
|
27 |
+
*/
|
28 |
+
PyArray_Descr *singleton;
|
29 |
+
/* Copy of the legacy DTypes type number, usually invalid. */
|
30 |
+
int type_num;
|
31 |
+
|
32 |
+
/* The type object of the scalar instances (may be NULL?) */
|
33 |
+
PyTypeObject *scalar_type;
|
34 |
+
/*
|
35 |
+
* DType flags to signal legacy, parametric, or
|
36 |
+
* abstract. But plenty of space for additional information/flags.
|
37 |
+
*/
|
38 |
+
npy_uint64 flags;
|
39 |
+
|
40 |
+
/*
|
41 |
+
* Use indirection in order to allow a fixed size for this struct.
|
42 |
+
* A stable ABI size makes creating a static DType less painful
|
43 |
+
* while also ensuring flexibility for all opaque API (with one
|
44 |
+
* indirection due the pointer lookup).
|
45 |
+
*/
|
46 |
+
void *dt_slots;
|
47 |
+
/* Allow growing (at the moment also beyond this) */
|
48 |
+
void *reserved[3];
|
49 |
+
} PyArray_DTypeMeta;
|
50 |
+
|
51 |
+
#endif /* not internal build */
|
52 |
+
|
53 |
+
/*
|
54 |
+
* ******************************************************
|
55 |
+
* ArrayMethod API (Casting and UFuncs)
|
56 |
+
* ******************************************************
|
57 |
+
*/
|
58 |
+
/*
|
59 |
+
* NOTE: Expected changes:
|
60 |
+
* * probably split runtime and general flags into two
|
61 |
+
* * should possibly not use an enum for typedef for more stable ABI?
|
62 |
+
*/
|
63 |
+
typedef enum {
|
64 |
+
/* Flag for whether the GIL is required */
|
65 |
+
NPY_METH_REQUIRES_PYAPI = 1 << 0,
|
66 |
+
/*
|
67 |
+
* Some functions cannot set floating point error flags, this flag
|
68 |
+
* gives us the option (not requirement) to skip floating point error
|
69 |
+
* setup/check. No function should set error flags and ignore them
|
70 |
+
* since it would interfere with chaining operations (e.g. casting).
|
71 |
+
*/
|
72 |
+
NPY_METH_NO_FLOATINGPOINT_ERRORS = 1 << 1,
|
73 |
+
/* Whether the method supports unaligned access (not runtime) */
|
74 |
+
NPY_METH_SUPPORTS_UNALIGNED = 1 << 2,
|
75 |
+
/*
|
76 |
+
* Used for reductions to allow reordering the operation. At this point
|
77 |
+
* assume that if set, it also applies to normal operations though!
|
78 |
+
*/
|
79 |
+
NPY_METH_IS_REORDERABLE = 1 << 3,
|
80 |
+
/*
|
81 |
+
* Private flag for now for *logic* functions. The logical functions
|
82 |
+
* `logical_or` and `logical_and` can always cast the inputs to booleans
|
83 |
+
* "safely" (because that is how the cast to bool is defined).
|
84 |
+
* @seberg: I am not sure this is the best way to handle this, so its
|
85 |
+
* private for now (also it is very limited anyway).
|
86 |
+
* There is one "exception". NA aware dtypes cannot cast to bool
|
87 |
+
* (hopefully), so the `??->?` loop should error even with this flag.
|
88 |
+
* But a second NA fallback loop will be necessary.
|
89 |
+
*/
|
90 |
+
_NPY_METH_FORCE_CAST_INPUTS = 1 << 17,
|
91 |
+
|
92 |
+
/* All flags which can change at runtime */
|
93 |
+
NPY_METH_RUNTIME_FLAGS = (
|
94 |
+
NPY_METH_REQUIRES_PYAPI |
|
95 |
+
NPY_METH_NO_FLOATINGPOINT_ERRORS),
|
96 |
+
} NPY_ARRAYMETHOD_FLAGS;
|
97 |
+
|
98 |
+
|
99 |
+
typedef struct PyArrayMethod_Context_tag {
|
100 |
+
/* The caller, which is typically the original ufunc. May be NULL */
|
101 |
+
PyObject *caller;
|
102 |
+
/* The method "self". Publically currentl an opaque object. */
|
103 |
+
struct PyArrayMethodObject_tag *method;
|
104 |
+
|
105 |
+
/* Operand descriptors, filled in by resolve_descriptors */
|
106 |
+
PyArray_Descr **descriptors;
|
107 |
+
/* Structure may grow (this is harmless for DType authors) */
|
108 |
+
} PyArrayMethod_Context;
|
109 |
+
|
110 |
+
|
111 |
+
/*
|
112 |
+
* The main object for creating a new ArrayMethod. We use the typical `slots`
|
113 |
+
* mechanism used by the Python limited API (see below for the slot defs).
|
114 |
+
*/
|
115 |
+
typedef struct {
|
116 |
+
const char *name;
|
117 |
+
int nin, nout;
|
118 |
+
NPY_CASTING casting;
|
119 |
+
NPY_ARRAYMETHOD_FLAGS flags;
|
120 |
+
PyArray_DTypeMeta **dtypes;
|
121 |
+
PyType_Slot *slots;
|
122 |
+
} PyArrayMethod_Spec;
|
123 |
+
|
124 |
+
|
125 |
+
/*
|
126 |
+
* ArrayMethod slots
|
127 |
+
* -----------------
|
128 |
+
*
|
129 |
+
* SLOTS IDs For the ArrayMethod creation, once fully public, IDs are fixed
|
130 |
+
* but can be deprecated and arbitrarily extended.
|
131 |
+
*/
|
132 |
+
#define NPY_METH_resolve_descriptors 1
|
133 |
+
/* We may want to adapt the `get_loop` signature a bit: */
|
134 |
+
#define _NPY_METH_get_loop 2
|
135 |
+
#define NPY_METH_get_reduction_initial 3
|
136 |
+
/* specific loops for constructions/default get_loop: */
|
137 |
+
#define NPY_METH_strided_loop 4
|
138 |
+
#define NPY_METH_contiguous_loop 5
|
139 |
+
#define NPY_METH_unaligned_strided_loop 6
|
140 |
+
#define NPY_METH_unaligned_contiguous_loop 7
|
141 |
+
#define NPY_METH_contiguous_indexed_loop 8
|
142 |
+
|
143 |
+
/*
|
144 |
+
* The resolve descriptors function, must be able to handle NULL values for
|
145 |
+
* all output (but not input) `given_descrs` and fill `loop_descrs`.
|
146 |
+
* Return -1 on error or 0 if the operation is not possible without an error
|
147 |
+
* set. (This may still be in flux.)
|
148 |
+
* Otherwise must return the "casting safety", for normal functions, this is
|
149 |
+
* almost always "safe" (or even "equivalent"?).
|
150 |
+
*
|
151 |
+
* `resolve_descriptors` is optional if all output DTypes are non-parametric.
|
152 |
+
*/
|
153 |
+
typedef NPY_CASTING (resolve_descriptors_function)(
|
154 |
+
/* "method" is currently opaque (necessary e.g. to wrap Python) */
|
155 |
+
struct PyArrayMethodObject_tag *method,
|
156 |
+
/* DTypes the method was created for */
|
157 |
+
PyArray_DTypeMeta **dtypes,
|
158 |
+
/* Input descriptors (instances). Outputs may be NULL. */
|
159 |
+
PyArray_Descr **given_descrs,
|
160 |
+
/* Exact loop descriptors to use, must not hold references on error */
|
161 |
+
PyArray_Descr **loop_descrs,
|
162 |
+
npy_intp *view_offset);
|
163 |
+
|
164 |
+
|
165 |
+
typedef int (PyArrayMethod_StridedLoop)(PyArrayMethod_Context *context,
|
166 |
+
char *const *data, const npy_intp *dimensions, const npy_intp *strides,
|
167 |
+
NpyAuxData *transferdata);
|
168 |
+
|
169 |
+
|
170 |
+
typedef int (get_loop_function)(
|
171 |
+
PyArrayMethod_Context *context,
|
172 |
+
int aligned, int move_references,
|
173 |
+
const npy_intp *strides,
|
174 |
+
PyArrayMethod_StridedLoop **out_loop,
|
175 |
+
NpyAuxData **out_transferdata,
|
176 |
+
NPY_ARRAYMETHOD_FLAGS *flags);
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Query an ArrayMethod for the initial value for use in reduction.
|
180 |
+
*
|
181 |
+
* @param context The arraymethod context, mainly to access the descriptors.
|
182 |
+
* @param reduction_is_empty Whether the reduction is empty. When it is, the
|
183 |
+
* value returned may differ. In this case it is a "default" value that
|
184 |
+
* may differ from the "identity" value normally used. For example:
|
185 |
+
* - `0.0` is the default for `sum([])`. But `-0.0` is the correct
|
186 |
+
* identity otherwise as it preserves the sign for `sum([-0.0])`.
|
187 |
+
* - We use no identity for object, but return the default of `0` and `1`
|
188 |
+
* for the empty `sum([], dtype=object)` and `prod([], dtype=object)`.
|
189 |
+
* This allows `np.sum(np.array(["a", "b"], dtype=object))` to work.
|
190 |
+
* - `-inf` or `INT_MIN` for `max` is an identity, but at least `INT_MIN`
|
191 |
+
* not a good *default* when there are no items.
|
192 |
+
* @param initial Pointer to initial data to be filled (if possible)
|
193 |
+
*
|
194 |
+
* @returns -1, 0, or 1 indicating error, no initial value, and initial being
|
195 |
+
* successfully filled. Errors must not be given where 0 is correct, NumPy
|
196 |
+
* may call this even when not strictly necessary.
|
197 |
+
*/
|
198 |
+
typedef int (get_reduction_initial_function)(
|
199 |
+
PyArrayMethod_Context *context, npy_bool reduction_is_empty,
|
200 |
+
char *initial);
|
201 |
+
|
202 |
+
/*
|
203 |
+
* The following functions are only used by the wrapping array method defined
|
204 |
+
* in umath/wrapping_array_method.c
|
205 |
+
*/
|
206 |
+
|
207 |
+
/*
|
208 |
+
* The function to convert the given descriptors (passed in to
|
209 |
+
* `resolve_descriptors`) and translates them for the wrapped loop.
|
210 |
+
* The new descriptors MUST be viewable with the old ones, `NULL` must be
|
211 |
+
* supported (for outputs) and should normally be forwarded.
|
212 |
+
*
|
213 |
+
* The function must clean up on error.
|
214 |
+
*
|
215 |
+
* NOTE: We currently assume that this translation gives "viewable" results.
|
216 |
+
* I.e. there is no additional casting related to the wrapping process.
|
217 |
+
* In principle that could be supported, but not sure it is useful.
|
218 |
+
* This currently also means that e.g. alignment must apply identically
|
219 |
+
* to the new dtypes.
|
220 |
+
*
|
221 |
+
* TODO: Due to the fact that `resolve_descriptors` is also used for `can_cast`
|
222 |
+
* there is no way to "pass out" the result of this function. This means
|
223 |
+
* it will be called twice for every ufunc call.
|
224 |
+
* (I am considering including `auxdata` as an "optional" parameter to
|
225 |
+
* `resolve_descriptors`, so that it can be filled there if not NULL.)
|
226 |
+
*/
|
227 |
+
typedef int translate_given_descrs_func(int nin, int nout,
|
228 |
+
PyArray_DTypeMeta *wrapped_dtypes[],
|
229 |
+
PyArray_Descr *given_descrs[], PyArray_Descr *new_descrs[]);
|
230 |
+
|
231 |
+
/**
|
232 |
+
* The function to convert the actual loop descriptors (as returned by the
|
233 |
+
* original `resolve_descriptors` function) to the ones the output array
|
234 |
+
* should use.
|
235 |
+
* This function must return "viewable" types, it must not mutate them in any
|
236 |
+
* form that would break the inner-loop logic. Does not need to support NULL.
|
237 |
+
*
|
238 |
+
* The function must clean up on error.
|
239 |
+
*
|
240 |
+
* @param nargs Number of arguments
|
241 |
+
* @param new_dtypes The DTypes of the output (usually probably not needed)
|
242 |
+
* @param given_descrs Original given_descrs to the resolver, necessary to
|
243 |
+
* fetch any information related to the new dtypes from the original.
|
244 |
+
* @param original_descrs The `loop_descrs` returned by the wrapped loop.
|
245 |
+
* @param loop_descrs The output descriptors, compatible to `original_descrs`.
|
246 |
+
*
|
247 |
+
* @returns 0 on success, -1 on failure.
|
248 |
+
*/
|
249 |
+
typedef int translate_loop_descrs_func(int nin, int nout,
|
250 |
+
PyArray_DTypeMeta *new_dtypes[], PyArray_Descr *given_descrs[],
|
251 |
+
PyArray_Descr *original_descrs[], PyArray_Descr *loop_descrs[]);
|
252 |
+
|
253 |
+
|
254 |
+
/*
|
255 |
+
* A traverse loop working on a single array. This is similar to the general
|
256 |
+
* strided-loop function. This is designed for loops that need to visit every
|
257 |
+
* element of a single array.
|
258 |
+
*
|
259 |
+
* Currently this is used for array clearing, via the NPY_DT_get_clear_loop
|
260 |
+
* API hook, and zero-filling, via the NPY_DT_get_fill_zero_loop API hook.
|
261 |
+
* These are most useful for handling arrays storing embedded references to
|
262 |
+
* python objects or heap-allocated data.
|
263 |
+
*
|
264 |
+
* The `void *traverse_context` is passed in because we may need to pass in
|
265 |
+
* Intepreter state or similar in the future, but we don't want to pass in
|
266 |
+
* a full context (with pointers to dtypes, method, caller which all make
|
267 |
+
* no sense for a traverse function).
|
268 |
+
*
|
269 |
+
* We assume for now that this context can be just passed through in the
|
270 |
+
* the future (for structured dtypes).
|
271 |
+
*
|
272 |
+
*/
|
273 |
+
typedef int (traverse_loop_function)(
|
274 |
+
void *traverse_context, PyArray_Descr *descr, char *data,
|
275 |
+
npy_intp size, npy_intp stride, NpyAuxData *auxdata);
|
276 |
+
|
277 |
+
|
278 |
+
/*
|
279 |
+
* Simplified get_loop function specific to dtype traversal
|
280 |
+
*
|
281 |
+
* It should set the flags needed for the traversal loop and set out_loop to the
|
282 |
+
* loop function, which must be a valid traverse_loop_function
|
283 |
+
* pointer. Currently this is used for zero-filling and clearing arrays storing
|
284 |
+
* embedded references.
|
285 |
+
*
|
286 |
+
*/
|
287 |
+
typedef int (get_traverse_loop_function)(
|
288 |
+
void *traverse_context, PyArray_Descr *descr,
|
289 |
+
int aligned, npy_intp fixed_stride,
|
290 |
+
traverse_loop_function **out_loop, NpyAuxData **out_auxdata,
|
291 |
+
NPY_ARRAYMETHOD_FLAGS *flags);
|
292 |
+
|
293 |
+
|
294 |
+
/*
|
295 |
+
* ****************************
|
296 |
+
* DTYPE API
|
297 |
+
* ****************************
|
298 |
+
*/
|
299 |
+
|
300 |
+
#define NPY_DT_ABSTRACT 1 << 1
|
301 |
+
#define NPY_DT_PARAMETRIC 1 << 2
|
302 |
+
#define NPY_DT_NUMERIC 1 << 3
|
303 |
+
|
304 |
+
/*
|
305 |
+
* These correspond to slots in the NPY_DType_Slots struct and must
|
306 |
+
* be in the same order as the members of that struct. If new slots
|
307 |
+
* get added or old slots get removed NPY_NUM_DTYPE_SLOTS must also
|
308 |
+
* be updated
|
309 |
+
*/
|
310 |
+
|
311 |
+
#define NPY_DT_discover_descr_from_pyobject 1
|
312 |
+
// this slot is considered private because its API hasn't beed decided
|
313 |
+
#define _NPY_DT_is_known_scalar_type 2
|
314 |
+
#define NPY_DT_default_descr 3
|
315 |
+
#define NPY_DT_common_dtype 4
|
316 |
+
#define NPY_DT_common_instance 5
|
317 |
+
#define NPY_DT_ensure_canonical 6
|
318 |
+
#define NPY_DT_setitem 7
|
319 |
+
#define NPY_DT_getitem 8
|
320 |
+
#define NPY_DT_get_clear_loop 9
|
321 |
+
#define NPY_DT_get_fill_zero_loop 10
|
322 |
+
|
323 |
+
// These PyArray_ArrFunc slots will be deprecated and replaced eventually
|
324 |
+
// getitem and setitem can be defined as a performance optimization;
|
325 |
+
// by default the user dtypes call `legacy_getitem_using_DType` and
|
326 |
+
// `legacy_setitem_using_DType`, respectively. This functionality is
|
327 |
+
// only supported for basic NumPy DTypes.
|
328 |
+
|
329 |
+
|
330 |
+
// used to separate dtype slots from arrfuncs slots
|
331 |
+
// intended only for internal use but defined here for clarity
|
332 |
+
#define _NPY_DT_ARRFUNCS_OFFSET (1 << 10)
|
333 |
+
|
334 |
+
// Cast is disabled
|
335 |
+
// #define NPY_DT_PyArray_ArrFuncs_cast 0 + _NPY_DT_ARRFUNCS_OFFSET
|
336 |
+
|
337 |
+
#define NPY_DT_PyArray_ArrFuncs_getitem 1 + _NPY_DT_ARRFUNCS_OFFSET
|
338 |
+
#define NPY_DT_PyArray_ArrFuncs_setitem 2 + _NPY_DT_ARRFUNCS_OFFSET
|
339 |
+
|
340 |
+
#define NPY_DT_PyArray_ArrFuncs_copyswapn 3 + _NPY_DT_ARRFUNCS_OFFSET
|
341 |
+
#define NPY_DT_PyArray_ArrFuncs_copyswap 4 + _NPY_DT_ARRFUNCS_OFFSET
|
342 |
+
#define NPY_DT_PyArray_ArrFuncs_compare 5 + _NPY_DT_ARRFUNCS_OFFSET
|
343 |
+
#define NPY_DT_PyArray_ArrFuncs_argmax 6 + _NPY_DT_ARRFUNCS_OFFSET
|
344 |
+
#define NPY_DT_PyArray_ArrFuncs_dotfunc 7 + _NPY_DT_ARRFUNCS_OFFSET
|
345 |
+
#define NPY_DT_PyArray_ArrFuncs_scanfunc 8 + _NPY_DT_ARRFUNCS_OFFSET
|
346 |
+
#define NPY_DT_PyArray_ArrFuncs_fromstr 9 + _NPY_DT_ARRFUNCS_OFFSET
|
347 |
+
#define NPY_DT_PyArray_ArrFuncs_nonzero 10 + _NPY_DT_ARRFUNCS_OFFSET
|
348 |
+
#define NPY_DT_PyArray_ArrFuncs_fill 11 + _NPY_DT_ARRFUNCS_OFFSET
|
349 |
+
#define NPY_DT_PyArray_ArrFuncs_fillwithscalar 12 + _NPY_DT_ARRFUNCS_OFFSET
|
350 |
+
#define NPY_DT_PyArray_ArrFuncs_sort 13 + _NPY_DT_ARRFUNCS_OFFSET
|
351 |
+
#define NPY_DT_PyArray_ArrFuncs_argsort 14 + _NPY_DT_ARRFUNCS_OFFSET
|
352 |
+
|
353 |
+
// Casting related slots are disabled. See
|
354 |
+
// https://github.com/numpy/numpy/pull/23173#discussion_r1101098163
|
355 |
+
// #define NPY_DT_PyArray_ArrFuncs_castdict 15 + _NPY_DT_ARRFUNCS_OFFSET
|
356 |
+
// #define NPY_DT_PyArray_ArrFuncs_scalarkind 16 + _NPY_DT_ARRFUNCS_OFFSET
|
357 |
+
// #define NPY_DT_PyArray_ArrFuncs_cancastscalarkindto 17 + _NPY_DT_ARRFUNCS_OFFSET
|
358 |
+
// #define NPY_DT_PyArray_ArrFuncs_cancastto 18 + _NPY_DT_ARRFUNCS_OFFSET
|
359 |
+
|
360 |
+
// These are deprecated in NumPy 1.19, so are disabled here.
|
361 |
+
// #define NPY_DT_PyArray_ArrFuncs_fastclip 19 + _NPY_DT_ARRFUNCS_OFFSET
|
362 |
+
// #define NPY_DT_PyArray_ArrFuncs_fastputmask 20 + _NPY_DT_ARRFUNCS_OFFSET
|
363 |
+
// #define NPY_DT_PyArray_ArrFuncs_fasttake 21 + _NPY_DT_ARRFUNCS_OFFSET
|
364 |
+
#define NPY_DT_PyArray_ArrFuncs_argmin 22 + _NPY_DT_ARRFUNCS_OFFSET
|
365 |
+
|
366 |
+
// TODO: These slots probably still need some thought, and/or a way to "grow"?
|
367 |
+
typedef struct {
|
368 |
+
PyTypeObject *typeobj; /* type of python scalar or NULL */
|
369 |
+
int flags; /* flags, including parametric and abstract */
|
370 |
+
/* NULL terminated cast definitions. Use NULL for the newly created DType */
|
371 |
+
PyArrayMethod_Spec **casts;
|
372 |
+
PyType_Slot *slots;
|
373 |
+
/* Baseclass or NULL (will always subclass `np.dtype`) */
|
374 |
+
PyTypeObject *baseclass;
|
375 |
+
} PyArrayDTypeMeta_Spec;
|
376 |
+
|
377 |
+
|
378 |
+
typedef PyArray_Descr *(discover_descr_from_pyobject_function)(
|
379 |
+
PyArray_DTypeMeta *cls, PyObject *obj);
|
380 |
+
|
381 |
+
/*
|
382 |
+
* Before making this public, we should decide whether it should pass
|
383 |
+
* the type, or allow looking at the object. A possible use-case:
|
384 |
+
* `np.array(np.array([0]), dtype=np.ndarray)`
|
385 |
+
* Could consider arrays that are not `dtype=ndarray` "scalars".
|
386 |
+
*/
|
387 |
+
typedef int (is_known_scalar_type_function)(
|
388 |
+
PyArray_DTypeMeta *cls, PyTypeObject *obj);
|
389 |
+
|
390 |
+
typedef PyArray_Descr *(default_descr_function)(PyArray_DTypeMeta *cls);
|
391 |
+
typedef PyArray_DTypeMeta *(common_dtype_function)(
|
392 |
+
PyArray_DTypeMeta *dtype1, PyArray_DTypeMeta *dtype2);
|
393 |
+
typedef PyArray_Descr *(common_instance_function)(
|
394 |
+
PyArray_Descr *dtype1, PyArray_Descr *dtype2);
|
395 |
+
typedef PyArray_Descr *(ensure_canonical_function)(PyArray_Descr *dtype);
|
396 |
+
|
397 |
+
/*
|
398 |
+
* TODO: These two functions are currently only used for experimental DType
|
399 |
+
* API support. Their relation should be "reversed": NumPy should
|
400 |
+
* always use them internally.
|
401 |
+
* There are open points about "casting safety" though, e.g. setting
|
402 |
+
* elements is currently always unsafe.
|
403 |
+
*/
|
404 |
+
typedef int(setitemfunction)(PyArray_Descr *, PyObject *, char *);
|
405 |
+
typedef PyObject *(getitemfunction)(PyArray_Descr *, char *);
|
406 |
+
|
407 |
+
|
408 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY___DTYPE_API_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/_numpyconfig.h
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#define NPY_HAVE_ENDIAN_H 1
|
2 |
+
|
3 |
+
#define NPY_SIZEOF_SHORT 2
|
4 |
+
#define NPY_SIZEOF_INT 4
|
5 |
+
#define NPY_SIZEOF_LONG 8
|
6 |
+
#define NPY_SIZEOF_FLOAT 4
|
7 |
+
#define NPY_SIZEOF_COMPLEX_FLOAT 8
|
8 |
+
#define NPY_SIZEOF_DOUBLE 8
|
9 |
+
#define NPY_SIZEOF_COMPLEX_DOUBLE 16
|
10 |
+
#define NPY_SIZEOF_LONGDOUBLE 16
|
11 |
+
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
|
12 |
+
#define NPY_SIZEOF_PY_INTPTR_T 8
|
13 |
+
#define NPY_SIZEOF_OFF_T 8
|
14 |
+
#define NPY_SIZEOF_PY_LONG_LONG 8
|
15 |
+
#define NPY_SIZEOF_LONGLONG 8
|
16 |
+
|
17 |
+
#define NPY_USE_C99_COMPLEX 1
|
18 |
+
#define NPY_HAVE_COMPLEX_DOUBLE 1
|
19 |
+
#define NPY_HAVE_COMPLEX_FLOAT 1
|
20 |
+
#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
|
21 |
+
#define NPY_USE_C99_FORMATS 1
|
22 |
+
|
23 |
+
/* #undef NPY_NO_SIGNAL */
|
24 |
+
#define NPY_NO_SMP 0
|
25 |
+
|
26 |
+
#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
|
27 |
+
#define NPY_ABI_VERSION 0x01000009
|
28 |
+
#define NPY_API_VERSION 0x00000011
|
29 |
+
|
30 |
+
#ifndef __STDC_FORMAT_MACROS
|
31 |
+
#define __STDC_FORMAT_MACROS 1
|
32 |
+
#endif
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_
|
3 |
+
#define Py_ARRAYOBJECT_H
|
4 |
+
|
5 |
+
#include "ndarrayobject.h"
|
6 |
+
#include "npy_interrupt.h"
|
7 |
+
|
8 |
+
#ifdef NPY_NO_PREFIX
|
9 |
+
#include "noprefix.h"
|
10 |
+
#endif
|
11 |
+
|
12 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/arrayscalars.h
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_
|
3 |
+
|
4 |
+
#ifndef _MULTIARRAYMODULE
|
5 |
+
typedef struct {
|
6 |
+
PyObject_HEAD
|
7 |
+
npy_bool obval;
|
8 |
+
} PyBoolScalarObject;
|
9 |
+
#endif
|
10 |
+
|
11 |
+
|
12 |
+
typedef struct {
|
13 |
+
PyObject_HEAD
|
14 |
+
signed char obval;
|
15 |
+
} PyByteScalarObject;
|
16 |
+
|
17 |
+
|
18 |
+
typedef struct {
|
19 |
+
PyObject_HEAD
|
20 |
+
short obval;
|
21 |
+
} PyShortScalarObject;
|
22 |
+
|
23 |
+
|
24 |
+
typedef struct {
|
25 |
+
PyObject_HEAD
|
26 |
+
int obval;
|
27 |
+
} PyIntScalarObject;
|
28 |
+
|
29 |
+
|
30 |
+
typedef struct {
|
31 |
+
PyObject_HEAD
|
32 |
+
long obval;
|
33 |
+
} PyLongScalarObject;
|
34 |
+
|
35 |
+
|
36 |
+
typedef struct {
|
37 |
+
PyObject_HEAD
|
38 |
+
npy_longlong obval;
|
39 |
+
} PyLongLongScalarObject;
|
40 |
+
|
41 |
+
|
42 |
+
typedef struct {
|
43 |
+
PyObject_HEAD
|
44 |
+
unsigned char obval;
|
45 |
+
} PyUByteScalarObject;
|
46 |
+
|
47 |
+
|
48 |
+
typedef struct {
|
49 |
+
PyObject_HEAD
|
50 |
+
unsigned short obval;
|
51 |
+
} PyUShortScalarObject;
|
52 |
+
|
53 |
+
|
54 |
+
typedef struct {
|
55 |
+
PyObject_HEAD
|
56 |
+
unsigned int obval;
|
57 |
+
} PyUIntScalarObject;
|
58 |
+
|
59 |
+
|
60 |
+
typedef struct {
|
61 |
+
PyObject_HEAD
|
62 |
+
unsigned long obval;
|
63 |
+
} PyULongScalarObject;
|
64 |
+
|
65 |
+
|
66 |
+
typedef struct {
|
67 |
+
PyObject_HEAD
|
68 |
+
npy_ulonglong obval;
|
69 |
+
} PyULongLongScalarObject;
|
70 |
+
|
71 |
+
|
72 |
+
typedef struct {
|
73 |
+
PyObject_HEAD
|
74 |
+
npy_half obval;
|
75 |
+
} PyHalfScalarObject;
|
76 |
+
|
77 |
+
|
78 |
+
typedef struct {
|
79 |
+
PyObject_HEAD
|
80 |
+
float obval;
|
81 |
+
} PyFloatScalarObject;
|
82 |
+
|
83 |
+
|
84 |
+
typedef struct {
|
85 |
+
PyObject_HEAD
|
86 |
+
double obval;
|
87 |
+
} PyDoubleScalarObject;
|
88 |
+
|
89 |
+
|
90 |
+
typedef struct {
|
91 |
+
PyObject_HEAD
|
92 |
+
npy_longdouble obval;
|
93 |
+
} PyLongDoubleScalarObject;
|
94 |
+
|
95 |
+
|
96 |
+
typedef struct {
|
97 |
+
PyObject_HEAD
|
98 |
+
npy_cfloat obval;
|
99 |
+
} PyCFloatScalarObject;
|
100 |
+
|
101 |
+
|
102 |
+
typedef struct {
|
103 |
+
PyObject_HEAD
|
104 |
+
npy_cdouble obval;
|
105 |
+
} PyCDoubleScalarObject;
|
106 |
+
|
107 |
+
|
108 |
+
typedef struct {
|
109 |
+
PyObject_HEAD
|
110 |
+
npy_clongdouble obval;
|
111 |
+
} PyCLongDoubleScalarObject;
|
112 |
+
|
113 |
+
|
114 |
+
typedef struct {
|
115 |
+
PyObject_HEAD
|
116 |
+
PyObject * obval;
|
117 |
+
} PyObjectScalarObject;
|
118 |
+
|
119 |
+
typedef struct {
|
120 |
+
PyObject_HEAD
|
121 |
+
npy_datetime obval;
|
122 |
+
PyArray_DatetimeMetaData obmeta;
|
123 |
+
} PyDatetimeScalarObject;
|
124 |
+
|
125 |
+
typedef struct {
|
126 |
+
PyObject_HEAD
|
127 |
+
npy_timedelta obval;
|
128 |
+
PyArray_DatetimeMetaData obmeta;
|
129 |
+
} PyTimedeltaScalarObject;
|
130 |
+
|
131 |
+
|
132 |
+
typedef struct {
|
133 |
+
PyObject_HEAD
|
134 |
+
char obval;
|
135 |
+
} PyScalarObject;
|
136 |
+
|
137 |
+
#define PyStringScalarObject PyBytesObject
|
138 |
+
typedef struct {
|
139 |
+
/* note that the PyObject_HEAD macro lives right here */
|
140 |
+
PyUnicodeObject base;
|
141 |
+
Py_UCS4 *obval;
|
142 |
+
#if NPY_FEATURE_VERSION >= NPY_1_20_API_VERSION
|
143 |
+
char *buffer_fmt;
|
144 |
+
#endif
|
145 |
+
} PyUnicodeScalarObject;
|
146 |
+
|
147 |
+
|
148 |
+
typedef struct {
|
149 |
+
PyObject_VAR_HEAD
|
150 |
+
char *obval;
|
151 |
+
PyArray_Descr *descr;
|
152 |
+
int flags;
|
153 |
+
PyObject *base;
|
154 |
+
#if NPY_FEATURE_VERSION >= NPY_1_20_API_VERSION
|
155 |
+
void *_buffer_info; /* private buffer info, tagged to allow warning */
|
156 |
+
#endif
|
157 |
+
} PyVoidScalarObject;
|
158 |
+
|
159 |
+
/* Macros
|
160 |
+
Py<Cls><bitsize>ScalarObject
|
161 |
+
Py<Cls><bitsize>ArrType_Type
|
162 |
+
are defined in ndarrayobject.h
|
163 |
+
*/
|
164 |
+
|
165 |
+
#define PyArrayScalar_False ((PyObject *)(&(_PyArrayScalar_BoolValues[0])))
|
166 |
+
#define PyArrayScalar_True ((PyObject *)(&(_PyArrayScalar_BoolValues[1])))
|
167 |
+
#define PyArrayScalar_FromLong(i) \
|
168 |
+
((PyObject *)(&(_PyArrayScalar_BoolValues[((i)!=0)])))
|
169 |
+
#define PyArrayScalar_RETURN_BOOL_FROM_LONG(i) \
|
170 |
+
return Py_INCREF(PyArrayScalar_FromLong(i)), \
|
171 |
+
PyArrayScalar_FromLong(i)
|
172 |
+
#define PyArrayScalar_RETURN_FALSE \
|
173 |
+
return Py_INCREF(PyArrayScalar_False), \
|
174 |
+
PyArrayScalar_False
|
175 |
+
#define PyArrayScalar_RETURN_TRUE \
|
176 |
+
return Py_INCREF(PyArrayScalar_True), \
|
177 |
+
PyArrayScalar_True
|
178 |
+
|
179 |
+
#define PyArrayScalar_New(cls) \
|
180 |
+
Py##cls##ArrType_Type.tp_alloc(&Py##cls##ArrType_Type, 0)
|
181 |
+
#define PyArrayScalar_VAL(obj, cls) \
|
182 |
+
((Py##cls##ScalarObject *)obj)->obval
|
183 |
+
#define PyArrayScalar_ASSIGN(obj, cls, val) \
|
184 |
+
PyArrayScalar_VAL(obj, cls) = val
|
185 |
+
|
186 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/experimental_dtype_api.h
ADDED
@@ -0,0 +1,365 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* This header exports the new experimental DType API as proposed in
|
3 |
+
* NEPs 41 to 43. For background, please check these NEPs. Otherwise,
|
4 |
+
* this header also serves as documentation for the time being.
|
5 |
+
*
|
6 |
+
* The header includes `_dtype_api.h` which holds most definition while this
|
7 |
+
* header mainly wraps functions for public consumption.
|
8 |
+
*
|
9 |
+
* Please do not hesitate to contact @seberg with questions. This is
|
10 |
+
* developed together with https://github.com/seberg/experimental_user_dtypes
|
11 |
+
* and those interested in experimenting are encouraged to contribute there.
|
12 |
+
*
|
13 |
+
* To use the functions defined in the header, call::
|
14 |
+
*
|
15 |
+
* if (import_experimental_dtype_api(version) < 0) {
|
16 |
+
* return NULL;
|
17 |
+
* }
|
18 |
+
*
|
19 |
+
* in your module init. (A version mismatch will be reported, just update
|
20 |
+
* to the correct one, this will alert you of possible changes.)
|
21 |
+
*
|
22 |
+
* The following lists the main symbols currently exported. Please do not
|
23 |
+
* hesitate to ask for help or clarification:
|
24 |
+
*
|
25 |
+
* - PyUFunc_AddLoopFromSpec:
|
26 |
+
*
|
27 |
+
* Register a new loop for a ufunc. This uses the `PyArrayMethod_Spec`
|
28 |
+
* which must be filled in (see in-line comments).
|
29 |
+
*
|
30 |
+
* - PyUFunc_AddWrappingLoop:
|
31 |
+
*
|
32 |
+
* Register a new loop which reuses an existing one, but modifies the
|
33 |
+
* result dtypes. Please search the internal NumPy docs for more info
|
34 |
+
* at this point. (Used for physical units dtype.)
|
35 |
+
*
|
36 |
+
* - PyUFunc_AddPromoter:
|
37 |
+
*
|
38 |
+
* Register a new promoter for a ufunc. A promoter is a function stored
|
39 |
+
* in a PyCapsule (see in-line comments). It is passed the operation and
|
40 |
+
* requested DType signatures and can mutate it to attempt a new search
|
41 |
+
* for a matching loop/promoter.
|
42 |
+
* I.e. for Numba a promoter could even add the desired loop.
|
43 |
+
*
|
44 |
+
* - PyArrayInitDTypeMeta_FromSpec:
|
45 |
+
*
|
46 |
+
* Initialize a new DType. It must currently be a static Python C type
|
47 |
+
* that is declared as `PyArray_DTypeMeta` and not `PyTypeObject`.
|
48 |
+
* Further, it must subclass `np.dtype` and set its type to
|
49 |
+
* `PyArrayDTypeMeta_Type` (before calling `PyType_Read()`).
|
50 |
+
*
|
51 |
+
* - PyArray_CommonDType:
|
52 |
+
*
|
53 |
+
* Find the common-dtype ("promotion") for two DType classes. Similar
|
54 |
+
* to `np.result_type`, but works on the classes and not instances.
|
55 |
+
*
|
56 |
+
* - PyArray_PromoteDTypeSequence:
|
57 |
+
*
|
58 |
+
* Same as CommonDType, but works with an arbitrary number of DTypes.
|
59 |
+
* This function is smarter and can often return successful and unambiguous
|
60 |
+
* results when `common_dtype(common_dtype(dt1, dt2), dt3)` would
|
61 |
+
* depend on the operation order or fail. Nevertheless, DTypes should
|
62 |
+
* aim to ensure that their common-dtype implementation is associative
|
63 |
+
* and commutative! (Mainly, unsigned and signed integers are not.)
|
64 |
+
*
|
65 |
+
* For guaranteed consistent results DTypes must implement common-Dtype
|
66 |
+
* "transitively". If A promotes B and B promotes C, than A must generally
|
67 |
+
* also promote C; where "promotes" means implements the promotion.
|
68 |
+
* (There are some exceptions for abstract DTypes)
|
69 |
+
*
|
70 |
+
* - PyArray_GetDefaultDescr:
|
71 |
+
*
|
72 |
+
* Given a DType class, returns the default instance (descriptor).
|
73 |
+
* This is an inline function checking for `singleton` first and only
|
74 |
+
* calls the `default_descr` function if necessary.
|
75 |
+
*
|
76 |
+
* - PyArray_DoubleDType, etc.:
|
77 |
+
*
|
78 |
+
* Aliases to the DType classes for the builtin NumPy DTypes.
|
79 |
+
*
|
80 |
+
* WARNING
|
81 |
+
* =======
|
82 |
+
*
|
83 |
+
* By using this header, you understand that this is a fully experimental
|
84 |
+
* exposure. Details are expected to change, and some options may have no
|
85 |
+
* effect. (Please contact @seberg if you have questions!)
|
86 |
+
* If the exposure stops working, please file a bug report with NumPy.
|
87 |
+
* Further, a DType created using this API/header should still be expected
|
88 |
+
* to be incompatible with some functionality inside and outside of NumPy.
|
89 |
+
* In this case crashes must be expected. Please report any such problems
|
90 |
+
* so that they can be fixed before final exposure.
|
91 |
+
* Furthermore, expect missing checks for programming errors which the final
|
92 |
+
* API is expected to have.
|
93 |
+
*
|
94 |
+
* Symbols with a leading underscore are likely to not be included in the
|
95 |
+
* first public version, if these are central to your use-case, please let
|
96 |
+
* us know, so that we can reconsider.
|
97 |
+
*
|
98 |
+
* "Array-like" consumer API not yet under considerations
|
99 |
+
* ======================================================
|
100 |
+
*
|
101 |
+
* The new DType API is designed in a way to make it potentially useful for
|
102 |
+
* alternative "array-like" implementations. This will require careful
|
103 |
+
* exposure of details and functions and is not part of this experimental API.
|
104 |
+
*
|
105 |
+
* Brief (incompatibility) changelog
|
106 |
+
* =================================
|
107 |
+
*
|
108 |
+
* 2. None (only additions).
|
109 |
+
* 3. New `npy_intp *view_offset` argument for `resolve_descriptors`.
|
110 |
+
* This replaces the `NPY_CAST_IS_VIEW` flag. It can be set to 0 if the
|
111 |
+
* operation is a view, and is pre-initialized to `NPY_MIN_INTP` indicating
|
112 |
+
* that the operation is not a view.
|
113 |
+
*/
|
114 |
+
|
115 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_EXPERIMENTAL_DTYPE_API_H_
|
116 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_EXPERIMENTAL_DTYPE_API_H_
|
117 |
+
|
118 |
+
#include <Python.h>
|
119 |
+
#include "ndarraytypes.h"
|
120 |
+
#include "_dtype_api.h"
|
121 |
+
|
122 |
+
/*
|
123 |
+
* The contents of PyArrayMethodObject are currently opaque (is there a way
|
124 |
+
* good way to make them be `PyObject *`?)
|
125 |
+
*/
|
126 |
+
typedef struct PyArrayMethodObject_tag PyArrayMethodObject;
|
127 |
+
|
128 |
+
/*
|
129 |
+
* There must be a better way?! -- Oh well, this is experimental
|
130 |
+
* (my issue with it, is that I cannot undef those helpers).
|
131 |
+
*/
|
132 |
+
#if defined(PY_ARRAY_UNIQUE_SYMBOL)
|
133 |
+
#define NPY_EXP_DTYPE_API_CONCAT_HELPER2(x, y) x ## y
|
134 |
+
#define NPY_EXP_DTYPE_API_CONCAT_HELPER(arg) NPY_EXP_DTYPE_API_CONCAT_HELPER2(arg, __experimental_dtype_api_table)
|
135 |
+
#define __experimental_dtype_api_table NPY_EXP_DTYPE_API_CONCAT_HELPER(PY_ARRAY_UNIQUE_SYMBOL)
|
136 |
+
#else
|
137 |
+
#define __experimental_dtype_api_table __experimental_dtype_api_table
|
138 |
+
#endif
|
139 |
+
|
140 |
+
/* Support for correct multi-file projects: */
|
141 |
+
#if defined(NO_IMPORT) || defined(NO_IMPORT_ARRAY)
|
142 |
+
extern void **__experimental_dtype_api_table;
|
143 |
+
#else
|
144 |
+
/*
|
145 |
+
* Just a hack so I don't forget importing as much myself, I spend way too
|
146 |
+
* much time noticing it the first time around :).
|
147 |
+
*/
|
148 |
+
static void
|
149 |
+
__not_imported(void)
|
150 |
+
{
|
151 |
+
printf("*****\nCritical error, dtype API not imported\n*****\n");
|
152 |
+
}
|
153 |
+
|
154 |
+
static void *__uninitialized_table[] = {
|
155 |
+
&__not_imported, &__not_imported, &__not_imported, &__not_imported,
|
156 |
+
&__not_imported, &__not_imported, &__not_imported, &__not_imported};
|
157 |
+
|
158 |
+
#if defined(PY_ARRAY_UNIQUE_SYMBOL)
|
159 |
+
void **__experimental_dtype_api_table = __uninitialized_table;
|
160 |
+
#else
|
161 |
+
static void **__experimental_dtype_api_table = __uninitialized_table;
|
162 |
+
#endif
|
163 |
+
#endif
|
164 |
+
|
165 |
+
|
166 |
+
typedef int _ufunc_addloop_fromspec_func(
|
167 |
+
PyObject *ufunc, PyArrayMethod_Spec *spec);
|
168 |
+
/*
|
169 |
+
* The main ufunc registration function. This adds a new implementation/loop
|
170 |
+
* to a ufunc. It replaces `PyUFunc_RegisterLoopForType`.
|
171 |
+
*/
|
172 |
+
#define PyUFunc_AddLoopFromSpec \
|
173 |
+
(*(_ufunc_addloop_fromspec_func *)(__experimental_dtype_api_table[0]))
|
174 |
+
|
175 |
+
|
176 |
+
/* Please see the NumPy definitions in `array_method.h` for details on these */
|
177 |
+
typedef int translate_given_descrs_func(int nin, int nout,
|
178 |
+
PyArray_DTypeMeta *wrapped_dtypes[],
|
179 |
+
PyArray_Descr *given_descrs[], PyArray_Descr *new_descrs[]);
|
180 |
+
typedef int translate_loop_descrs_func(int nin, int nout,
|
181 |
+
PyArray_DTypeMeta *new_dtypes[], PyArray_Descr *given_descrs[],
|
182 |
+
PyArray_Descr *original_descrs[], PyArray_Descr *loop_descrs[]);
|
183 |
+
|
184 |
+
typedef int _ufunc_wrapping_loop_func(PyObject *ufunc_obj,
|
185 |
+
PyArray_DTypeMeta *new_dtypes[], PyArray_DTypeMeta *wrapped_dtypes[],
|
186 |
+
translate_given_descrs_func *translate_given_descrs,
|
187 |
+
translate_loop_descrs_func *translate_loop_descrs);
|
188 |
+
#define PyUFunc_AddWrappingLoop \
|
189 |
+
(*(_ufunc_wrapping_loop_func *)(__experimental_dtype_api_table[7]))
|
190 |
+
|
191 |
+
/*
|
192 |
+
* Type of the C promoter function, which must be wrapped into a
|
193 |
+
* PyCapsule with name "numpy._ufunc_promoter".
|
194 |
+
*
|
195 |
+
* Note that currently the output dtypes are always NULL unless they are
|
196 |
+
* also part of the signature. This is an implementation detail and could
|
197 |
+
* change in the future. However, in general promoters should not have a
|
198 |
+
* need for output dtypes.
|
199 |
+
* (There are potential use-cases, these are currently unsupported.)
|
200 |
+
*/
|
201 |
+
typedef int promoter_function(PyObject *ufunc,
|
202 |
+
PyArray_DTypeMeta *op_dtypes[], PyArray_DTypeMeta *signature[],
|
203 |
+
PyArray_DTypeMeta *new_op_dtypes[]);
|
204 |
+
|
205 |
+
/*
|
206 |
+
* Function to register a promoter.
|
207 |
+
*
|
208 |
+
* @param ufunc The ufunc object to register the promoter with.
|
209 |
+
* @param DType_tuple A Python tuple containing DTypes or None matching the
|
210 |
+
* number of inputs and outputs of the ufunc.
|
211 |
+
* @param promoter A PyCapsule with name "numpy._ufunc_promoter" containing
|
212 |
+
* a pointer to a `promoter_function`.
|
213 |
+
*/
|
214 |
+
typedef int _ufunc_addpromoter_func(
|
215 |
+
PyObject *ufunc, PyObject *DType_tuple, PyObject *promoter);
|
216 |
+
#define PyUFunc_AddPromoter \
|
217 |
+
(*(_ufunc_addpromoter_func *)(__experimental_dtype_api_table[1]))
|
218 |
+
|
219 |
+
#define PyArrayDTypeMeta_Type \
|
220 |
+
(*(PyTypeObject *)__experimental_dtype_api_table[2])
|
221 |
+
typedef int __dtypemeta_fromspec(
|
222 |
+
PyArray_DTypeMeta *DType, PyArrayDTypeMeta_Spec *dtype_spec);
|
223 |
+
/*
|
224 |
+
* Finalize creation of a DTypeMeta. You must ensure that the DTypeMeta is
|
225 |
+
* a proper subclass. The DTypeMeta object has additional fields compared to
|
226 |
+
* a normal PyTypeObject!
|
227 |
+
* The only (easy) creation of a new DType is to create a static Type which
|
228 |
+
* inherits `PyArray_DescrType`, sets its type to `PyArrayDTypeMeta_Type` and
|
229 |
+
* uses `PyArray_DTypeMeta` defined above as the C-structure.
|
230 |
+
*/
|
231 |
+
#define PyArrayInitDTypeMeta_FromSpec \
|
232 |
+
((__dtypemeta_fromspec *)(__experimental_dtype_api_table[3]))
|
233 |
+
|
234 |
+
|
235 |
+
/*
|
236 |
+
* *************************************
|
237 |
+
* WORKING WITH DTYPES
|
238 |
+
* *************************************
|
239 |
+
*/
|
240 |
+
|
241 |
+
typedef PyArray_DTypeMeta *__common_dtype(
|
242 |
+
PyArray_DTypeMeta *DType1, PyArray_DTypeMeta *DType2);
|
243 |
+
#define PyArray_CommonDType \
|
244 |
+
((__common_dtype *)(__experimental_dtype_api_table[4]))
|
245 |
+
|
246 |
+
|
247 |
+
typedef PyArray_DTypeMeta *__promote_dtype_sequence(
|
248 |
+
npy_intp num, PyArray_DTypeMeta *DTypes[]);
|
249 |
+
#define PyArray_PromoteDTypeSequence \
|
250 |
+
((__promote_dtype_sequence *)(__experimental_dtype_api_table[5]))
|
251 |
+
|
252 |
+
|
253 |
+
typedef PyArray_Descr *__get_default_descr(
|
254 |
+
PyArray_DTypeMeta *DType);
|
255 |
+
#define _PyArray_GetDefaultDescr \
|
256 |
+
((__get_default_descr *)(__experimental_dtype_api_table[6]))
|
257 |
+
|
258 |
+
static inline PyArray_Descr *
|
259 |
+
PyArray_GetDefaultDescr(PyArray_DTypeMeta *DType)
|
260 |
+
{
|
261 |
+
if (DType->singleton != NULL) {
|
262 |
+
Py_INCREF(DType->singleton);
|
263 |
+
return DType->singleton;
|
264 |
+
}
|
265 |
+
return _PyArray_GetDefaultDescr(DType);
|
266 |
+
}
|
267 |
+
|
268 |
+
|
269 |
+
/*
|
270 |
+
* NumPy's builtin DTypes:
|
271 |
+
*/
|
272 |
+
#define PyArray_BoolDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[10])
|
273 |
+
/* Integers */
|
274 |
+
#define PyArray_ByteDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[11])
|
275 |
+
#define PyArray_UByteDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[12])
|
276 |
+
#define PyArray_ShortDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[13])
|
277 |
+
#define PyArray_UShortDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[14])
|
278 |
+
#define PyArray_IntDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[15])
|
279 |
+
#define PyArray_UIntDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[16])
|
280 |
+
#define PyArray_LongDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[17])
|
281 |
+
#define PyArray_ULongDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[18])
|
282 |
+
#define PyArray_LongLongDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[19])
|
283 |
+
#define PyArray_ULongLongDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[20])
|
284 |
+
/* Integer aliases */
|
285 |
+
#define PyArray_Int8Type (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[21])
|
286 |
+
#define PyArray_UInt8DType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[22])
|
287 |
+
#define PyArray_Int16DType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[23])
|
288 |
+
#define PyArray_UInt16DType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[24])
|
289 |
+
#define PyArray_Int32DType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[25])
|
290 |
+
#define PyArray_UInt32DType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[26])
|
291 |
+
#define PyArray_Int64DType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[27])
|
292 |
+
#define PyArray_UInt64DType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[28])
|
293 |
+
#define PyArray_IntpDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[29])
|
294 |
+
#define PyArray_UIntpDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[30])
|
295 |
+
/* Floats */
|
296 |
+
#define PyArray_HalfType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[31])
|
297 |
+
#define PyArray_FloatDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[32])
|
298 |
+
#define PyArray_DoubleDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[33])
|
299 |
+
#define PyArray_LongDoubleDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[34])
|
300 |
+
/* Complex */
|
301 |
+
#define PyArray_CFloatDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[35])
|
302 |
+
#define PyArray_CDoubleDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[36])
|
303 |
+
#define PyArray_CLongDoubleDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[37])
|
304 |
+
/* String/Bytes */
|
305 |
+
#define PyArray_StringDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[38])
|
306 |
+
#define PyArray_UnicodeDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[39])
|
307 |
+
/* Datetime/Timedelta */
|
308 |
+
#define PyArray_DatetimeDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[40])
|
309 |
+
#define PyArray_TimedeltaDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[41])
|
310 |
+
/* Object/Void */
|
311 |
+
#define PyArray_ObjectDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[42])
|
312 |
+
#define PyArray_VoidDType (*(PyArray_DTypeMeta *)__experimental_dtype_api_table[43])
|
313 |
+
|
314 |
+
/*
|
315 |
+
* ********************************
|
316 |
+
* Initialization
|
317 |
+
* ********************************
|
318 |
+
*
|
319 |
+
* Import the experimental API, the version must match the one defined in
|
320 |
+
* the header to ensure changes are taken into account. NumPy will further
|
321 |
+
* runtime-check this.
|
322 |
+
* You must call this function to use the symbols defined in this file.
|
323 |
+
*/
|
324 |
+
#if !defined(NO_IMPORT) && !defined(NO_IMPORT_ARRAY)
|
325 |
+
|
326 |
+
static int
|
327 |
+
import_experimental_dtype_api(int version)
|
328 |
+
{
|
329 |
+
if (version != __EXPERIMENTAL_DTYPE_API_VERSION) {
|
330 |
+
PyErr_Format(PyExc_RuntimeError,
|
331 |
+
"DType API version %d did not match header version %d. Please "
|
332 |
+
"update the import statement and check for API changes.",
|
333 |
+
version, __EXPERIMENTAL_DTYPE_API_VERSION);
|
334 |
+
return -1;
|
335 |
+
}
|
336 |
+
if (__experimental_dtype_api_table != __uninitialized_table) {
|
337 |
+
/* already imported. */
|
338 |
+
return 0;
|
339 |
+
}
|
340 |
+
|
341 |
+
PyObject *multiarray = PyImport_ImportModule("numpy.core._multiarray_umath");
|
342 |
+
if (multiarray == NULL) {
|
343 |
+
return -1;
|
344 |
+
}
|
345 |
+
|
346 |
+
PyObject *api = PyObject_CallMethod(multiarray,
|
347 |
+
"_get_experimental_dtype_api", "i", version);
|
348 |
+
Py_DECREF(multiarray);
|
349 |
+
if (api == NULL) {
|
350 |
+
return -1;
|
351 |
+
}
|
352 |
+
__experimental_dtype_api_table = (void **)PyCapsule_GetPointer(api,
|
353 |
+
"experimental_dtype_api_table");
|
354 |
+
Py_DECREF(api);
|
355 |
+
|
356 |
+
if (__experimental_dtype_api_table == NULL) {
|
357 |
+
__experimental_dtype_api_table = __uninitialized_table;
|
358 |
+
return -1;
|
359 |
+
}
|
360 |
+
return 0;
|
361 |
+
}
|
362 |
+
|
363 |
+
#endif /* !defined(NO_IMPORT) && !defined(NO_IMPORT_ARRAY) */
|
364 |
+
|
365 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_EXPERIMENTAL_DTYPE_API_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/halffloat.h
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_
|
3 |
+
|
4 |
+
#include <Python.h>
|
5 |
+
#include <numpy/npy_math.h>
|
6 |
+
|
7 |
+
#ifdef __cplusplus
|
8 |
+
extern "C" {
|
9 |
+
#endif
|
10 |
+
|
11 |
+
/*
|
12 |
+
* Half-precision routines
|
13 |
+
*/
|
14 |
+
|
15 |
+
/* Conversions */
|
16 |
+
float npy_half_to_float(npy_half h);
|
17 |
+
double npy_half_to_double(npy_half h);
|
18 |
+
npy_half npy_float_to_half(float f);
|
19 |
+
npy_half npy_double_to_half(double d);
|
20 |
+
/* Comparisons */
|
21 |
+
int npy_half_eq(npy_half h1, npy_half h2);
|
22 |
+
int npy_half_ne(npy_half h1, npy_half h2);
|
23 |
+
int npy_half_le(npy_half h1, npy_half h2);
|
24 |
+
int npy_half_lt(npy_half h1, npy_half h2);
|
25 |
+
int npy_half_ge(npy_half h1, npy_half h2);
|
26 |
+
int npy_half_gt(npy_half h1, npy_half h2);
|
27 |
+
/* faster *_nonan variants for when you know h1 and h2 are not NaN */
|
28 |
+
int npy_half_eq_nonan(npy_half h1, npy_half h2);
|
29 |
+
int npy_half_lt_nonan(npy_half h1, npy_half h2);
|
30 |
+
int npy_half_le_nonan(npy_half h1, npy_half h2);
|
31 |
+
/* Miscellaneous functions */
|
32 |
+
int npy_half_iszero(npy_half h);
|
33 |
+
int npy_half_isnan(npy_half h);
|
34 |
+
int npy_half_isinf(npy_half h);
|
35 |
+
int npy_half_isfinite(npy_half h);
|
36 |
+
int npy_half_signbit(npy_half h);
|
37 |
+
npy_half npy_half_copysign(npy_half x, npy_half y);
|
38 |
+
npy_half npy_half_spacing(npy_half h);
|
39 |
+
npy_half npy_half_nextafter(npy_half x, npy_half y);
|
40 |
+
npy_half npy_half_divmod(npy_half x, npy_half y, npy_half *modulus);
|
41 |
+
|
42 |
+
/*
|
43 |
+
* Half-precision constants
|
44 |
+
*/
|
45 |
+
|
46 |
+
#define NPY_HALF_ZERO (0x0000u)
|
47 |
+
#define NPY_HALF_PZERO (0x0000u)
|
48 |
+
#define NPY_HALF_NZERO (0x8000u)
|
49 |
+
#define NPY_HALF_ONE (0x3c00u)
|
50 |
+
#define NPY_HALF_NEGONE (0xbc00u)
|
51 |
+
#define NPY_HALF_PINF (0x7c00u)
|
52 |
+
#define NPY_HALF_NINF (0xfc00u)
|
53 |
+
#define NPY_HALF_NAN (0x7e00u)
|
54 |
+
|
55 |
+
#define NPY_MAX_HALF (0x7bffu)
|
56 |
+
|
57 |
+
/*
|
58 |
+
* Bit-level conversions
|
59 |
+
*/
|
60 |
+
|
61 |
+
npy_uint16 npy_floatbits_to_halfbits(npy_uint32 f);
|
62 |
+
npy_uint16 npy_doublebits_to_halfbits(npy_uint64 d);
|
63 |
+
npy_uint32 npy_halfbits_to_floatbits(npy_uint16 h);
|
64 |
+
npy_uint64 npy_halfbits_to_doublebits(npy_uint16 h);
|
65 |
+
|
66 |
+
#ifdef __cplusplus
|
67 |
+
}
|
68 |
+
#endif
|
69 |
+
|
70 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h
ADDED
@@ -0,0 +1,251 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* DON'T INCLUDE THIS DIRECTLY.
|
3 |
+
*/
|
4 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NDARRAYOBJECT_H_
|
5 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_NDARRAYOBJECT_H_
|
6 |
+
|
7 |
+
#ifdef __cplusplus
|
8 |
+
extern "C" {
|
9 |
+
#endif
|
10 |
+
|
11 |
+
#include <Python.h>
|
12 |
+
#include "ndarraytypes.h"
|
13 |
+
|
14 |
+
/* Includes the "function" C-API -- these are all stored in a
|
15 |
+
list of pointers --- one for each file
|
16 |
+
The two lists are concatenated into one in multiarray.
|
17 |
+
|
18 |
+
They are available as import_array()
|
19 |
+
*/
|
20 |
+
|
21 |
+
#include "__multiarray_api.h"
|
22 |
+
|
23 |
+
|
24 |
+
/* C-API that requires previous API to be defined */
|
25 |
+
|
26 |
+
#define PyArray_DescrCheck(op) PyObject_TypeCheck(op, &PyArrayDescr_Type)
|
27 |
+
|
28 |
+
#define PyArray_Check(op) PyObject_TypeCheck(op, &PyArray_Type)
|
29 |
+
#define PyArray_CheckExact(op) (((PyObject*)(op))->ob_type == &PyArray_Type)
|
30 |
+
|
31 |
+
#define PyArray_HasArrayInterfaceType(op, type, context, out) \
|
32 |
+
((((out)=PyArray_FromStructInterface(op)) != Py_NotImplemented) || \
|
33 |
+
(((out)=PyArray_FromInterface(op)) != Py_NotImplemented) || \
|
34 |
+
(((out)=PyArray_FromArrayAttr(op, type, context)) != \
|
35 |
+
Py_NotImplemented))
|
36 |
+
|
37 |
+
#define PyArray_HasArrayInterface(op, out) \
|
38 |
+
PyArray_HasArrayInterfaceType(op, NULL, NULL, out)
|
39 |
+
|
40 |
+
#define PyArray_IsZeroDim(op) (PyArray_Check(op) && \
|
41 |
+
(PyArray_NDIM((PyArrayObject *)op) == 0))
|
42 |
+
|
43 |
+
#define PyArray_IsScalar(obj, cls) \
|
44 |
+
(PyObject_TypeCheck(obj, &Py##cls##ArrType_Type))
|
45 |
+
|
46 |
+
#define PyArray_CheckScalar(m) (PyArray_IsScalar(m, Generic) || \
|
47 |
+
PyArray_IsZeroDim(m))
|
48 |
+
#define PyArray_IsPythonNumber(obj) \
|
49 |
+
(PyFloat_Check(obj) || PyComplex_Check(obj) || \
|
50 |
+
PyLong_Check(obj) || PyBool_Check(obj))
|
51 |
+
#define PyArray_IsIntegerScalar(obj) (PyLong_Check(obj) \
|
52 |
+
|| PyArray_IsScalar((obj), Integer))
|
53 |
+
#define PyArray_IsPythonScalar(obj) \
|
54 |
+
(PyArray_IsPythonNumber(obj) || PyBytes_Check(obj) || \
|
55 |
+
PyUnicode_Check(obj))
|
56 |
+
|
57 |
+
#define PyArray_IsAnyScalar(obj) \
|
58 |
+
(PyArray_IsScalar(obj, Generic) || PyArray_IsPythonScalar(obj))
|
59 |
+
|
60 |
+
#define PyArray_CheckAnyScalar(obj) (PyArray_IsPythonScalar(obj) || \
|
61 |
+
PyArray_CheckScalar(obj))
|
62 |
+
|
63 |
+
|
64 |
+
#define PyArray_GETCONTIGUOUS(m) (PyArray_ISCONTIGUOUS(m) ? \
|
65 |
+
Py_INCREF(m), (m) : \
|
66 |
+
(PyArrayObject *)(PyArray_Copy(m)))
|
67 |
+
|
68 |
+
#define PyArray_SAMESHAPE(a1,a2) ((PyArray_NDIM(a1) == PyArray_NDIM(a2)) && \
|
69 |
+
PyArray_CompareLists(PyArray_DIMS(a1), \
|
70 |
+
PyArray_DIMS(a2), \
|
71 |
+
PyArray_NDIM(a1)))
|
72 |
+
|
73 |
+
#define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m))
|
74 |
+
#define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m))
|
75 |
+
#define PyArray_FROM_O(m) PyArray_FromAny(m, NULL, 0, 0, 0, NULL)
|
76 |
+
|
77 |
+
#define PyArray_FROM_OF(m,flags) PyArray_CheckFromAny(m, NULL, 0, 0, flags, \
|
78 |
+
NULL)
|
79 |
+
|
80 |
+
#define PyArray_FROM_OT(m,type) PyArray_FromAny(m, \
|
81 |
+
PyArray_DescrFromType(type), 0, 0, 0, NULL)
|
82 |
+
|
83 |
+
#define PyArray_FROM_OTF(m, type, flags) \
|
84 |
+
PyArray_FromAny(m, PyArray_DescrFromType(type), 0, 0, \
|
85 |
+
(((flags) & NPY_ARRAY_ENSURECOPY) ? \
|
86 |
+
((flags) | NPY_ARRAY_DEFAULT) : (flags)), NULL)
|
87 |
+
|
88 |
+
#define PyArray_FROMANY(m, type, min, max, flags) \
|
89 |
+
PyArray_FromAny(m, PyArray_DescrFromType(type), min, max, \
|
90 |
+
(((flags) & NPY_ARRAY_ENSURECOPY) ? \
|
91 |
+
(flags) | NPY_ARRAY_DEFAULT : (flags)), NULL)
|
92 |
+
|
93 |
+
#define PyArray_ZEROS(m, dims, type, is_f_order) \
|
94 |
+
PyArray_Zeros(m, dims, PyArray_DescrFromType(type), is_f_order)
|
95 |
+
|
96 |
+
#define PyArray_EMPTY(m, dims, type, is_f_order) \
|
97 |
+
PyArray_Empty(m, dims, PyArray_DescrFromType(type), is_f_order)
|
98 |
+
|
99 |
+
#define PyArray_FILLWBYTE(obj, val) memset(PyArray_DATA(obj), val, \
|
100 |
+
PyArray_NBYTES(obj))
|
101 |
+
#ifndef PYPY_VERSION
|
102 |
+
#define PyArray_REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)
|
103 |
+
#define NPY_REFCOUNT PyArray_REFCOUNT
|
104 |
+
#endif
|
105 |
+
#define NPY_MAX_ELSIZE (2 * NPY_SIZEOF_LONGDOUBLE)
|
106 |
+
|
107 |
+
#define PyArray_ContiguousFromAny(op, type, min_depth, max_depth) \
|
108 |
+
PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \
|
109 |
+
max_depth, NPY_ARRAY_DEFAULT, NULL)
|
110 |
+
|
111 |
+
#define PyArray_EquivArrTypes(a1, a2) \
|
112 |
+
PyArray_EquivTypes(PyArray_DESCR(a1), PyArray_DESCR(a2))
|
113 |
+
|
114 |
+
#define PyArray_EquivByteorders(b1, b2) \
|
115 |
+
(((b1) == (b2)) || (PyArray_ISNBO(b1) == PyArray_ISNBO(b2)))
|
116 |
+
|
117 |
+
#define PyArray_SimpleNew(nd, dims, typenum) \
|
118 |
+
PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, NULL, 0, 0, NULL)
|
119 |
+
|
120 |
+
#define PyArray_SimpleNewFromData(nd, dims, typenum, data) \
|
121 |
+
PyArray_New(&PyArray_Type, nd, dims, typenum, NULL, \
|
122 |
+
data, 0, NPY_ARRAY_CARRAY, NULL)
|
123 |
+
|
124 |
+
#define PyArray_SimpleNewFromDescr(nd, dims, descr) \
|
125 |
+
PyArray_NewFromDescr(&PyArray_Type, descr, nd, dims, \
|
126 |
+
NULL, NULL, 0, NULL)
|
127 |
+
|
128 |
+
#define PyArray_ToScalar(data, arr) \
|
129 |
+
PyArray_Scalar(data, PyArray_DESCR(arr), (PyObject *)arr)
|
130 |
+
|
131 |
+
|
132 |
+
/* These might be faster without the dereferencing of obj
|
133 |
+
going on inside -- of course an optimizing compiler should
|
134 |
+
inline the constants inside a for loop making it a moot point
|
135 |
+
*/
|
136 |
+
|
137 |
+
#define PyArray_GETPTR1(obj, i) ((void *)(PyArray_BYTES(obj) + \
|
138 |
+
(i)*PyArray_STRIDES(obj)[0]))
|
139 |
+
|
140 |
+
#define PyArray_GETPTR2(obj, i, j) ((void *)(PyArray_BYTES(obj) + \
|
141 |
+
(i)*PyArray_STRIDES(obj)[0] + \
|
142 |
+
(j)*PyArray_STRIDES(obj)[1]))
|
143 |
+
|
144 |
+
#define PyArray_GETPTR3(obj, i, j, k) ((void *)(PyArray_BYTES(obj) + \
|
145 |
+
(i)*PyArray_STRIDES(obj)[0] + \
|
146 |
+
(j)*PyArray_STRIDES(obj)[1] + \
|
147 |
+
(k)*PyArray_STRIDES(obj)[2]))
|
148 |
+
|
149 |
+
#define PyArray_GETPTR4(obj, i, j, k, l) ((void *)(PyArray_BYTES(obj) + \
|
150 |
+
(i)*PyArray_STRIDES(obj)[0] + \
|
151 |
+
(j)*PyArray_STRIDES(obj)[1] + \
|
152 |
+
(k)*PyArray_STRIDES(obj)[2] + \
|
153 |
+
(l)*PyArray_STRIDES(obj)[3]))
|
154 |
+
|
155 |
+
static inline void
|
156 |
+
PyArray_DiscardWritebackIfCopy(PyArrayObject *arr)
|
157 |
+
{
|
158 |
+
PyArrayObject_fields *fa = (PyArrayObject_fields *)arr;
|
159 |
+
if (fa && fa->base) {
|
160 |
+
if (fa->flags & NPY_ARRAY_WRITEBACKIFCOPY) {
|
161 |
+
PyArray_ENABLEFLAGS((PyArrayObject*)fa->base, NPY_ARRAY_WRITEABLE);
|
162 |
+
Py_DECREF(fa->base);
|
163 |
+
fa->base = NULL;
|
164 |
+
PyArray_CLEARFLAGS(arr, NPY_ARRAY_WRITEBACKIFCOPY);
|
165 |
+
}
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
#define PyArray_DESCR_REPLACE(descr) do { \
|
170 |
+
PyArray_Descr *_new_; \
|
171 |
+
_new_ = PyArray_DescrNew(descr); \
|
172 |
+
Py_XDECREF(descr); \
|
173 |
+
descr = _new_; \
|
174 |
+
} while(0)
|
175 |
+
|
176 |
+
/* Copy should always return contiguous array */
|
177 |
+
#define PyArray_Copy(obj) PyArray_NewCopy(obj, NPY_CORDER)
|
178 |
+
|
179 |
+
#define PyArray_FromObject(op, type, min_depth, max_depth) \
|
180 |
+
PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \
|
181 |
+
max_depth, NPY_ARRAY_BEHAVED | \
|
182 |
+
NPY_ARRAY_ENSUREARRAY, NULL)
|
183 |
+
|
184 |
+
#define PyArray_ContiguousFromObject(op, type, min_depth, max_depth) \
|
185 |
+
PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \
|
186 |
+
max_depth, NPY_ARRAY_DEFAULT | \
|
187 |
+
NPY_ARRAY_ENSUREARRAY, NULL)
|
188 |
+
|
189 |
+
#define PyArray_CopyFromObject(op, type, min_depth, max_depth) \
|
190 |
+
PyArray_FromAny(op, PyArray_DescrFromType(type), min_depth, \
|
191 |
+
max_depth, NPY_ARRAY_ENSURECOPY | \
|
192 |
+
NPY_ARRAY_DEFAULT | \
|
193 |
+
NPY_ARRAY_ENSUREARRAY, NULL)
|
194 |
+
|
195 |
+
#define PyArray_Cast(mp, type_num) \
|
196 |
+
PyArray_CastToType(mp, PyArray_DescrFromType(type_num), 0)
|
197 |
+
|
198 |
+
#define PyArray_Take(ap, items, axis) \
|
199 |
+
PyArray_TakeFrom(ap, items, axis, NULL, NPY_RAISE)
|
200 |
+
|
201 |
+
#define PyArray_Put(ap, items, values) \
|
202 |
+
PyArray_PutTo(ap, items, values, NPY_RAISE)
|
203 |
+
|
204 |
+
/* Compatibility with old Numeric stuff -- don't use in new code */
|
205 |
+
|
206 |
+
#define PyArray_FromDimsAndData(nd, d, type, data) \
|
207 |
+
PyArray_FromDimsAndDataAndDescr(nd, d, PyArray_DescrFromType(type), \
|
208 |
+
data)
|
209 |
+
|
210 |
+
|
211 |
+
/*
|
212 |
+
Check to see if this key in the dictionary is the "title"
|
213 |
+
entry of the tuple (i.e. a duplicate dictionary entry in the fields
|
214 |
+
dict).
|
215 |
+
*/
|
216 |
+
|
217 |
+
static inline int
|
218 |
+
NPY_TITLE_KEY_check(PyObject *key, PyObject *value)
|
219 |
+
{
|
220 |
+
PyObject *title;
|
221 |
+
if (PyTuple_Size(value) != 3) {
|
222 |
+
return 0;
|
223 |
+
}
|
224 |
+
title = PyTuple_GetItem(value, 2);
|
225 |
+
if (key == title) {
|
226 |
+
return 1;
|
227 |
+
}
|
228 |
+
#ifdef PYPY_VERSION
|
229 |
+
/*
|
230 |
+
* On PyPy, dictionary keys do not always preserve object identity.
|
231 |
+
* Fall back to comparison by value.
|
232 |
+
*/
|
233 |
+
if (PyUnicode_Check(title) && PyUnicode_Check(key)) {
|
234 |
+
return PyUnicode_Compare(title, key) == 0 ? 1 : 0;
|
235 |
+
}
|
236 |
+
#endif
|
237 |
+
return 0;
|
238 |
+
}
|
239 |
+
|
240 |
+
/* Macro, for backward compat with "if NPY_TITLE_KEY(key, value) { ..." */
|
241 |
+
#define NPY_TITLE_KEY(key, value) (NPY_TITLE_KEY_check((key), (value)))
|
242 |
+
|
243 |
+
#define DEPRECATE(msg) PyErr_WarnEx(PyExc_DeprecationWarning,msg,1)
|
244 |
+
#define DEPRECATE_FUTUREWARNING(msg) PyErr_WarnEx(PyExc_FutureWarning,msg,1)
|
245 |
+
|
246 |
+
#ifdef __cplusplus
|
247 |
+
}
|
248 |
+
#endif
|
249 |
+
|
250 |
+
|
251 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_NDARRAYOBJECT_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h
ADDED
@@ -0,0 +1,1945 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_
|
3 |
+
|
4 |
+
#include "npy_common.h"
|
5 |
+
#include "npy_endian.h"
|
6 |
+
#include "npy_cpu.h"
|
7 |
+
#include "utils.h"
|
8 |
+
|
9 |
+
#define NPY_NO_EXPORT NPY_VISIBILITY_HIDDEN
|
10 |
+
|
11 |
+
/* Only use thread if configured in config and python supports it */
|
12 |
+
#if defined WITH_THREAD && !NPY_NO_SMP
|
13 |
+
#define NPY_ALLOW_THREADS 1
|
14 |
+
#else
|
15 |
+
#define NPY_ALLOW_THREADS 0
|
16 |
+
#endif
|
17 |
+
|
18 |
+
#ifndef __has_extension
|
19 |
+
#define __has_extension(x) 0
|
20 |
+
#endif
|
21 |
+
|
22 |
+
#if !defined(_NPY_NO_DEPRECATIONS) && \
|
23 |
+
((defined(__GNUC__)&& __GNUC__ >= 6) || \
|
24 |
+
__has_extension(attribute_deprecated_with_message))
|
25 |
+
#define NPY_ATTR_DEPRECATE(text) __attribute__ ((deprecated (text)))
|
26 |
+
#else
|
27 |
+
#define NPY_ATTR_DEPRECATE(text)
|
28 |
+
#endif
|
29 |
+
|
30 |
+
/*
|
31 |
+
* There are several places in the code where an array of dimensions
|
32 |
+
* is allocated statically. This is the size of that static
|
33 |
+
* allocation.
|
34 |
+
*
|
35 |
+
* The array creation itself could have arbitrary dimensions but all
|
36 |
+
* the places where static allocation is used would need to be changed
|
37 |
+
* to dynamic (including inside of several structures)
|
38 |
+
*/
|
39 |
+
|
40 |
+
#define NPY_MAXDIMS 32
|
41 |
+
#define NPY_MAXARGS 32
|
42 |
+
|
43 |
+
/* Used for Converter Functions "O&" code in ParseTuple */
|
44 |
+
#define NPY_FAIL 0
|
45 |
+
#define NPY_SUCCEED 1
|
46 |
+
|
47 |
+
|
48 |
+
enum NPY_TYPES { NPY_BOOL=0,
|
49 |
+
NPY_BYTE, NPY_UBYTE,
|
50 |
+
NPY_SHORT, NPY_USHORT,
|
51 |
+
NPY_INT, NPY_UINT,
|
52 |
+
NPY_LONG, NPY_ULONG,
|
53 |
+
NPY_LONGLONG, NPY_ULONGLONG,
|
54 |
+
NPY_FLOAT, NPY_DOUBLE, NPY_LONGDOUBLE,
|
55 |
+
NPY_CFLOAT, NPY_CDOUBLE, NPY_CLONGDOUBLE,
|
56 |
+
NPY_OBJECT=17,
|
57 |
+
NPY_STRING, NPY_UNICODE,
|
58 |
+
NPY_VOID,
|
59 |
+
/*
|
60 |
+
* New 1.6 types appended, may be integrated
|
61 |
+
* into the above in 2.0.
|
62 |
+
*/
|
63 |
+
NPY_DATETIME, NPY_TIMEDELTA, NPY_HALF,
|
64 |
+
|
65 |
+
NPY_NTYPES,
|
66 |
+
NPY_NOTYPE,
|
67 |
+
NPY_CHAR NPY_ATTR_DEPRECATE("Use NPY_STRING"),
|
68 |
+
NPY_USERDEF=256, /* leave room for characters */
|
69 |
+
|
70 |
+
/* The number of types not including the new 1.6 types */
|
71 |
+
NPY_NTYPES_ABI_COMPATIBLE=21
|
72 |
+
};
|
73 |
+
#if defined(_MSC_VER) && !defined(__clang__)
|
74 |
+
#pragma deprecated(NPY_CHAR)
|
75 |
+
#endif
|
76 |
+
|
77 |
+
/* basetype array priority */
|
78 |
+
#define NPY_PRIORITY 0.0
|
79 |
+
|
80 |
+
/* default subtype priority */
|
81 |
+
#define NPY_SUBTYPE_PRIORITY 1.0
|
82 |
+
|
83 |
+
/* default scalar priority */
|
84 |
+
#define NPY_SCALAR_PRIORITY -1000000.0
|
85 |
+
|
86 |
+
/* How many floating point types are there (excluding half) */
|
87 |
+
#define NPY_NUM_FLOATTYPE 3
|
88 |
+
|
89 |
+
/*
|
90 |
+
* These characters correspond to the array type and the struct
|
91 |
+
* module
|
92 |
+
*/
|
93 |
+
|
94 |
+
enum NPY_TYPECHAR {
|
95 |
+
NPY_BOOLLTR = '?',
|
96 |
+
NPY_BYTELTR = 'b',
|
97 |
+
NPY_UBYTELTR = 'B',
|
98 |
+
NPY_SHORTLTR = 'h',
|
99 |
+
NPY_USHORTLTR = 'H',
|
100 |
+
NPY_INTLTR = 'i',
|
101 |
+
NPY_UINTLTR = 'I',
|
102 |
+
NPY_LONGLTR = 'l',
|
103 |
+
NPY_ULONGLTR = 'L',
|
104 |
+
NPY_LONGLONGLTR = 'q',
|
105 |
+
NPY_ULONGLONGLTR = 'Q',
|
106 |
+
NPY_HALFLTR = 'e',
|
107 |
+
NPY_FLOATLTR = 'f',
|
108 |
+
NPY_DOUBLELTR = 'd',
|
109 |
+
NPY_LONGDOUBLELTR = 'g',
|
110 |
+
NPY_CFLOATLTR = 'F',
|
111 |
+
NPY_CDOUBLELTR = 'D',
|
112 |
+
NPY_CLONGDOUBLELTR = 'G',
|
113 |
+
NPY_OBJECTLTR = 'O',
|
114 |
+
NPY_STRINGLTR = 'S',
|
115 |
+
NPY_STRINGLTR2 = 'a',
|
116 |
+
NPY_UNICODELTR = 'U',
|
117 |
+
NPY_VOIDLTR = 'V',
|
118 |
+
NPY_DATETIMELTR = 'M',
|
119 |
+
NPY_TIMEDELTALTR = 'm',
|
120 |
+
NPY_CHARLTR = 'c',
|
121 |
+
|
122 |
+
/*
|
123 |
+
* No Descriptor, just a define -- this let's
|
124 |
+
* Python users specify an array of integers
|
125 |
+
* large enough to hold a pointer on the
|
126 |
+
* platform
|
127 |
+
*/
|
128 |
+
NPY_INTPLTR = 'p',
|
129 |
+
NPY_UINTPLTR = 'P',
|
130 |
+
|
131 |
+
/*
|
132 |
+
* These are for dtype 'kinds', not dtype 'typecodes'
|
133 |
+
* as the above are for.
|
134 |
+
*/
|
135 |
+
NPY_GENBOOLLTR ='b',
|
136 |
+
NPY_SIGNEDLTR = 'i',
|
137 |
+
NPY_UNSIGNEDLTR = 'u',
|
138 |
+
NPY_FLOATINGLTR = 'f',
|
139 |
+
NPY_COMPLEXLTR = 'c'
|
140 |
+
};
|
141 |
+
|
142 |
+
/*
|
143 |
+
* Changing this may break Numpy API compatibility
|
144 |
+
* due to changing offsets in PyArray_ArrFuncs, so be
|
145 |
+
* careful. Here we have reused the mergesort slot for
|
146 |
+
* any kind of stable sort, the actual implementation will
|
147 |
+
* depend on the data type.
|
148 |
+
*/
|
149 |
+
typedef enum {
|
150 |
+
NPY_QUICKSORT=0,
|
151 |
+
NPY_HEAPSORT=1,
|
152 |
+
NPY_MERGESORT=2,
|
153 |
+
NPY_STABLESORT=2,
|
154 |
+
} NPY_SORTKIND;
|
155 |
+
#define NPY_NSORTS (NPY_STABLESORT + 1)
|
156 |
+
|
157 |
+
|
158 |
+
typedef enum {
|
159 |
+
NPY_INTROSELECT=0
|
160 |
+
} NPY_SELECTKIND;
|
161 |
+
#define NPY_NSELECTS (NPY_INTROSELECT + 1)
|
162 |
+
|
163 |
+
|
164 |
+
typedef enum {
|
165 |
+
NPY_SEARCHLEFT=0,
|
166 |
+
NPY_SEARCHRIGHT=1
|
167 |
+
} NPY_SEARCHSIDE;
|
168 |
+
#define NPY_NSEARCHSIDES (NPY_SEARCHRIGHT + 1)
|
169 |
+
|
170 |
+
|
171 |
+
typedef enum {
|
172 |
+
NPY_NOSCALAR=-1,
|
173 |
+
NPY_BOOL_SCALAR,
|
174 |
+
NPY_INTPOS_SCALAR,
|
175 |
+
NPY_INTNEG_SCALAR,
|
176 |
+
NPY_FLOAT_SCALAR,
|
177 |
+
NPY_COMPLEX_SCALAR,
|
178 |
+
NPY_OBJECT_SCALAR
|
179 |
+
} NPY_SCALARKIND;
|
180 |
+
#define NPY_NSCALARKINDS (NPY_OBJECT_SCALAR + 1)
|
181 |
+
|
182 |
+
/* For specifying array memory layout or iteration order */
|
183 |
+
typedef enum {
|
184 |
+
/* Fortran order if inputs are all Fortran, C otherwise */
|
185 |
+
NPY_ANYORDER=-1,
|
186 |
+
/* C order */
|
187 |
+
NPY_CORDER=0,
|
188 |
+
/* Fortran order */
|
189 |
+
NPY_FORTRANORDER=1,
|
190 |
+
/* An order as close to the inputs as possible */
|
191 |
+
NPY_KEEPORDER=2
|
192 |
+
} NPY_ORDER;
|
193 |
+
|
194 |
+
/* For specifying allowed casting in operations which support it */
|
195 |
+
typedef enum {
|
196 |
+
_NPY_ERROR_OCCURRED_IN_CAST = -1,
|
197 |
+
/* Only allow identical types */
|
198 |
+
NPY_NO_CASTING=0,
|
199 |
+
/* Allow identical and byte swapped types */
|
200 |
+
NPY_EQUIV_CASTING=1,
|
201 |
+
/* Only allow safe casts */
|
202 |
+
NPY_SAFE_CASTING=2,
|
203 |
+
/* Allow safe casts or casts within the same kind */
|
204 |
+
NPY_SAME_KIND_CASTING=3,
|
205 |
+
/* Allow any casts */
|
206 |
+
NPY_UNSAFE_CASTING=4,
|
207 |
+
} NPY_CASTING;
|
208 |
+
|
209 |
+
typedef enum {
|
210 |
+
NPY_CLIP=0,
|
211 |
+
NPY_WRAP=1,
|
212 |
+
NPY_RAISE=2
|
213 |
+
} NPY_CLIPMODE;
|
214 |
+
|
215 |
+
typedef enum {
|
216 |
+
NPY_VALID=0,
|
217 |
+
NPY_SAME=1,
|
218 |
+
NPY_FULL=2
|
219 |
+
} NPY_CORRELATEMODE;
|
220 |
+
|
221 |
+
/* The special not-a-time (NaT) value */
|
222 |
+
#define NPY_DATETIME_NAT NPY_MIN_INT64
|
223 |
+
|
224 |
+
/*
|
225 |
+
* Upper bound on the length of a DATETIME ISO 8601 string
|
226 |
+
* YEAR: 21 (64-bit year)
|
227 |
+
* MONTH: 3
|
228 |
+
* DAY: 3
|
229 |
+
* HOURS: 3
|
230 |
+
* MINUTES: 3
|
231 |
+
* SECONDS: 3
|
232 |
+
* ATTOSECONDS: 1 + 3*6
|
233 |
+
* TIMEZONE: 5
|
234 |
+
* NULL TERMINATOR: 1
|
235 |
+
*/
|
236 |
+
#define NPY_DATETIME_MAX_ISO8601_STRLEN (21 + 3*5 + 1 + 3*6 + 6 + 1)
|
237 |
+
|
238 |
+
/* The FR in the unit names stands for frequency */
|
239 |
+
typedef enum {
|
240 |
+
/* Force signed enum type, must be -1 for code compatibility */
|
241 |
+
NPY_FR_ERROR = -1, /* error or undetermined */
|
242 |
+
|
243 |
+
/* Start of valid units */
|
244 |
+
NPY_FR_Y = 0, /* Years */
|
245 |
+
NPY_FR_M = 1, /* Months */
|
246 |
+
NPY_FR_W = 2, /* Weeks */
|
247 |
+
/* Gap where 1.6 NPY_FR_B (value 3) was */
|
248 |
+
NPY_FR_D = 4, /* Days */
|
249 |
+
NPY_FR_h = 5, /* hours */
|
250 |
+
NPY_FR_m = 6, /* minutes */
|
251 |
+
NPY_FR_s = 7, /* seconds */
|
252 |
+
NPY_FR_ms = 8, /* milliseconds */
|
253 |
+
NPY_FR_us = 9, /* microseconds */
|
254 |
+
NPY_FR_ns = 10, /* nanoseconds */
|
255 |
+
NPY_FR_ps = 11, /* picoseconds */
|
256 |
+
NPY_FR_fs = 12, /* femtoseconds */
|
257 |
+
NPY_FR_as = 13, /* attoseconds */
|
258 |
+
NPY_FR_GENERIC = 14 /* unbound units, can convert to anything */
|
259 |
+
} NPY_DATETIMEUNIT;
|
260 |
+
|
261 |
+
/*
|
262 |
+
* NOTE: With the NPY_FR_B gap for 1.6 ABI compatibility, NPY_DATETIME_NUMUNITS
|
263 |
+
* is technically one more than the actual number of units.
|
264 |
+
*/
|
265 |
+
#define NPY_DATETIME_NUMUNITS (NPY_FR_GENERIC + 1)
|
266 |
+
#define NPY_DATETIME_DEFAULTUNIT NPY_FR_GENERIC
|
267 |
+
|
268 |
+
/*
|
269 |
+
* Business day conventions for mapping invalid business
|
270 |
+
* days to valid business days.
|
271 |
+
*/
|
272 |
+
typedef enum {
|
273 |
+
/* Go forward in time to the following business day. */
|
274 |
+
NPY_BUSDAY_FORWARD,
|
275 |
+
NPY_BUSDAY_FOLLOWING = NPY_BUSDAY_FORWARD,
|
276 |
+
/* Go backward in time to the preceding business day. */
|
277 |
+
NPY_BUSDAY_BACKWARD,
|
278 |
+
NPY_BUSDAY_PRECEDING = NPY_BUSDAY_BACKWARD,
|
279 |
+
/*
|
280 |
+
* Go forward in time to the following business day, unless it
|
281 |
+
* crosses a month boundary, in which case go backward
|
282 |
+
*/
|
283 |
+
NPY_BUSDAY_MODIFIEDFOLLOWING,
|
284 |
+
/*
|
285 |
+
* Go backward in time to the preceding business day, unless it
|
286 |
+
* crosses a month boundary, in which case go forward.
|
287 |
+
*/
|
288 |
+
NPY_BUSDAY_MODIFIEDPRECEDING,
|
289 |
+
/* Produce a NaT for non-business days. */
|
290 |
+
NPY_BUSDAY_NAT,
|
291 |
+
/* Raise an exception for non-business days. */
|
292 |
+
NPY_BUSDAY_RAISE
|
293 |
+
} NPY_BUSDAY_ROLL;
|
294 |
+
|
295 |
+
/************************************************************
|
296 |
+
* NumPy Auxiliary Data for inner loops, sort functions, etc.
|
297 |
+
************************************************************/
|
298 |
+
|
299 |
+
/*
|
300 |
+
* When creating an auxiliary data struct, this should always appear
|
301 |
+
* as the first member, like this:
|
302 |
+
*
|
303 |
+
* typedef struct {
|
304 |
+
* NpyAuxData base;
|
305 |
+
* double constant;
|
306 |
+
* } constant_multiplier_aux_data;
|
307 |
+
*/
|
308 |
+
typedef struct NpyAuxData_tag NpyAuxData;
|
309 |
+
|
310 |
+
/* Function pointers for freeing or cloning auxiliary data */
|
311 |
+
typedef void (NpyAuxData_FreeFunc) (NpyAuxData *);
|
312 |
+
typedef NpyAuxData *(NpyAuxData_CloneFunc) (NpyAuxData *);
|
313 |
+
|
314 |
+
struct NpyAuxData_tag {
|
315 |
+
NpyAuxData_FreeFunc *free;
|
316 |
+
NpyAuxData_CloneFunc *clone;
|
317 |
+
/* To allow for a bit of expansion without breaking the ABI */
|
318 |
+
void *reserved[2];
|
319 |
+
};
|
320 |
+
|
321 |
+
/* Macros to use for freeing and cloning auxiliary data */
|
322 |
+
#define NPY_AUXDATA_FREE(auxdata) \
|
323 |
+
do { \
|
324 |
+
if ((auxdata) != NULL) { \
|
325 |
+
(auxdata)->free(auxdata); \
|
326 |
+
} \
|
327 |
+
} while(0)
|
328 |
+
#define NPY_AUXDATA_CLONE(auxdata) \
|
329 |
+
((auxdata)->clone(auxdata))
|
330 |
+
|
331 |
+
#define NPY_ERR(str) fprintf(stderr, #str); fflush(stderr);
|
332 |
+
#define NPY_ERR2(str) fprintf(stderr, str); fflush(stderr);
|
333 |
+
|
334 |
+
/*
|
335 |
+
* Macros to define how array, and dimension/strides data is
|
336 |
+
* allocated. These should be made private
|
337 |
+
*/
|
338 |
+
|
339 |
+
#define NPY_USE_PYMEM 1
|
340 |
+
|
341 |
+
|
342 |
+
#if NPY_USE_PYMEM == 1
|
343 |
+
/* use the Raw versions which are safe to call with the GIL released */
|
344 |
+
#define PyArray_malloc PyMem_RawMalloc
|
345 |
+
#define PyArray_free PyMem_RawFree
|
346 |
+
#define PyArray_realloc PyMem_RawRealloc
|
347 |
+
#else
|
348 |
+
#define PyArray_malloc malloc
|
349 |
+
#define PyArray_free free
|
350 |
+
#define PyArray_realloc realloc
|
351 |
+
#endif
|
352 |
+
|
353 |
+
/* Dimensions and strides */
|
354 |
+
#define PyDimMem_NEW(size) \
|
355 |
+
((npy_intp *)PyArray_malloc(size*sizeof(npy_intp)))
|
356 |
+
|
357 |
+
#define PyDimMem_FREE(ptr) PyArray_free(ptr)
|
358 |
+
|
359 |
+
#define PyDimMem_RENEW(ptr,size) \
|
360 |
+
((npy_intp *)PyArray_realloc(ptr,size*sizeof(npy_intp)))
|
361 |
+
|
362 |
+
/* forward declaration */
|
363 |
+
struct _PyArray_Descr;
|
364 |
+
|
365 |
+
/* These must deal with unaligned and swapped data if necessary */
|
366 |
+
typedef PyObject * (PyArray_GetItemFunc) (void *, void *);
|
367 |
+
typedef int (PyArray_SetItemFunc)(PyObject *, void *, void *);
|
368 |
+
|
369 |
+
typedef void (PyArray_CopySwapNFunc)(void *, npy_intp, void *, npy_intp,
|
370 |
+
npy_intp, int, void *);
|
371 |
+
|
372 |
+
typedef void (PyArray_CopySwapFunc)(void *, void *, int, void *);
|
373 |
+
typedef npy_bool (PyArray_NonzeroFunc)(void *, void *);
|
374 |
+
|
375 |
+
|
376 |
+
/*
|
377 |
+
* These assume aligned and notswapped data -- a buffer will be used
|
378 |
+
* before or contiguous data will be obtained
|
379 |
+
*/
|
380 |
+
|
381 |
+
typedef int (PyArray_CompareFunc)(const void *, const void *, void *);
|
382 |
+
typedef int (PyArray_ArgFunc)(void*, npy_intp, npy_intp*, void *);
|
383 |
+
|
384 |
+
typedef void (PyArray_DotFunc)(void *, npy_intp, void *, npy_intp, void *,
|
385 |
+
npy_intp, void *);
|
386 |
+
|
387 |
+
typedef void (PyArray_VectorUnaryFunc)(void *, void *, npy_intp, void *,
|
388 |
+
void *);
|
389 |
+
|
390 |
+
/*
|
391 |
+
* XXX the ignore argument should be removed next time the API version
|
392 |
+
* is bumped. It used to be the separator.
|
393 |
+
*/
|
394 |
+
typedef int (PyArray_ScanFunc)(FILE *fp, void *dptr,
|
395 |
+
char *ignore, struct _PyArray_Descr *);
|
396 |
+
typedef int (PyArray_FromStrFunc)(char *s, void *dptr, char **endptr,
|
397 |
+
struct _PyArray_Descr *);
|
398 |
+
|
399 |
+
typedef int (PyArray_FillFunc)(void *, npy_intp, void *);
|
400 |
+
|
401 |
+
typedef int (PyArray_SortFunc)(void *, npy_intp, void *);
|
402 |
+
typedef int (PyArray_ArgSortFunc)(void *, npy_intp *, npy_intp, void *);
|
403 |
+
typedef int (PyArray_PartitionFunc)(void *, npy_intp, npy_intp,
|
404 |
+
npy_intp *, npy_intp *,
|
405 |
+
void *);
|
406 |
+
typedef int (PyArray_ArgPartitionFunc)(void *, npy_intp *, npy_intp, npy_intp,
|
407 |
+
npy_intp *, npy_intp *,
|
408 |
+
void *);
|
409 |
+
|
410 |
+
typedef int (PyArray_FillWithScalarFunc)(void *, npy_intp, void *, void *);
|
411 |
+
|
412 |
+
typedef int (PyArray_ScalarKindFunc)(void *);
|
413 |
+
|
414 |
+
typedef void (PyArray_FastClipFunc)(void *in, npy_intp n_in, void *min,
|
415 |
+
void *max, void *out);
|
416 |
+
typedef void (PyArray_FastPutmaskFunc)(void *in, void *mask, npy_intp n_in,
|
417 |
+
void *values, npy_intp nv);
|
418 |
+
typedef int (PyArray_FastTakeFunc)(void *dest, void *src, npy_intp *indarray,
|
419 |
+
npy_intp nindarray, npy_intp n_outer,
|
420 |
+
npy_intp m_middle, npy_intp nelem,
|
421 |
+
NPY_CLIPMODE clipmode);
|
422 |
+
|
423 |
+
typedef struct {
|
424 |
+
npy_intp *ptr;
|
425 |
+
int len;
|
426 |
+
} PyArray_Dims;
|
427 |
+
|
428 |
+
typedef struct {
|
429 |
+
/*
|
430 |
+
* Functions to cast to most other standard types
|
431 |
+
* Can have some NULL entries. The types
|
432 |
+
* DATETIME, TIMEDELTA, and HALF go into the castdict
|
433 |
+
* even though they are built-in.
|
434 |
+
*/
|
435 |
+
PyArray_VectorUnaryFunc *cast[NPY_NTYPES_ABI_COMPATIBLE];
|
436 |
+
|
437 |
+
/* The next four functions *cannot* be NULL */
|
438 |
+
|
439 |
+
/*
|
440 |
+
* Functions to get and set items with standard Python types
|
441 |
+
* -- not array scalars
|
442 |
+
*/
|
443 |
+
PyArray_GetItemFunc *getitem;
|
444 |
+
PyArray_SetItemFunc *setitem;
|
445 |
+
|
446 |
+
/*
|
447 |
+
* Copy and/or swap data. Memory areas may not overlap
|
448 |
+
* Use memmove first if they might
|
449 |
+
*/
|
450 |
+
PyArray_CopySwapNFunc *copyswapn;
|
451 |
+
PyArray_CopySwapFunc *copyswap;
|
452 |
+
|
453 |
+
/*
|
454 |
+
* Function to compare items
|
455 |
+
* Can be NULL
|
456 |
+
*/
|
457 |
+
PyArray_CompareFunc *compare;
|
458 |
+
|
459 |
+
/*
|
460 |
+
* Function to select largest
|
461 |
+
* Can be NULL
|
462 |
+
*/
|
463 |
+
PyArray_ArgFunc *argmax;
|
464 |
+
|
465 |
+
/*
|
466 |
+
* Function to compute dot product
|
467 |
+
* Can be NULL
|
468 |
+
*/
|
469 |
+
PyArray_DotFunc *dotfunc;
|
470 |
+
|
471 |
+
/*
|
472 |
+
* Function to scan an ASCII file and
|
473 |
+
* place a single value plus possible separator
|
474 |
+
* Can be NULL
|
475 |
+
*/
|
476 |
+
PyArray_ScanFunc *scanfunc;
|
477 |
+
|
478 |
+
/*
|
479 |
+
* Function to read a single value from a string
|
480 |
+
* and adjust the pointer; Can be NULL
|
481 |
+
*/
|
482 |
+
PyArray_FromStrFunc *fromstr;
|
483 |
+
|
484 |
+
/*
|
485 |
+
* Function to determine if data is zero or not
|
486 |
+
* If NULL a default version is
|
487 |
+
* used at Registration time.
|
488 |
+
*/
|
489 |
+
PyArray_NonzeroFunc *nonzero;
|
490 |
+
|
491 |
+
/*
|
492 |
+
* Used for arange. Should return 0 on success
|
493 |
+
* and -1 on failure.
|
494 |
+
* Can be NULL.
|
495 |
+
*/
|
496 |
+
PyArray_FillFunc *fill;
|
497 |
+
|
498 |
+
/*
|
499 |
+
* Function to fill arrays with scalar values
|
500 |
+
* Can be NULL
|
501 |
+
*/
|
502 |
+
PyArray_FillWithScalarFunc *fillwithscalar;
|
503 |
+
|
504 |
+
/*
|
505 |
+
* Sorting functions
|
506 |
+
* Can be NULL
|
507 |
+
*/
|
508 |
+
PyArray_SortFunc *sort[NPY_NSORTS];
|
509 |
+
PyArray_ArgSortFunc *argsort[NPY_NSORTS];
|
510 |
+
|
511 |
+
/*
|
512 |
+
* Dictionary of additional casting functions
|
513 |
+
* PyArray_VectorUnaryFuncs
|
514 |
+
* which can be populated to support casting
|
515 |
+
* to other registered types. Can be NULL
|
516 |
+
*/
|
517 |
+
PyObject *castdict;
|
518 |
+
|
519 |
+
/*
|
520 |
+
* Functions useful for generalizing
|
521 |
+
* the casting rules.
|
522 |
+
* Can be NULL;
|
523 |
+
*/
|
524 |
+
PyArray_ScalarKindFunc *scalarkind;
|
525 |
+
int **cancastscalarkindto;
|
526 |
+
int *cancastto;
|
527 |
+
|
528 |
+
PyArray_FastClipFunc *fastclip;
|
529 |
+
PyArray_FastPutmaskFunc *fastputmask;
|
530 |
+
PyArray_FastTakeFunc *fasttake;
|
531 |
+
|
532 |
+
/*
|
533 |
+
* Function to select smallest
|
534 |
+
* Can be NULL
|
535 |
+
*/
|
536 |
+
PyArray_ArgFunc *argmin;
|
537 |
+
|
538 |
+
} PyArray_ArrFuncs;
|
539 |
+
|
540 |
+
/* The item must be reference counted when it is inserted or extracted. */
|
541 |
+
#define NPY_ITEM_REFCOUNT 0x01
|
542 |
+
/* Same as needing REFCOUNT */
|
543 |
+
#define NPY_ITEM_HASOBJECT 0x01
|
544 |
+
/* Convert to list for pickling */
|
545 |
+
#define NPY_LIST_PICKLE 0x02
|
546 |
+
/* The item is a POINTER */
|
547 |
+
#define NPY_ITEM_IS_POINTER 0x04
|
548 |
+
/* memory needs to be initialized for this data-type */
|
549 |
+
#define NPY_NEEDS_INIT 0x08
|
550 |
+
/* operations need Python C-API so don't give-up thread. */
|
551 |
+
#define NPY_NEEDS_PYAPI 0x10
|
552 |
+
/* Use f.getitem when extracting elements of this data-type */
|
553 |
+
#define NPY_USE_GETITEM 0x20
|
554 |
+
/* Use f.setitem when setting creating 0-d array from this data-type.*/
|
555 |
+
#define NPY_USE_SETITEM 0x40
|
556 |
+
/* A sticky flag specifically for structured arrays */
|
557 |
+
#define NPY_ALIGNED_STRUCT 0x80
|
558 |
+
|
559 |
+
/*
|
560 |
+
*These are inherited for global data-type if any data-types in the
|
561 |
+
* field have them
|
562 |
+
*/
|
563 |
+
#define NPY_FROM_FIELDS (NPY_NEEDS_INIT | NPY_LIST_PICKLE | \
|
564 |
+
NPY_ITEM_REFCOUNT | NPY_NEEDS_PYAPI)
|
565 |
+
|
566 |
+
#define NPY_OBJECT_DTYPE_FLAGS (NPY_LIST_PICKLE | NPY_USE_GETITEM | \
|
567 |
+
NPY_ITEM_IS_POINTER | NPY_ITEM_REFCOUNT | \
|
568 |
+
NPY_NEEDS_INIT | NPY_NEEDS_PYAPI)
|
569 |
+
|
570 |
+
#define PyDataType_FLAGCHK(dtype, flag) \
|
571 |
+
(((dtype)->flags & (flag)) == (flag))
|
572 |
+
|
573 |
+
#define PyDataType_REFCHK(dtype) \
|
574 |
+
PyDataType_FLAGCHK(dtype, NPY_ITEM_REFCOUNT)
|
575 |
+
|
576 |
+
typedef struct _PyArray_Descr {
|
577 |
+
PyObject_HEAD
|
578 |
+
/*
|
579 |
+
* the type object representing an
|
580 |
+
* instance of this type -- should not
|
581 |
+
* be two type_numbers with the same type
|
582 |
+
* object.
|
583 |
+
*/
|
584 |
+
PyTypeObject *typeobj;
|
585 |
+
/* kind for this type */
|
586 |
+
char kind;
|
587 |
+
/* unique-character representing this type */
|
588 |
+
char type;
|
589 |
+
/*
|
590 |
+
* '>' (big), '<' (little), '|'
|
591 |
+
* (not-applicable), or '=' (native).
|
592 |
+
*/
|
593 |
+
char byteorder;
|
594 |
+
/* flags describing data type */
|
595 |
+
char flags;
|
596 |
+
/* number representing this type */
|
597 |
+
int type_num;
|
598 |
+
/* element size (itemsize) for this type */
|
599 |
+
int elsize;
|
600 |
+
/* alignment needed for this type */
|
601 |
+
int alignment;
|
602 |
+
/*
|
603 |
+
* Non-NULL if this type is
|
604 |
+
* is an array (C-contiguous)
|
605 |
+
* of some other type
|
606 |
+
*/
|
607 |
+
struct _arr_descr *subarray;
|
608 |
+
/*
|
609 |
+
* The fields dictionary for this type
|
610 |
+
* For statically defined descr this
|
611 |
+
* is always Py_None
|
612 |
+
*/
|
613 |
+
PyObject *fields;
|
614 |
+
/*
|
615 |
+
* An ordered tuple of field names or NULL
|
616 |
+
* if no fields are defined
|
617 |
+
*/
|
618 |
+
PyObject *names;
|
619 |
+
/*
|
620 |
+
* a table of functions specific for each
|
621 |
+
* basic data descriptor
|
622 |
+
*/
|
623 |
+
PyArray_ArrFuncs *f;
|
624 |
+
/* Metadata about this dtype */
|
625 |
+
PyObject *metadata;
|
626 |
+
/*
|
627 |
+
* Metadata specific to the C implementation
|
628 |
+
* of the particular dtype. This was added
|
629 |
+
* for NumPy 1.7.0.
|
630 |
+
*/
|
631 |
+
NpyAuxData *c_metadata;
|
632 |
+
/* Cached hash value (-1 if not yet computed).
|
633 |
+
* This was added for NumPy 2.0.0.
|
634 |
+
*/
|
635 |
+
npy_hash_t hash;
|
636 |
+
} PyArray_Descr;
|
637 |
+
|
638 |
+
typedef struct _arr_descr {
|
639 |
+
PyArray_Descr *base;
|
640 |
+
PyObject *shape; /* a tuple */
|
641 |
+
} PyArray_ArrayDescr;
|
642 |
+
|
643 |
+
/*
|
644 |
+
* Memory handler structure for array data.
|
645 |
+
*/
|
646 |
+
/* The declaration of free differs from PyMemAllocatorEx */
|
647 |
+
typedef struct {
|
648 |
+
void *ctx;
|
649 |
+
void* (*malloc) (void *ctx, size_t size);
|
650 |
+
void* (*calloc) (void *ctx, size_t nelem, size_t elsize);
|
651 |
+
void* (*realloc) (void *ctx, void *ptr, size_t new_size);
|
652 |
+
void (*free) (void *ctx, void *ptr, size_t size);
|
653 |
+
/*
|
654 |
+
* This is the end of the version=1 struct. Only add new fields after
|
655 |
+
* this line
|
656 |
+
*/
|
657 |
+
} PyDataMemAllocator;
|
658 |
+
|
659 |
+
typedef struct {
|
660 |
+
char name[127]; /* multiple of 64 to keep the struct aligned */
|
661 |
+
uint8_t version; /* currently 1 */
|
662 |
+
PyDataMemAllocator allocator;
|
663 |
+
} PyDataMem_Handler;
|
664 |
+
|
665 |
+
|
666 |
+
/*
|
667 |
+
* The main array object structure.
|
668 |
+
*
|
669 |
+
* It has been recommended to use the inline functions defined below
|
670 |
+
* (PyArray_DATA and friends) to access fields here for a number of
|
671 |
+
* releases. Direct access to the members themselves is deprecated.
|
672 |
+
* To ensure that your code does not use deprecated access,
|
673 |
+
* #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
|
674 |
+
* (or NPY_1_8_API_VERSION or higher as required).
|
675 |
+
*/
|
676 |
+
/* This struct will be moved to a private header in a future release */
|
677 |
+
typedef struct tagPyArrayObject_fields {
|
678 |
+
PyObject_HEAD
|
679 |
+
/* Pointer to the raw data buffer */
|
680 |
+
char *data;
|
681 |
+
/* The number of dimensions, also called 'ndim' */
|
682 |
+
int nd;
|
683 |
+
/* The size in each dimension, also called 'shape' */
|
684 |
+
npy_intp *dimensions;
|
685 |
+
/*
|
686 |
+
* Number of bytes to jump to get to the
|
687 |
+
* next element in each dimension
|
688 |
+
*/
|
689 |
+
npy_intp *strides;
|
690 |
+
/*
|
691 |
+
* This object is decref'd upon
|
692 |
+
* deletion of array. Except in the
|
693 |
+
* case of WRITEBACKIFCOPY which has
|
694 |
+
* special handling.
|
695 |
+
*
|
696 |
+
* For views it points to the original
|
697 |
+
* array, collapsed so no chains of
|
698 |
+
* views occur.
|
699 |
+
*
|
700 |
+
* For creation from buffer object it
|
701 |
+
* points to an object that should be
|
702 |
+
* decref'd on deletion
|
703 |
+
*
|
704 |
+
* For WRITEBACKIFCOPY flag this is an
|
705 |
+
* array to-be-updated upon calling
|
706 |
+
* PyArray_ResolveWritebackIfCopy
|
707 |
+
*/
|
708 |
+
PyObject *base;
|
709 |
+
/* Pointer to type structure */
|
710 |
+
PyArray_Descr *descr;
|
711 |
+
/* Flags describing array -- see below */
|
712 |
+
int flags;
|
713 |
+
/* For weak references */
|
714 |
+
PyObject *weakreflist;
|
715 |
+
#if NPY_FEATURE_VERSION >= NPY_1_20_API_VERSION
|
716 |
+
void *_buffer_info; /* private buffer info, tagged to allow warning */
|
717 |
+
#endif
|
718 |
+
/*
|
719 |
+
* For malloc/calloc/realloc/free per object
|
720 |
+
*/
|
721 |
+
#if NPY_FEATURE_VERSION >= NPY_1_22_API_VERSION
|
722 |
+
PyObject *mem_handler;
|
723 |
+
#endif
|
724 |
+
} PyArrayObject_fields;
|
725 |
+
|
726 |
+
/*
|
727 |
+
* To hide the implementation details, we only expose
|
728 |
+
* the Python struct HEAD.
|
729 |
+
*/
|
730 |
+
#if !defined(NPY_NO_DEPRECATED_API) || \
|
731 |
+
(NPY_NO_DEPRECATED_API < NPY_1_7_API_VERSION)
|
732 |
+
/*
|
733 |
+
* Can't put this in npy_deprecated_api.h like the others.
|
734 |
+
* PyArrayObject field access is deprecated as of NumPy 1.7.
|
735 |
+
*/
|
736 |
+
typedef PyArrayObject_fields PyArrayObject;
|
737 |
+
#else
|
738 |
+
typedef struct tagPyArrayObject {
|
739 |
+
PyObject_HEAD
|
740 |
+
} PyArrayObject;
|
741 |
+
#endif
|
742 |
+
|
743 |
+
/*
|
744 |
+
* Removed 2020-Nov-25, NumPy 1.20
|
745 |
+
* #define NPY_SIZEOF_PYARRAYOBJECT (sizeof(PyArrayObject_fields))
|
746 |
+
*
|
747 |
+
* The above macro was removed as it gave a false sense of a stable ABI
|
748 |
+
* with respect to the structures size. If you require a runtime constant,
|
749 |
+
* you can use `PyArray_Type.tp_basicsize` instead. Otherwise, please
|
750 |
+
* see the PyArrayObject documentation or ask the NumPy developers for
|
751 |
+
* information on how to correctly replace the macro in a way that is
|
752 |
+
* compatible with multiple NumPy versions.
|
753 |
+
*/
|
754 |
+
|
755 |
+
|
756 |
+
/* Array Flags Object */
|
757 |
+
typedef struct PyArrayFlagsObject {
|
758 |
+
PyObject_HEAD
|
759 |
+
PyObject *arr;
|
760 |
+
int flags;
|
761 |
+
} PyArrayFlagsObject;
|
762 |
+
|
763 |
+
/* Mirrors buffer object to ptr */
|
764 |
+
|
765 |
+
typedef struct {
|
766 |
+
PyObject_HEAD
|
767 |
+
PyObject *base;
|
768 |
+
void *ptr;
|
769 |
+
npy_intp len;
|
770 |
+
int flags;
|
771 |
+
} PyArray_Chunk;
|
772 |
+
|
773 |
+
typedef struct {
|
774 |
+
NPY_DATETIMEUNIT base;
|
775 |
+
int num;
|
776 |
+
} PyArray_DatetimeMetaData;
|
777 |
+
|
778 |
+
typedef struct {
|
779 |
+
NpyAuxData base;
|
780 |
+
PyArray_DatetimeMetaData meta;
|
781 |
+
} PyArray_DatetimeDTypeMetaData;
|
782 |
+
|
783 |
+
/*
|
784 |
+
* This structure contains an exploded view of a date-time value.
|
785 |
+
* NaT is represented by year == NPY_DATETIME_NAT.
|
786 |
+
*/
|
787 |
+
typedef struct {
|
788 |
+
npy_int64 year;
|
789 |
+
npy_int32 month, day, hour, min, sec, us, ps, as;
|
790 |
+
} npy_datetimestruct;
|
791 |
+
|
792 |
+
/* This is not used internally. */
|
793 |
+
typedef struct {
|
794 |
+
npy_int64 day;
|
795 |
+
npy_int32 sec, us, ps, as;
|
796 |
+
} npy_timedeltastruct;
|
797 |
+
|
798 |
+
typedef int (PyArray_FinalizeFunc)(PyArrayObject *, PyObject *);
|
799 |
+
|
800 |
+
/*
|
801 |
+
* Means c-style contiguous (last index varies the fastest). The data
|
802 |
+
* elements right after each other.
|
803 |
+
*
|
804 |
+
* This flag may be requested in constructor functions.
|
805 |
+
* This flag may be tested for in PyArray_FLAGS(arr).
|
806 |
+
*/
|
807 |
+
#define NPY_ARRAY_C_CONTIGUOUS 0x0001
|
808 |
+
|
809 |
+
/*
|
810 |
+
* Set if array is a contiguous Fortran array: the first index varies
|
811 |
+
* the fastest in memory (strides array is reverse of C-contiguous
|
812 |
+
* array)
|
813 |
+
*
|
814 |
+
* This flag may be requested in constructor functions.
|
815 |
+
* This flag may be tested for in PyArray_FLAGS(arr).
|
816 |
+
*/
|
817 |
+
#define NPY_ARRAY_F_CONTIGUOUS 0x0002
|
818 |
+
|
819 |
+
/*
|
820 |
+
* Note: all 0-d arrays are C_CONTIGUOUS and F_CONTIGUOUS. If a
|
821 |
+
* 1-d array is C_CONTIGUOUS it is also F_CONTIGUOUS. Arrays with
|
822 |
+
* more then one dimension can be C_CONTIGUOUS and F_CONTIGUOUS
|
823 |
+
* at the same time if they have either zero or one element.
|
824 |
+
* A higher dimensional array always has the same contiguity flags as
|
825 |
+
* `array.squeeze()`; dimensions with `array.shape[dimension] == 1` are
|
826 |
+
* effectively ignored when checking for contiguity.
|
827 |
+
*/
|
828 |
+
|
829 |
+
/*
|
830 |
+
* If set, the array owns the data: it will be free'd when the array
|
831 |
+
* is deleted.
|
832 |
+
*
|
833 |
+
* This flag may be tested for in PyArray_FLAGS(arr).
|
834 |
+
*/
|
835 |
+
#define NPY_ARRAY_OWNDATA 0x0004
|
836 |
+
|
837 |
+
/*
|
838 |
+
* An array never has the next four set; they're only used as parameter
|
839 |
+
* flags to the various FromAny functions
|
840 |
+
*
|
841 |
+
* This flag may be requested in constructor functions.
|
842 |
+
*/
|
843 |
+
|
844 |
+
/* Cause a cast to occur regardless of whether or not it is safe. */
|
845 |
+
#define NPY_ARRAY_FORCECAST 0x0010
|
846 |
+
|
847 |
+
/*
|
848 |
+
* Always copy the array. Returned arrays are always CONTIGUOUS,
|
849 |
+
* ALIGNED, and WRITEABLE. See also: NPY_ARRAY_ENSURENOCOPY = 0x4000.
|
850 |
+
*
|
851 |
+
* This flag may be requested in constructor functions.
|
852 |
+
*/
|
853 |
+
#define NPY_ARRAY_ENSURECOPY 0x0020
|
854 |
+
|
855 |
+
/*
|
856 |
+
* Make sure the returned array is a base-class ndarray
|
857 |
+
*
|
858 |
+
* This flag may be requested in constructor functions.
|
859 |
+
*/
|
860 |
+
#define NPY_ARRAY_ENSUREARRAY 0x0040
|
861 |
+
|
862 |
+
/*
|
863 |
+
* Make sure that the strides are in units of the element size Needed
|
864 |
+
* for some operations with record-arrays.
|
865 |
+
*
|
866 |
+
* This flag may be requested in constructor functions.
|
867 |
+
*/
|
868 |
+
#define NPY_ARRAY_ELEMENTSTRIDES 0x0080
|
869 |
+
|
870 |
+
/*
|
871 |
+
* Array data is aligned on the appropriate memory address for the type
|
872 |
+
* stored according to how the compiler would align things (e.g., an
|
873 |
+
* array of integers (4 bytes each) starts on a memory address that's
|
874 |
+
* a multiple of 4)
|
875 |
+
*
|
876 |
+
* This flag may be requested in constructor functions.
|
877 |
+
* This flag may be tested for in PyArray_FLAGS(arr).
|
878 |
+
*/
|
879 |
+
#define NPY_ARRAY_ALIGNED 0x0100
|
880 |
+
|
881 |
+
/*
|
882 |
+
* Array data has the native endianness
|
883 |
+
*
|
884 |
+
* This flag may be requested in constructor functions.
|
885 |
+
*/
|
886 |
+
#define NPY_ARRAY_NOTSWAPPED 0x0200
|
887 |
+
|
888 |
+
/*
|
889 |
+
* Array data is writeable
|
890 |
+
*
|
891 |
+
* This flag may be requested in constructor functions.
|
892 |
+
* This flag may be tested for in PyArray_FLAGS(arr).
|
893 |
+
*/
|
894 |
+
#define NPY_ARRAY_WRITEABLE 0x0400
|
895 |
+
|
896 |
+
/*
|
897 |
+
* If this flag is set, then base contains a pointer to an array of
|
898 |
+
* the same size that should be updated with the current contents of
|
899 |
+
* this array when PyArray_ResolveWritebackIfCopy is called.
|
900 |
+
*
|
901 |
+
* This flag may be requested in constructor functions.
|
902 |
+
* This flag may be tested for in PyArray_FLAGS(arr).
|
903 |
+
*/
|
904 |
+
#define NPY_ARRAY_WRITEBACKIFCOPY 0x2000
|
905 |
+
|
906 |
+
/*
|
907 |
+
* No copy may be made while converting from an object/array (result is a view)
|
908 |
+
*
|
909 |
+
* This flag may be requested in constructor functions.
|
910 |
+
*/
|
911 |
+
#define NPY_ARRAY_ENSURENOCOPY 0x4000
|
912 |
+
|
913 |
+
/*
|
914 |
+
* NOTE: there are also internal flags defined in multiarray/arrayobject.h,
|
915 |
+
* which start at bit 31 and work down.
|
916 |
+
*/
|
917 |
+
|
918 |
+
#define NPY_ARRAY_BEHAVED (NPY_ARRAY_ALIGNED | \
|
919 |
+
NPY_ARRAY_WRITEABLE)
|
920 |
+
#define NPY_ARRAY_BEHAVED_NS (NPY_ARRAY_ALIGNED | \
|
921 |
+
NPY_ARRAY_WRITEABLE | \
|
922 |
+
NPY_ARRAY_NOTSWAPPED)
|
923 |
+
#define NPY_ARRAY_CARRAY (NPY_ARRAY_C_CONTIGUOUS | \
|
924 |
+
NPY_ARRAY_BEHAVED)
|
925 |
+
#define NPY_ARRAY_CARRAY_RO (NPY_ARRAY_C_CONTIGUOUS | \
|
926 |
+
NPY_ARRAY_ALIGNED)
|
927 |
+
#define NPY_ARRAY_FARRAY (NPY_ARRAY_F_CONTIGUOUS | \
|
928 |
+
NPY_ARRAY_BEHAVED)
|
929 |
+
#define NPY_ARRAY_FARRAY_RO (NPY_ARRAY_F_CONTIGUOUS | \
|
930 |
+
NPY_ARRAY_ALIGNED)
|
931 |
+
#define NPY_ARRAY_DEFAULT (NPY_ARRAY_CARRAY)
|
932 |
+
#define NPY_ARRAY_IN_ARRAY (NPY_ARRAY_CARRAY_RO)
|
933 |
+
#define NPY_ARRAY_OUT_ARRAY (NPY_ARRAY_CARRAY)
|
934 |
+
#define NPY_ARRAY_INOUT_ARRAY (NPY_ARRAY_CARRAY)
|
935 |
+
#define NPY_ARRAY_INOUT_ARRAY2 (NPY_ARRAY_CARRAY | \
|
936 |
+
NPY_ARRAY_WRITEBACKIFCOPY)
|
937 |
+
#define NPY_ARRAY_IN_FARRAY (NPY_ARRAY_FARRAY_RO)
|
938 |
+
#define NPY_ARRAY_OUT_FARRAY (NPY_ARRAY_FARRAY)
|
939 |
+
#define NPY_ARRAY_INOUT_FARRAY (NPY_ARRAY_FARRAY)
|
940 |
+
#define NPY_ARRAY_INOUT_FARRAY2 (NPY_ARRAY_FARRAY | \
|
941 |
+
NPY_ARRAY_WRITEBACKIFCOPY)
|
942 |
+
|
943 |
+
#define NPY_ARRAY_UPDATE_ALL (NPY_ARRAY_C_CONTIGUOUS | \
|
944 |
+
NPY_ARRAY_F_CONTIGUOUS | \
|
945 |
+
NPY_ARRAY_ALIGNED)
|
946 |
+
|
947 |
+
/* This flag is for the array interface, not PyArrayObject */
|
948 |
+
#define NPY_ARR_HAS_DESCR 0x0800
|
949 |
+
|
950 |
+
|
951 |
+
|
952 |
+
|
953 |
+
/*
|
954 |
+
* Size of internal buffers used for alignment Make BUFSIZE a multiple
|
955 |
+
* of sizeof(npy_cdouble) -- usually 16 so that ufunc buffers are aligned
|
956 |
+
*/
|
957 |
+
#define NPY_MIN_BUFSIZE ((int)sizeof(npy_cdouble))
|
958 |
+
#define NPY_MAX_BUFSIZE (((int)sizeof(npy_cdouble))*1000000)
|
959 |
+
#define NPY_BUFSIZE 8192
|
960 |
+
/* buffer stress test size: */
|
961 |
+
/*#define NPY_BUFSIZE 17*/
|
962 |
+
|
963 |
+
#define PyArray_MAX(a,b) (((a)>(b))?(a):(b))
|
964 |
+
#define PyArray_MIN(a,b) (((a)<(b))?(a):(b))
|
965 |
+
#define PyArray_CLT(p,q) ((((p).real==(q).real) ? ((p).imag < (q).imag) : \
|
966 |
+
((p).real < (q).real)))
|
967 |
+
#define PyArray_CGT(p,q) ((((p).real==(q).real) ? ((p).imag > (q).imag) : \
|
968 |
+
((p).real > (q).real)))
|
969 |
+
#define PyArray_CLE(p,q) ((((p).real==(q).real) ? ((p).imag <= (q).imag) : \
|
970 |
+
((p).real <= (q).real)))
|
971 |
+
#define PyArray_CGE(p,q) ((((p).real==(q).real) ? ((p).imag >= (q).imag) : \
|
972 |
+
((p).real >= (q).real)))
|
973 |
+
#define PyArray_CEQ(p,q) (((p).real==(q).real) && ((p).imag == (q).imag))
|
974 |
+
#define PyArray_CNE(p,q) (((p).real!=(q).real) || ((p).imag != (q).imag))
|
975 |
+
|
976 |
+
/*
|
977 |
+
* C API: consists of Macros and functions. The MACROS are defined
|
978 |
+
* here.
|
979 |
+
*/
|
980 |
+
|
981 |
+
|
982 |
+
#define PyArray_ISCONTIGUOUS(m) PyArray_CHKFLAGS((m), NPY_ARRAY_C_CONTIGUOUS)
|
983 |
+
#define PyArray_ISWRITEABLE(m) PyArray_CHKFLAGS((m), NPY_ARRAY_WRITEABLE)
|
984 |
+
#define PyArray_ISALIGNED(m) PyArray_CHKFLAGS((m), NPY_ARRAY_ALIGNED)
|
985 |
+
|
986 |
+
#define PyArray_IS_C_CONTIGUOUS(m) PyArray_CHKFLAGS((m), NPY_ARRAY_C_CONTIGUOUS)
|
987 |
+
#define PyArray_IS_F_CONTIGUOUS(m) PyArray_CHKFLAGS((m), NPY_ARRAY_F_CONTIGUOUS)
|
988 |
+
|
989 |
+
/* the variable is used in some places, so always define it */
|
990 |
+
#define NPY_BEGIN_THREADS_DEF PyThreadState *_save=NULL;
|
991 |
+
#if NPY_ALLOW_THREADS
|
992 |
+
#define NPY_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
|
993 |
+
#define NPY_END_ALLOW_THREADS Py_END_ALLOW_THREADS
|
994 |
+
#define NPY_BEGIN_THREADS do {_save = PyEval_SaveThread();} while (0);
|
995 |
+
#define NPY_END_THREADS do { if (_save) \
|
996 |
+
{ PyEval_RestoreThread(_save); _save = NULL;} } while (0);
|
997 |
+
#define NPY_BEGIN_THREADS_THRESHOLDED(loop_size) do { if ((loop_size) > 500) \
|
998 |
+
{ _save = PyEval_SaveThread();} } while (0);
|
999 |
+
|
1000 |
+
#define NPY_BEGIN_THREADS_DESCR(dtype) \
|
1001 |
+
do {if (!(PyDataType_FLAGCHK((dtype), NPY_NEEDS_PYAPI))) \
|
1002 |
+
NPY_BEGIN_THREADS;} while (0);
|
1003 |
+
|
1004 |
+
#define NPY_END_THREADS_DESCR(dtype) \
|
1005 |
+
do {if (!(PyDataType_FLAGCHK((dtype), NPY_NEEDS_PYAPI))) \
|
1006 |
+
NPY_END_THREADS; } while (0);
|
1007 |
+
|
1008 |
+
#define NPY_ALLOW_C_API_DEF PyGILState_STATE __save__;
|
1009 |
+
#define NPY_ALLOW_C_API do {__save__ = PyGILState_Ensure();} while (0);
|
1010 |
+
#define NPY_DISABLE_C_API do {PyGILState_Release(__save__);} while (0);
|
1011 |
+
#else
|
1012 |
+
#define NPY_BEGIN_ALLOW_THREADS
|
1013 |
+
#define NPY_END_ALLOW_THREADS
|
1014 |
+
#define NPY_BEGIN_THREADS
|
1015 |
+
#define NPY_END_THREADS
|
1016 |
+
#define NPY_BEGIN_THREADS_THRESHOLDED(loop_size)
|
1017 |
+
#define NPY_BEGIN_THREADS_DESCR(dtype)
|
1018 |
+
#define NPY_END_THREADS_DESCR(dtype)
|
1019 |
+
#define NPY_ALLOW_C_API_DEF
|
1020 |
+
#define NPY_ALLOW_C_API
|
1021 |
+
#define NPY_DISABLE_C_API
|
1022 |
+
#endif
|
1023 |
+
|
1024 |
+
/**********************************
|
1025 |
+
* The nditer object, added in 1.6
|
1026 |
+
**********************************/
|
1027 |
+
|
1028 |
+
/* The actual structure of the iterator is an internal detail */
|
1029 |
+
typedef struct NpyIter_InternalOnly NpyIter;
|
1030 |
+
|
1031 |
+
/* Iterator function pointers that may be specialized */
|
1032 |
+
typedef int (NpyIter_IterNextFunc)(NpyIter *iter);
|
1033 |
+
typedef void (NpyIter_GetMultiIndexFunc)(NpyIter *iter,
|
1034 |
+
npy_intp *outcoords);
|
1035 |
+
|
1036 |
+
/*** Global flags that may be passed to the iterator constructors ***/
|
1037 |
+
|
1038 |
+
/* Track an index representing C order */
|
1039 |
+
#define NPY_ITER_C_INDEX 0x00000001
|
1040 |
+
/* Track an index representing Fortran order */
|
1041 |
+
#define NPY_ITER_F_INDEX 0x00000002
|
1042 |
+
/* Track a multi-index */
|
1043 |
+
#define NPY_ITER_MULTI_INDEX 0x00000004
|
1044 |
+
/* User code external to the iterator does the 1-dimensional innermost loop */
|
1045 |
+
#define NPY_ITER_EXTERNAL_LOOP 0x00000008
|
1046 |
+
/* Convert all the operands to a common data type */
|
1047 |
+
#define NPY_ITER_COMMON_DTYPE 0x00000010
|
1048 |
+
/* Operands may hold references, requiring API access during iteration */
|
1049 |
+
#define NPY_ITER_REFS_OK 0x00000020
|
1050 |
+
/* Zero-sized operands should be permitted, iteration checks IterSize for 0 */
|
1051 |
+
#define NPY_ITER_ZEROSIZE_OK 0x00000040
|
1052 |
+
/* Permits reductions (size-0 stride with dimension size > 1) */
|
1053 |
+
#define NPY_ITER_REDUCE_OK 0x00000080
|
1054 |
+
/* Enables sub-range iteration */
|
1055 |
+
#define NPY_ITER_RANGED 0x00000100
|
1056 |
+
/* Enables buffering */
|
1057 |
+
#define NPY_ITER_BUFFERED 0x00000200
|
1058 |
+
/* When buffering is enabled, grows the inner loop if possible */
|
1059 |
+
#define NPY_ITER_GROWINNER 0x00000400
|
1060 |
+
/* Delay allocation of buffers until first Reset* call */
|
1061 |
+
#define NPY_ITER_DELAY_BUFALLOC 0x00000800
|
1062 |
+
/* When NPY_KEEPORDER is specified, disable reversing negative-stride axes */
|
1063 |
+
#define NPY_ITER_DONT_NEGATE_STRIDES 0x00001000
|
1064 |
+
/*
|
1065 |
+
* If output operands overlap with other operands (based on heuristics that
|
1066 |
+
* has false positives but no false negatives), make temporary copies to
|
1067 |
+
* eliminate overlap.
|
1068 |
+
*/
|
1069 |
+
#define NPY_ITER_COPY_IF_OVERLAP 0x00002000
|
1070 |
+
|
1071 |
+
/*** Per-operand flags that may be passed to the iterator constructors ***/
|
1072 |
+
|
1073 |
+
/* The operand will be read from and written to */
|
1074 |
+
#define NPY_ITER_READWRITE 0x00010000
|
1075 |
+
/* The operand will only be read from */
|
1076 |
+
#define NPY_ITER_READONLY 0x00020000
|
1077 |
+
/* The operand will only be written to */
|
1078 |
+
#define NPY_ITER_WRITEONLY 0x00040000
|
1079 |
+
/* The operand's data must be in native byte order */
|
1080 |
+
#define NPY_ITER_NBO 0x00080000
|
1081 |
+
/* The operand's data must be aligned */
|
1082 |
+
#define NPY_ITER_ALIGNED 0x00100000
|
1083 |
+
/* The operand's data must be contiguous (within the inner loop) */
|
1084 |
+
#define NPY_ITER_CONTIG 0x00200000
|
1085 |
+
/* The operand may be copied to satisfy requirements */
|
1086 |
+
#define NPY_ITER_COPY 0x00400000
|
1087 |
+
/* The operand may be copied with WRITEBACKIFCOPY to satisfy requirements */
|
1088 |
+
#define NPY_ITER_UPDATEIFCOPY 0x00800000
|
1089 |
+
/* Allocate the operand if it is NULL */
|
1090 |
+
#define NPY_ITER_ALLOCATE 0x01000000
|
1091 |
+
/* If an operand is allocated, don't use any subtype */
|
1092 |
+
#define NPY_ITER_NO_SUBTYPE 0x02000000
|
1093 |
+
/* This is a virtual array slot, operand is NULL but temporary data is there */
|
1094 |
+
#define NPY_ITER_VIRTUAL 0x04000000
|
1095 |
+
/* Require that the dimension match the iterator dimensions exactly */
|
1096 |
+
#define NPY_ITER_NO_BROADCAST 0x08000000
|
1097 |
+
/* A mask is being used on this array, affects buffer -> array copy */
|
1098 |
+
#define NPY_ITER_WRITEMASKED 0x10000000
|
1099 |
+
/* This array is the mask for all WRITEMASKED operands */
|
1100 |
+
#define NPY_ITER_ARRAYMASK 0x20000000
|
1101 |
+
/* Assume iterator order data access for COPY_IF_OVERLAP */
|
1102 |
+
#define NPY_ITER_OVERLAP_ASSUME_ELEMENTWISE 0x40000000
|
1103 |
+
|
1104 |
+
#define NPY_ITER_GLOBAL_FLAGS 0x0000ffff
|
1105 |
+
#define NPY_ITER_PER_OP_FLAGS 0xffff0000
|
1106 |
+
|
1107 |
+
|
1108 |
+
/*****************************
|
1109 |
+
* Basic iterator object
|
1110 |
+
*****************************/
|
1111 |
+
|
1112 |
+
/* FWD declaration */
|
1113 |
+
typedef struct PyArrayIterObject_tag PyArrayIterObject;
|
1114 |
+
|
1115 |
+
/*
|
1116 |
+
* type of the function which translates a set of coordinates to a
|
1117 |
+
* pointer to the data
|
1118 |
+
*/
|
1119 |
+
typedef char* (*npy_iter_get_dataptr_t)(
|
1120 |
+
PyArrayIterObject* iter, const npy_intp*);
|
1121 |
+
|
1122 |
+
struct PyArrayIterObject_tag {
|
1123 |
+
PyObject_HEAD
|
1124 |
+
int nd_m1; /* number of dimensions - 1 */
|
1125 |
+
npy_intp index, size;
|
1126 |
+
npy_intp coordinates[NPY_MAXDIMS];/* N-dimensional loop */
|
1127 |
+
npy_intp dims_m1[NPY_MAXDIMS]; /* ao->dimensions - 1 */
|
1128 |
+
npy_intp strides[NPY_MAXDIMS]; /* ao->strides or fake */
|
1129 |
+
npy_intp backstrides[NPY_MAXDIMS];/* how far to jump back */
|
1130 |
+
npy_intp factors[NPY_MAXDIMS]; /* shape factors */
|
1131 |
+
PyArrayObject *ao;
|
1132 |
+
char *dataptr; /* pointer to current item*/
|
1133 |
+
npy_bool contiguous;
|
1134 |
+
|
1135 |
+
npy_intp bounds[NPY_MAXDIMS][2];
|
1136 |
+
npy_intp limits[NPY_MAXDIMS][2];
|
1137 |
+
npy_intp limits_sizes[NPY_MAXDIMS];
|
1138 |
+
npy_iter_get_dataptr_t translate;
|
1139 |
+
} ;
|
1140 |
+
|
1141 |
+
|
1142 |
+
/* Iterator API */
|
1143 |
+
#define PyArrayIter_Check(op) PyObject_TypeCheck((op), &PyArrayIter_Type)
|
1144 |
+
|
1145 |
+
#define _PyAIT(it) ((PyArrayIterObject *)(it))
|
1146 |
+
#define PyArray_ITER_RESET(it) do { \
|
1147 |
+
_PyAIT(it)->index = 0; \
|
1148 |
+
_PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao); \
|
1149 |
+
memset(_PyAIT(it)->coordinates, 0, \
|
1150 |
+
(_PyAIT(it)->nd_m1+1)*sizeof(npy_intp)); \
|
1151 |
+
} while (0)
|
1152 |
+
|
1153 |
+
#define _PyArray_ITER_NEXT1(it) do { \
|
1154 |
+
(it)->dataptr += _PyAIT(it)->strides[0]; \
|
1155 |
+
(it)->coordinates[0]++; \
|
1156 |
+
} while (0)
|
1157 |
+
|
1158 |
+
#define _PyArray_ITER_NEXT2(it) do { \
|
1159 |
+
if ((it)->coordinates[1] < (it)->dims_m1[1]) { \
|
1160 |
+
(it)->coordinates[1]++; \
|
1161 |
+
(it)->dataptr += (it)->strides[1]; \
|
1162 |
+
} \
|
1163 |
+
else { \
|
1164 |
+
(it)->coordinates[1] = 0; \
|
1165 |
+
(it)->coordinates[0]++; \
|
1166 |
+
(it)->dataptr += (it)->strides[0] - \
|
1167 |
+
(it)->backstrides[1]; \
|
1168 |
+
} \
|
1169 |
+
} while (0)
|
1170 |
+
|
1171 |
+
#define PyArray_ITER_NEXT(it) do { \
|
1172 |
+
_PyAIT(it)->index++; \
|
1173 |
+
if (_PyAIT(it)->nd_m1 == 0) { \
|
1174 |
+
_PyArray_ITER_NEXT1(_PyAIT(it)); \
|
1175 |
+
} \
|
1176 |
+
else if (_PyAIT(it)->contiguous) \
|
1177 |
+
_PyAIT(it)->dataptr += PyArray_DESCR(_PyAIT(it)->ao)->elsize; \
|
1178 |
+
else if (_PyAIT(it)->nd_m1 == 1) { \
|
1179 |
+
_PyArray_ITER_NEXT2(_PyAIT(it)); \
|
1180 |
+
} \
|
1181 |
+
else { \
|
1182 |
+
int __npy_i; \
|
1183 |
+
for (__npy_i=_PyAIT(it)->nd_m1; __npy_i >= 0; __npy_i--) { \
|
1184 |
+
if (_PyAIT(it)->coordinates[__npy_i] < \
|
1185 |
+
_PyAIT(it)->dims_m1[__npy_i]) { \
|
1186 |
+
_PyAIT(it)->coordinates[__npy_i]++; \
|
1187 |
+
_PyAIT(it)->dataptr += \
|
1188 |
+
_PyAIT(it)->strides[__npy_i]; \
|
1189 |
+
break; \
|
1190 |
+
} \
|
1191 |
+
else { \
|
1192 |
+
_PyAIT(it)->coordinates[__npy_i] = 0; \
|
1193 |
+
_PyAIT(it)->dataptr -= \
|
1194 |
+
_PyAIT(it)->backstrides[__npy_i]; \
|
1195 |
+
} \
|
1196 |
+
} \
|
1197 |
+
} \
|
1198 |
+
} while (0)
|
1199 |
+
|
1200 |
+
#define PyArray_ITER_GOTO(it, destination) do { \
|
1201 |
+
int __npy_i; \
|
1202 |
+
_PyAIT(it)->index = 0; \
|
1203 |
+
_PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao); \
|
1204 |
+
for (__npy_i = _PyAIT(it)->nd_m1; __npy_i>=0; __npy_i--) { \
|
1205 |
+
if (destination[__npy_i] < 0) { \
|
1206 |
+
destination[__npy_i] += \
|
1207 |
+
_PyAIT(it)->dims_m1[__npy_i]+1; \
|
1208 |
+
} \
|
1209 |
+
_PyAIT(it)->dataptr += destination[__npy_i] * \
|
1210 |
+
_PyAIT(it)->strides[__npy_i]; \
|
1211 |
+
_PyAIT(it)->coordinates[__npy_i] = \
|
1212 |
+
destination[__npy_i]; \
|
1213 |
+
_PyAIT(it)->index += destination[__npy_i] * \
|
1214 |
+
( __npy_i==_PyAIT(it)->nd_m1 ? 1 : \
|
1215 |
+
_PyAIT(it)->dims_m1[__npy_i+1]+1) ; \
|
1216 |
+
} \
|
1217 |
+
} while (0)
|
1218 |
+
|
1219 |
+
#define PyArray_ITER_GOTO1D(it, ind) do { \
|
1220 |
+
int __npy_i; \
|
1221 |
+
npy_intp __npy_ind = (npy_intp)(ind); \
|
1222 |
+
if (__npy_ind < 0) __npy_ind += _PyAIT(it)->size; \
|
1223 |
+
_PyAIT(it)->index = __npy_ind; \
|
1224 |
+
if (_PyAIT(it)->nd_m1 == 0) { \
|
1225 |
+
_PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao) + \
|
1226 |
+
__npy_ind * _PyAIT(it)->strides[0]; \
|
1227 |
+
} \
|
1228 |
+
else if (_PyAIT(it)->contiguous) \
|
1229 |
+
_PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao) + \
|
1230 |
+
__npy_ind * PyArray_DESCR(_PyAIT(it)->ao)->elsize; \
|
1231 |
+
else { \
|
1232 |
+
_PyAIT(it)->dataptr = PyArray_BYTES(_PyAIT(it)->ao); \
|
1233 |
+
for (__npy_i = 0; __npy_i<=_PyAIT(it)->nd_m1; \
|
1234 |
+
__npy_i++) { \
|
1235 |
+
_PyAIT(it)->coordinates[__npy_i] = \
|
1236 |
+
(__npy_ind / _PyAIT(it)->factors[__npy_i]); \
|
1237 |
+
_PyAIT(it)->dataptr += \
|
1238 |
+
(__npy_ind / _PyAIT(it)->factors[__npy_i]) \
|
1239 |
+
* _PyAIT(it)->strides[__npy_i]; \
|
1240 |
+
__npy_ind %= _PyAIT(it)->factors[__npy_i]; \
|
1241 |
+
} \
|
1242 |
+
} \
|
1243 |
+
} while (0)
|
1244 |
+
|
1245 |
+
#define PyArray_ITER_DATA(it) ((void *)(_PyAIT(it)->dataptr))
|
1246 |
+
|
1247 |
+
#define PyArray_ITER_NOTDONE(it) (_PyAIT(it)->index < _PyAIT(it)->size)
|
1248 |
+
|
1249 |
+
|
1250 |
+
/*
|
1251 |
+
* Any object passed to PyArray_Broadcast must be binary compatible
|
1252 |
+
* with this structure.
|
1253 |
+
*/
|
1254 |
+
|
1255 |
+
typedef struct {
|
1256 |
+
PyObject_HEAD
|
1257 |
+
int numiter; /* number of iters */
|
1258 |
+
npy_intp size; /* broadcasted size */
|
1259 |
+
npy_intp index; /* current index */
|
1260 |
+
int nd; /* number of dims */
|
1261 |
+
npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */
|
1262 |
+
PyArrayIterObject *iters[NPY_MAXARGS]; /* iterators */
|
1263 |
+
} PyArrayMultiIterObject;
|
1264 |
+
|
1265 |
+
#define _PyMIT(m) ((PyArrayMultiIterObject *)(m))
|
1266 |
+
#define PyArray_MultiIter_RESET(multi) do { \
|
1267 |
+
int __npy_mi; \
|
1268 |
+
_PyMIT(multi)->index = 0; \
|
1269 |
+
for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) { \
|
1270 |
+
PyArray_ITER_RESET(_PyMIT(multi)->iters[__npy_mi]); \
|
1271 |
+
} \
|
1272 |
+
} while (0)
|
1273 |
+
|
1274 |
+
#define PyArray_MultiIter_NEXT(multi) do { \
|
1275 |
+
int __npy_mi; \
|
1276 |
+
_PyMIT(multi)->index++; \
|
1277 |
+
for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) { \
|
1278 |
+
PyArray_ITER_NEXT(_PyMIT(multi)->iters[__npy_mi]); \
|
1279 |
+
} \
|
1280 |
+
} while (0)
|
1281 |
+
|
1282 |
+
#define PyArray_MultiIter_GOTO(multi, dest) do { \
|
1283 |
+
int __npy_mi; \
|
1284 |
+
for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) { \
|
1285 |
+
PyArray_ITER_GOTO(_PyMIT(multi)->iters[__npy_mi], dest); \
|
1286 |
+
} \
|
1287 |
+
_PyMIT(multi)->index = _PyMIT(multi)->iters[0]->index; \
|
1288 |
+
} while (0)
|
1289 |
+
|
1290 |
+
#define PyArray_MultiIter_GOTO1D(multi, ind) do { \
|
1291 |
+
int __npy_mi; \
|
1292 |
+
for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) { \
|
1293 |
+
PyArray_ITER_GOTO1D(_PyMIT(multi)->iters[__npy_mi], ind); \
|
1294 |
+
} \
|
1295 |
+
_PyMIT(multi)->index = _PyMIT(multi)->iters[0]->index; \
|
1296 |
+
} while (0)
|
1297 |
+
|
1298 |
+
#define PyArray_MultiIter_DATA(multi, i) \
|
1299 |
+
((void *)(_PyMIT(multi)->iters[i]->dataptr))
|
1300 |
+
|
1301 |
+
#define PyArray_MultiIter_NEXTi(multi, i) \
|
1302 |
+
PyArray_ITER_NEXT(_PyMIT(multi)->iters[i])
|
1303 |
+
|
1304 |
+
#define PyArray_MultiIter_NOTDONE(multi) \
|
1305 |
+
(_PyMIT(multi)->index < _PyMIT(multi)->size)
|
1306 |
+
|
1307 |
+
/*
|
1308 |
+
* Store the information needed for fancy-indexing over an array. The
|
1309 |
+
* fields are slightly unordered to keep consec, dataptr and subspace
|
1310 |
+
* where they were originally.
|
1311 |
+
*/
|
1312 |
+
typedef struct {
|
1313 |
+
PyObject_HEAD
|
1314 |
+
/*
|
1315 |
+
* Multi-iterator portion --- needs to be present in this
|
1316 |
+
* order to work with PyArray_Broadcast
|
1317 |
+
*/
|
1318 |
+
|
1319 |
+
int numiter; /* number of index-array
|
1320 |
+
iterators */
|
1321 |
+
npy_intp size; /* size of broadcasted
|
1322 |
+
result */
|
1323 |
+
npy_intp index; /* current index */
|
1324 |
+
int nd; /* number of dims */
|
1325 |
+
npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */
|
1326 |
+
NpyIter *outer; /* index objects
|
1327 |
+
iterator */
|
1328 |
+
void *unused[NPY_MAXDIMS - 2];
|
1329 |
+
PyArrayObject *array;
|
1330 |
+
/* Flat iterator for the indexed array. For compatibility solely. */
|
1331 |
+
PyArrayIterObject *ait;
|
1332 |
+
|
1333 |
+
/*
|
1334 |
+
* Subspace array. For binary compatibility (was an iterator,
|
1335 |
+
* but only the check for NULL should be used).
|
1336 |
+
*/
|
1337 |
+
PyArrayObject *subspace;
|
1338 |
+
|
1339 |
+
/*
|
1340 |
+
* if subspace iteration, then this is the array of axes in
|
1341 |
+
* the underlying array represented by the index objects
|
1342 |
+
*/
|
1343 |
+
int iteraxes[NPY_MAXDIMS];
|
1344 |
+
npy_intp fancy_strides[NPY_MAXDIMS];
|
1345 |
+
|
1346 |
+
/* pointer when all fancy indices are 0 */
|
1347 |
+
char *baseoffset;
|
1348 |
+
|
1349 |
+
/*
|
1350 |
+
* after binding consec denotes at which axis the fancy axes
|
1351 |
+
* are inserted.
|
1352 |
+
*/
|
1353 |
+
int consec;
|
1354 |
+
char *dataptr;
|
1355 |
+
|
1356 |
+
int nd_fancy;
|
1357 |
+
npy_intp fancy_dims[NPY_MAXDIMS];
|
1358 |
+
|
1359 |
+
/*
|
1360 |
+
* Whether the iterator (any of the iterators) requires API. This is
|
1361 |
+
* unused by NumPy itself; ArrayMethod flags are more precise.
|
1362 |
+
*/
|
1363 |
+
int needs_api;
|
1364 |
+
|
1365 |
+
/*
|
1366 |
+
* Extra op information.
|
1367 |
+
*/
|
1368 |
+
PyArrayObject *extra_op;
|
1369 |
+
PyArray_Descr *extra_op_dtype; /* desired dtype */
|
1370 |
+
npy_uint32 *extra_op_flags; /* Iterator flags */
|
1371 |
+
|
1372 |
+
NpyIter *extra_op_iter;
|
1373 |
+
NpyIter_IterNextFunc *extra_op_next;
|
1374 |
+
char **extra_op_ptrs;
|
1375 |
+
|
1376 |
+
/*
|
1377 |
+
* Information about the iteration state.
|
1378 |
+
*/
|
1379 |
+
NpyIter_IterNextFunc *outer_next;
|
1380 |
+
char **outer_ptrs;
|
1381 |
+
npy_intp *outer_strides;
|
1382 |
+
|
1383 |
+
/*
|
1384 |
+
* Information about the subspace iterator.
|
1385 |
+
*/
|
1386 |
+
NpyIter *subspace_iter;
|
1387 |
+
NpyIter_IterNextFunc *subspace_next;
|
1388 |
+
char **subspace_ptrs;
|
1389 |
+
npy_intp *subspace_strides;
|
1390 |
+
|
1391 |
+
/* Count for the external loop (which ever it is) for API iteration */
|
1392 |
+
npy_intp iter_count;
|
1393 |
+
|
1394 |
+
} PyArrayMapIterObject;
|
1395 |
+
|
1396 |
+
enum {
|
1397 |
+
NPY_NEIGHBORHOOD_ITER_ZERO_PADDING,
|
1398 |
+
NPY_NEIGHBORHOOD_ITER_ONE_PADDING,
|
1399 |
+
NPY_NEIGHBORHOOD_ITER_CONSTANT_PADDING,
|
1400 |
+
NPY_NEIGHBORHOOD_ITER_CIRCULAR_PADDING,
|
1401 |
+
NPY_NEIGHBORHOOD_ITER_MIRROR_PADDING
|
1402 |
+
};
|
1403 |
+
|
1404 |
+
typedef struct {
|
1405 |
+
PyObject_HEAD
|
1406 |
+
|
1407 |
+
/*
|
1408 |
+
* PyArrayIterObject part: keep this in this exact order
|
1409 |
+
*/
|
1410 |
+
int nd_m1; /* number of dimensions - 1 */
|
1411 |
+
npy_intp index, size;
|
1412 |
+
npy_intp coordinates[NPY_MAXDIMS];/* N-dimensional loop */
|
1413 |
+
npy_intp dims_m1[NPY_MAXDIMS]; /* ao->dimensions - 1 */
|
1414 |
+
npy_intp strides[NPY_MAXDIMS]; /* ao->strides or fake */
|
1415 |
+
npy_intp backstrides[NPY_MAXDIMS];/* how far to jump back */
|
1416 |
+
npy_intp factors[NPY_MAXDIMS]; /* shape factors */
|
1417 |
+
PyArrayObject *ao;
|
1418 |
+
char *dataptr; /* pointer to current item*/
|
1419 |
+
npy_bool contiguous;
|
1420 |
+
|
1421 |
+
npy_intp bounds[NPY_MAXDIMS][2];
|
1422 |
+
npy_intp limits[NPY_MAXDIMS][2];
|
1423 |
+
npy_intp limits_sizes[NPY_MAXDIMS];
|
1424 |
+
npy_iter_get_dataptr_t translate;
|
1425 |
+
|
1426 |
+
/*
|
1427 |
+
* New members
|
1428 |
+
*/
|
1429 |
+
npy_intp nd;
|
1430 |
+
|
1431 |
+
/* Dimensions is the dimension of the array */
|
1432 |
+
npy_intp dimensions[NPY_MAXDIMS];
|
1433 |
+
|
1434 |
+
/*
|
1435 |
+
* Neighborhood points coordinates are computed relatively to the
|
1436 |
+
* point pointed by _internal_iter
|
1437 |
+
*/
|
1438 |
+
PyArrayIterObject* _internal_iter;
|
1439 |
+
/*
|
1440 |
+
* To keep a reference to the representation of the constant value
|
1441 |
+
* for constant padding
|
1442 |
+
*/
|
1443 |
+
char* constant;
|
1444 |
+
|
1445 |
+
int mode;
|
1446 |
+
} PyArrayNeighborhoodIterObject;
|
1447 |
+
|
1448 |
+
/*
|
1449 |
+
* Neighborhood iterator API
|
1450 |
+
*/
|
1451 |
+
|
1452 |
+
/* General: those work for any mode */
|
1453 |
+
static inline int
|
1454 |
+
PyArrayNeighborhoodIter_Reset(PyArrayNeighborhoodIterObject* iter);
|
1455 |
+
static inline int
|
1456 |
+
PyArrayNeighborhoodIter_Next(PyArrayNeighborhoodIterObject* iter);
|
1457 |
+
#if 0
|
1458 |
+
static inline int
|
1459 |
+
PyArrayNeighborhoodIter_Next2D(PyArrayNeighborhoodIterObject* iter);
|
1460 |
+
#endif
|
1461 |
+
|
1462 |
+
/*
|
1463 |
+
* Include inline implementations - functions defined there are not
|
1464 |
+
* considered public API
|
1465 |
+
*/
|
1466 |
+
#define NUMPY_CORE_INCLUDE_NUMPY__NEIGHBORHOOD_IMP_H_
|
1467 |
+
#include "_neighborhood_iterator_imp.h"
|
1468 |
+
#undef NUMPY_CORE_INCLUDE_NUMPY__NEIGHBORHOOD_IMP_H_
|
1469 |
+
|
1470 |
+
|
1471 |
+
|
1472 |
+
/* The default array type */
|
1473 |
+
#define NPY_DEFAULT_TYPE NPY_DOUBLE
|
1474 |
+
|
1475 |
+
/*
|
1476 |
+
* All sorts of useful ways to look into a PyArrayObject. It is recommended
|
1477 |
+
* to use PyArrayObject * objects instead of always casting from PyObject *,
|
1478 |
+
* for improved type checking.
|
1479 |
+
*
|
1480 |
+
* In many cases here the macro versions of the accessors are deprecated,
|
1481 |
+
* but can't be immediately changed to inline functions because the
|
1482 |
+
* preexisting macros accept PyObject * and do automatic casts. Inline
|
1483 |
+
* functions accepting PyArrayObject * provides for some compile-time
|
1484 |
+
* checking of correctness when working with these objects in C.
|
1485 |
+
*/
|
1486 |
+
|
1487 |
+
#define PyArray_ISONESEGMENT(m) (PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS) || \
|
1488 |
+
PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS))
|
1489 |
+
|
1490 |
+
#define PyArray_ISFORTRAN(m) (PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS) && \
|
1491 |
+
(!PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS)))
|
1492 |
+
|
1493 |
+
#define PyArray_FORTRAN_IF(m) ((PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS) ? \
|
1494 |
+
NPY_ARRAY_F_CONTIGUOUS : 0))
|
1495 |
+
|
1496 |
+
#if (defined(NPY_NO_DEPRECATED_API) && (NPY_1_7_API_VERSION <= NPY_NO_DEPRECATED_API))
|
1497 |
+
/*
|
1498 |
+
* Changing access macros into functions, to allow for future hiding
|
1499 |
+
* of the internal memory layout. This later hiding will allow the 2.x series
|
1500 |
+
* to change the internal representation of arrays without affecting
|
1501 |
+
* ABI compatibility.
|
1502 |
+
*/
|
1503 |
+
|
1504 |
+
static inline int
|
1505 |
+
PyArray_NDIM(const PyArrayObject *arr)
|
1506 |
+
{
|
1507 |
+
return ((PyArrayObject_fields *)arr)->nd;
|
1508 |
+
}
|
1509 |
+
|
1510 |
+
static inline void *
|
1511 |
+
PyArray_DATA(PyArrayObject *arr)
|
1512 |
+
{
|
1513 |
+
return ((PyArrayObject_fields *)arr)->data;
|
1514 |
+
}
|
1515 |
+
|
1516 |
+
static inline char *
|
1517 |
+
PyArray_BYTES(PyArrayObject *arr)
|
1518 |
+
{
|
1519 |
+
return ((PyArrayObject_fields *)arr)->data;
|
1520 |
+
}
|
1521 |
+
|
1522 |
+
static inline npy_intp *
|
1523 |
+
PyArray_DIMS(PyArrayObject *arr)
|
1524 |
+
{
|
1525 |
+
return ((PyArrayObject_fields *)arr)->dimensions;
|
1526 |
+
}
|
1527 |
+
|
1528 |
+
static inline npy_intp *
|
1529 |
+
PyArray_STRIDES(PyArrayObject *arr)
|
1530 |
+
{
|
1531 |
+
return ((PyArrayObject_fields *)arr)->strides;
|
1532 |
+
}
|
1533 |
+
|
1534 |
+
static inline npy_intp
|
1535 |
+
PyArray_DIM(const PyArrayObject *arr, int idim)
|
1536 |
+
{
|
1537 |
+
return ((PyArrayObject_fields *)arr)->dimensions[idim];
|
1538 |
+
}
|
1539 |
+
|
1540 |
+
static inline npy_intp
|
1541 |
+
PyArray_STRIDE(const PyArrayObject *arr, int istride)
|
1542 |
+
{
|
1543 |
+
return ((PyArrayObject_fields *)arr)->strides[istride];
|
1544 |
+
}
|
1545 |
+
|
1546 |
+
static inline NPY_RETURNS_BORROWED_REF PyObject *
|
1547 |
+
PyArray_BASE(PyArrayObject *arr)
|
1548 |
+
{
|
1549 |
+
return ((PyArrayObject_fields *)arr)->base;
|
1550 |
+
}
|
1551 |
+
|
1552 |
+
static inline NPY_RETURNS_BORROWED_REF PyArray_Descr *
|
1553 |
+
PyArray_DESCR(PyArrayObject *arr)
|
1554 |
+
{
|
1555 |
+
return ((PyArrayObject_fields *)arr)->descr;
|
1556 |
+
}
|
1557 |
+
|
1558 |
+
static inline int
|
1559 |
+
PyArray_FLAGS(const PyArrayObject *arr)
|
1560 |
+
{
|
1561 |
+
return ((PyArrayObject_fields *)arr)->flags;
|
1562 |
+
}
|
1563 |
+
|
1564 |
+
static inline npy_intp
|
1565 |
+
PyArray_ITEMSIZE(const PyArrayObject *arr)
|
1566 |
+
{
|
1567 |
+
return ((PyArrayObject_fields *)arr)->descr->elsize;
|
1568 |
+
}
|
1569 |
+
|
1570 |
+
static inline int
|
1571 |
+
PyArray_TYPE(const PyArrayObject *arr)
|
1572 |
+
{
|
1573 |
+
return ((PyArrayObject_fields *)arr)->descr->type_num;
|
1574 |
+
}
|
1575 |
+
|
1576 |
+
static inline int
|
1577 |
+
PyArray_CHKFLAGS(const PyArrayObject *arr, int flags)
|
1578 |
+
{
|
1579 |
+
return (PyArray_FLAGS(arr) & flags) == flags;
|
1580 |
+
}
|
1581 |
+
|
1582 |
+
static inline PyObject *
|
1583 |
+
PyArray_GETITEM(const PyArrayObject *arr, const char *itemptr)
|
1584 |
+
{
|
1585 |
+
return ((PyArrayObject_fields *)arr)->descr->f->getitem(
|
1586 |
+
(void *)itemptr, (PyArrayObject *)arr);
|
1587 |
+
}
|
1588 |
+
|
1589 |
+
/*
|
1590 |
+
* SETITEM should only be used if it is known that the value is a scalar
|
1591 |
+
* and of a type understood by the arrays dtype.
|
1592 |
+
* Use `PyArray_Pack` if the value may be of a different dtype.
|
1593 |
+
*/
|
1594 |
+
static inline int
|
1595 |
+
PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v)
|
1596 |
+
{
|
1597 |
+
return ((PyArrayObject_fields *)arr)->descr->f->setitem(v, itemptr, arr);
|
1598 |
+
}
|
1599 |
+
|
1600 |
+
#else
|
1601 |
+
|
1602 |
+
/* These macros are deprecated as of NumPy 1.7. */
|
1603 |
+
#define PyArray_NDIM(obj) (((PyArrayObject_fields *)(obj))->nd)
|
1604 |
+
#define PyArray_BYTES(obj) (((PyArrayObject_fields *)(obj))->data)
|
1605 |
+
#define PyArray_DATA(obj) ((void *)((PyArrayObject_fields *)(obj))->data)
|
1606 |
+
#define PyArray_DIMS(obj) (((PyArrayObject_fields *)(obj))->dimensions)
|
1607 |
+
#define PyArray_STRIDES(obj) (((PyArrayObject_fields *)(obj))->strides)
|
1608 |
+
#define PyArray_DIM(obj,n) (PyArray_DIMS(obj)[n])
|
1609 |
+
#define PyArray_STRIDE(obj,n) (PyArray_STRIDES(obj)[n])
|
1610 |
+
#define PyArray_BASE(obj) (((PyArrayObject_fields *)(obj))->base)
|
1611 |
+
#define PyArray_DESCR(obj) (((PyArrayObject_fields *)(obj))->descr)
|
1612 |
+
#define PyArray_FLAGS(obj) (((PyArrayObject_fields *)(obj))->flags)
|
1613 |
+
#define PyArray_CHKFLAGS(m, FLAGS) \
|
1614 |
+
((((PyArrayObject_fields *)(m))->flags & (FLAGS)) == (FLAGS))
|
1615 |
+
#define PyArray_ITEMSIZE(obj) \
|
1616 |
+
(((PyArrayObject_fields *)(obj))->descr->elsize)
|
1617 |
+
#define PyArray_TYPE(obj) \
|
1618 |
+
(((PyArrayObject_fields *)(obj))->descr->type_num)
|
1619 |
+
#define PyArray_GETITEM(obj,itemptr) \
|
1620 |
+
PyArray_DESCR(obj)->f->getitem((char *)(itemptr), \
|
1621 |
+
(PyArrayObject *)(obj))
|
1622 |
+
|
1623 |
+
#define PyArray_SETITEM(obj,itemptr,v) \
|
1624 |
+
PyArray_DESCR(obj)->f->setitem((PyObject *)(v), \
|
1625 |
+
(char *)(itemptr), \
|
1626 |
+
(PyArrayObject *)(obj))
|
1627 |
+
#endif
|
1628 |
+
|
1629 |
+
static inline PyArray_Descr *
|
1630 |
+
PyArray_DTYPE(PyArrayObject *arr)
|
1631 |
+
{
|
1632 |
+
return ((PyArrayObject_fields *)arr)->descr;
|
1633 |
+
}
|
1634 |
+
|
1635 |
+
static inline npy_intp *
|
1636 |
+
PyArray_SHAPE(PyArrayObject *arr)
|
1637 |
+
{
|
1638 |
+
return ((PyArrayObject_fields *)arr)->dimensions;
|
1639 |
+
}
|
1640 |
+
|
1641 |
+
/*
|
1642 |
+
* Enables the specified array flags. Does no checking,
|
1643 |
+
* assumes you know what you're doing.
|
1644 |
+
*/
|
1645 |
+
static inline void
|
1646 |
+
PyArray_ENABLEFLAGS(PyArrayObject *arr, int flags)
|
1647 |
+
{
|
1648 |
+
((PyArrayObject_fields *)arr)->flags |= flags;
|
1649 |
+
}
|
1650 |
+
|
1651 |
+
/*
|
1652 |
+
* Clears the specified array flags. Does no checking,
|
1653 |
+
* assumes you know what you're doing.
|
1654 |
+
*/
|
1655 |
+
static inline void
|
1656 |
+
PyArray_CLEARFLAGS(PyArrayObject *arr, int flags)
|
1657 |
+
{
|
1658 |
+
((PyArrayObject_fields *)arr)->flags &= ~flags;
|
1659 |
+
}
|
1660 |
+
|
1661 |
+
#if NPY_FEATURE_VERSION >= NPY_1_22_API_VERSION
|
1662 |
+
static inline NPY_RETURNS_BORROWED_REF PyObject *
|
1663 |
+
PyArray_HANDLER(PyArrayObject *arr)
|
1664 |
+
{
|
1665 |
+
return ((PyArrayObject_fields *)arr)->mem_handler;
|
1666 |
+
}
|
1667 |
+
#endif
|
1668 |
+
|
1669 |
+
#define PyTypeNum_ISBOOL(type) ((type) == NPY_BOOL)
|
1670 |
+
|
1671 |
+
#define PyTypeNum_ISUNSIGNED(type) (((type) == NPY_UBYTE) || \
|
1672 |
+
((type) == NPY_USHORT) || \
|
1673 |
+
((type) == NPY_UINT) || \
|
1674 |
+
((type) == NPY_ULONG) || \
|
1675 |
+
((type) == NPY_ULONGLONG))
|
1676 |
+
|
1677 |
+
#define PyTypeNum_ISSIGNED(type) (((type) == NPY_BYTE) || \
|
1678 |
+
((type) == NPY_SHORT) || \
|
1679 |
+
((type) == NPY_INT) || \
|
1680 |
+
((type) == NPY_LONG) || \
|
1681 |
+
((type) == NPY_LONGLONG))
|
1682 |
+
|
1683 |
+
#define PyTypeNum_ISINTEGER(type) (((type) >= NPY_BYTE) && \
|
1684 |
+
((type) <= NPY_ULONGLONG))
|
1685 |
+
|
1686 |
+
#define PyTypeNum_ISFLOAT(type) ((((type) >= NPY_FLOAT) && \
|
1687 |
+
((type) <= NPY_LONGDOUBLE)) || \
|
1688 |
+
((type) == NPY_HALF))
|
1689 |
+
|
1690 |
+
#define PyTypeNum_ISNUMBER(type) (((type) <= NPY_CLONGDOUBLE) || \
|
1691 |
+
((type) == NPY_HALF))
|
1692 |
+
|
1693 |
+
#define PyTypeNum_ISSTRING(type) (((type) == NPY_STRING) || \
|
1694 |
+
((type) == NPY_UNICODE))
|
1695 |
+
|
1696 |
+
#define PyTypeNum_ISCOMPLEX(type) (((type) >= NPY_CFLOAT) && \
|
1697 |
+
((type) <= NPY_CLONGDOUBLE))
|
1698 |
+
|
1699 |
+
#define PyTypeNum_ISPYTHON(type) (((type) == NPY_LONG) || \
|
1700 |
+
((type) == NPY_DOUBLE) || \
|
1701 |
+
((type) == NPY_CDOUBLE) || \
|
1702 |
+
((type) == NPY_BOOL) || \
|
1703 |
+
((type) == NPY_OBJECT ))
|
1704 |
+
|
1705 |
+
#define PyTypeNum_ISFLEXIBLE(type) (((type) >=NPY_STRING) && \
|
1706 |
+
((type) <=NPY_VOID))
|
1707 |
+
|
1708 |
+
#define PyTypeNum_ISDATETIME(type) (((type) >=NPY_DATETIME) && \
|
1709 |
+
((type) <=NPY_TIMEDELTA))
|
1710 |
+
|
1711 |
+
#define PyTypeNum_ISUSERDEF(type) (((type) >= NPY_USERDEF) && \
|
1712 |
+
((type) < NPY_USERDEF+ \
|
1713 |
+
NPY_NUMUSERTYPES))
|
1714 |
+
|
1715 |
+
#define PyTypeNum_ISEXTENDED(type) (PyTypeNum_ISFLEXIBLE(type) || \
|
1716 |
+
PyTypeNum_ISUSERDEF(type))
|
1717 |
+
|
1718 |
+
#define PyTypeNum_ISOBJECT(type) ((type) == NPY_OBJECT)
|
1719 |
+
|
1720 |
+
|
1721 |
+
#define PyDataType_ISBOOL(obj) PyTypeNum_ISBOOL(((PyArray_Descr*)(obj))->type_num)
|
1722 |
+
#define PyDataType_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(((PyArray_Descr*)(obj))->type_num)
|
1723 |
+
#define PyDataType_ISSIGNED(obj) PyTypeNum_ISSIGNED(((PyArray_Descr*)(obj))->type_num)
|
1724 |
+
#define PyDataType_ISINTEGER(obj) PyTypeNum_ISINTEGER(((PyArray_Descr*)(obj))->type_num )
|
1725 |
+
#define PyDataType_ISFLOAT(obj) PyTypeNum_ISFLOAT(((PyArray_Descr*)(obj))->type_num)
|
1726 |
+
#define PyDataType_ISNUMBER(obj) PyTypeNum_ISNUMBER(((PyArray_Descr*)(obj))->type_num)
|
1727 |
+
#define PyDataType_ISSTRING(obj) PyTypeNum_ISSTRING(((PyArray_Descr*)(obj))->type_num)
|
1728 |
+
#define PyDataType_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(((PyArray_Descr*)(obj))->type_num)
|
1729 |
+
#define PyDataType_ISPYTHON(obj) PyTypeNum_ISPYTHON(((PyArray_Descr*)(obj))->type_num)
|
1730 |
+
#define PyDataType_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(((PyArray_Descr*)(obj))->type_num)
|
1731 |
+
#define PyDataType_ISDATETIME(obj) PyTypeNum_ISDATETIME(((PyArray_Descr*)(obj))->type_num)
|
1732 |
+
#define PyDataType_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(((PyArray_Descr*)(obj))->type_num)
|
1733 |
+
#define PyDataType_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(((PyArray_Descr*)(obj))->type_num)
|
1734 |
+
#define PyDataType_ISOBJECT(obj) PyTypeNum_ISOBJECT(((PyArray_Descr*)(obj))->type_num)
|
1735 |
+
#define PyDataType_HASFIELDS(obj) (((PyArray_Descr *)(obj))->names != NULL)
|
1736 |
+
#define PyDataType_HASSUBARRAY(dtype) ((dtype)->subarray != NULL)
|
1737 |
+
#define PyDataType_ISUNSIZED(dtype) ((dtype)->elsize == 0 && \
|
1738 |
+
!PyDataType_HASFIELDS(dtype))
|
1739 |
+
#define PyDataType_MAKEUNSIZED(dtype) ((dtype)->elsize = 0)
|
1740 |
+
|
1741 |
+
#define PyArray_ISBOOL(obj) PyTypeNum_ISBOOL(PyArray_TYPE(obj))
|
1742 |
+
#define PyArray_ISUNSIGNED(obj) PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj))
|
1743 |
+
#define PyArray_ISSIGNED(obj) PyTypeNum_ISSIGNED(PyArray_TYPE(obj))
|
1744 |
+
#define PyArray_ISINTEGER(obj) PyTypeNum_ISINTEGER(PyArray_TYPE(obj))
|
1745 |
+
#define PyArray_ISFLOAT(obj) PyTypeNum_ISFLOAT(PyArray_TYPE(obj))
|
1746 |
+
#define PyArray_ISNUMBER(obj) PyTypeNum_ISNUMBER(PyArray_TYPE(obj))
|
1747 |
+
#define PyArray_ISSTRING(obj) PyTypeNum_ISSTRING(PyArray_TYPE(obj))
|
1748 |
+
#define PyArray_ISCOMPLEX(obj) PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))
|
1749 |
+
#define PyArray_ISPYTHON(obj) PyTypeNum_ISPYTHON(PyArray_TYPE(obj))
|
1750 |
+
#define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))
|
1751 |
+
#define PyArray_ISDATETIME(obj) PyTypeNum_ISDATETIME(PyArray_TYPE(obj))
|
1752 |
+
#define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))
|
1753 |
+
#define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))
|
1754 |
+
#define PyArray_ISOBJECT(obj) PyTypeNum_ISOBJECT(PyArray_TYPE(obj))
|
1755 |
+
#define PyArray_HASFIELDS(obj) PyDataType_HASFIELDS(PyArray_DESCR(obj))
|
1756 |
+
|
1757 |
+
/*
|
1758 |
+
* FIXME: This should check for a flag on the data-type that
|
1759 |
+
* states whether or not it is variable length. Because the
|
1760 |
+
* ISFLEXIBLE check is hard-coded to the built-in data-types.
|
1761 |
+
*/
|
1762 |
+
#define PyArray_ISVARIABLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))
|
1763 |
+
|
1764 |
+
#define PyArray_SAFEALIGNEDCOPY(obj) (PyArray_ISALIGNED(obj) && !PyArray_ISVARIABLE(obj))
|
1765 |
+
|
1766 |
+
|
1767 |
+
#define NPY_LITTLE '<'
|
1768 |
+
#define NPY_BIG '>'
|
1769 |
+
#define NPY_NATIVE '='
|
1770 |
+
#define NPY_SWAP 's'
|
1771 |
+
#define NPY_IGNORE '|'
|
1772 |
+
|
1773 |
+
#if NPY_BYTE_ORDER == NPY_BIG_ENDIAN
|
1774 |
+
#define NPY_NATBYTE NPY_BIG
|
1775 |
+
#define NPY_OPPBYTE NPY_LITTLE
|
1776 |
+
#else
|
1777 |
+
#define NPY_NATBYTE NPY_LITTLE
|
1778 |
+
#define NPY_OPPBYTE NPY_BIG
|
1779 |
+
#endif
|
1780 |
+
|
1781 |
+
#define PyArray_ISNBO(arg) ((arg) != NPY_OPPBYTE)
|
1782 |
+
#define PyArray_IsNativeByteOrder PyArray_ISNBO
|
1783 |
+
#define PyArray_ISNOTSWAPPED(m) PyArray_ISNBO(PyArray_DESCR(m)->byteorder)
|
1784 |
+
#define PyArray_ISBYTESWAPPED(m) (!PyArray_ISNOTSWAPPED(m))
|
1785 |
+
|
1786 |
+
#define PyArray_FLAGSWAP(m, flags) (PyArray_CHKFLAGS(m, flags) && \
|
1787 |
+
PyArray_ISNOTSWAPPED(m))
|
1788 |
+
|
1789 |
+
#define PyArray_ISCARRAY(m) PyArray_FLAGSWAP(m, NPY_ARRAY_CARRAY)
|
1790 |
+
#define PyArray_ISCARRAY_RO(m) PyArray_FLAGSWAP(m, NPY_ARRAY_CARRAY_RO)
|
1791 |
+
#define PyArray_ISFARRAY(m) PyArray_FLAGSWAP(m, NPY_ARRAY_FARRAY)
|
1792 |
+
#define PyArray_ISFARRAY_RO(m) PyArray_FLAGSWAP(m, NPY_ARRAY_FARRAY_RO)
|
1793 |
+
#define PyArray_ISBEHAVED(m) PyArray_FLAGSWAP(m, NPY_ARRAY_BEHAVED)
|
1794 |
+
#define PyArray_ISBEHAVED_RO(m) PyArray_FLAGSWAP(m, NPY_ARRAY_ALIGNED)
|
1795 |
+
|
1796 |
+
|
1797 |
+
#define PyDataType_ISNOTSWAPPED(d) PyArray_ISNBO(((PyArray_Descr *)(d))->byteorder)
|
1798 |
+
#define PyDataType_ISBYTESWAPPED(d) (!PyDataType_ISNOTSWAPPED(d))
|
1799 |
+
|
1800 |
+
/************************************************************
|
1801 |
+
* A struct used by PyArray_CreateSortedStridePerm, new in 1.7.
|
1802 |
+
************************************************************/
|
1803 |
+
|
1804 |
+
typedef struct {
|
1805 |
+
npy_intp perm, stride;
|
1806 |
+
} npy_stride_sort_item;
|
1807 |
+
|
1808 |
+
/************************************************************
|
1809 |
+
* This is the form of the struct that's stored in the
|
1810 |
+
* PyCapsule returned by an array's __array_struct__ attribute. See
|
1811 |
+
* https://docs.scipy.org/doc/numpy/reference/arrays.interface.html for the full
|
1812 |
+
* documentation.
|
1813 |
+
************************************************************/
|
1814 |
+
typedef struct {
|
1815 |
+
int two; /*
|
1816 |
+
* contains the integer 2 as a sanity
|
1817 |
+
* check
|
1818 |
+
*/
|
1819 |
+
|
1820 |
+
int nd; /* number of dimensions */
|
1821 |
+
|
1822 |
+
char typekind; /*
|
1823 |
+
* kind in array --- character code of
|
1824 |
+
* typestr
|
1825 |
+
*/
|
1826 |
+
|
1827 |
+
int itemsize; /* size of each element */
|
1828 |
+
|
1829 |
+
int flags; /*
|
1830 |
+
* how should be data interpreted. Valid
|
1831 |
+
* flags are CONTIGUOUS (1), F_CONTIGUOUS (2),
|
1832 |
+
* ALIGNED (0x100), NOTSWAPPED (0x200), and
|
1833 |
+
* WRITEABLE (0x400). ARR_HAS_DESCR (0x800)
|
1834 |
+
* states that arrdescr field is present in
|
1835 |
+
* structure
|
1836 |
+
*/
|
1837 |
+
|
1838 |
+
npy_intp *shape; /*
|
1839 |
+
* A length-nd array of shape
|
1840 |
+
* information
|
1841 |
+
*/
|
1842 |
+
|
1843 |
+
npy_intp *strides; /* A length-nd array of stride information */
|
1844 |
+
|
1845 |
+
void *data; /* A pointer to the first element of the array */
|
1846 |
+
|
1847 |
+
PyObject *descr; /*
|
1848 |
+
* A list of fields or NULL (ignored if flags
|
1849 |
+
* does not have ARR_HAS_DESCR flag set)
|
1850 |
+
*/
|
1851 |
+
} PyArrayInterface;
|
1852 |
+
|
1853 |
+
/*
|
1854 |
+
* This is a function for hooking into the PyDataMem_NEW/FREE/RENEW functions.
|
1855 |
+
* See the documentation for PyDataMem_SetEventHook.
|
1856 |
+
*/
|
1857 |
+
typedef void (PyDataMem_EventHookFunc)(void *inp, void *outp, size_t size,
|
1858 |
+
void *user_data);
|
1859 |
+
|
1860 |
+
|
1861 |
+
/*
|
1862 |
+
* PyArray_DTypeMeta related definitions.
|
1863 |
+
*
|
1864 |
+
* As of now, this API is preliminary and will be extended as necessary.
|
1865 |
+
*/
|
1866 |
+
#if defined(NPY_INTERNAL_BUILD) && NPY_INTERNAL_BUILD
|
1867 |
+
/*
|
1868 |
+
* The Structures defined in this block are currently considered
|
1869 |
+
* private API and may change without warning!
|
1870 |
+
* Part of this (at least the size) is expected to be public API without
|
1871 |
+
* further modifications.
|
1872 |
+
*/
|
1873 |
+
/* TODO: Make this definition public in the API, as soon as its settled */
|
1874 |
+
NPY_NO_EXPORT extern PyTypeObject PyArrayDTypeMeta_Type;
|
1875 |
+
|
1876 |
+
/*
|
1877 |
+
* While NumPy DTypes would not need to be heap types the plan is to
|
1878 |
+
* make DTypes available in Python at which point they will be heap types.
|
1879 |
+
* Since we also wish to add fields to the DType class, this looks like
|
1880 |
+
* a typical instance definition, but with PyHeapTypeObject instead of
|
1881 |
+
* only the PyObject_HEAD.
|
1882 |
+
* This must only be exposed very extremely careful consideration, since
|
1883 |
+
* it is a fairly complex construct which may be better to allow
|
1884 |
+
* refactoring of.
|
1885 |
+
*/
|
1886 |
+
typedef struct {
|
1887 |
+
PyHeapTypeObject super;
|
1888 |
+
|
1889 |
+
/*
|
1890 |
+
* Most DTypes will have a singleton default instance, for the
|
1891 |
+
* parametric legacy DTypes (bytes, string, void, datetime) this
|
1892 |
+
* may be a pointer to the *prototype* instance?
|
1893 |
+
*/
|
1894 |
+
PyArray_Descr *singleton;
|
1895 |
+
/* Copy of the legacy DTypes type number, usually invalid. */
|
1896 |
+
int type_num;
|
1897 |
+
|
1898 |
+
/* The type object of the scalar instances (may be NULL?) */
|
1899 |
+
PyTypeObject *scalar_type;
|
1900 |
+
/*
|
1901 |
+
* DType flags to signal legacy, parametric, or
|
1902 |
+
* abstract. But plenty of space for additional information/flags.
|
1903 |
+
*/
|
1904 |
+
npy_uint64 flags;
|
1905 |
+
|
1906 |
+
/*
|
1907 |
+
* Use indirection in order to allow a fixed size for this struct.
|
1908 |
+
* A stable ABI size makes creating a static DType less painful
|
1909 |
+
* while also ensuring flexibility for all opaque API (with one
|
1910 |
+
* indirection due the pointer lookup).
|
1911 |
+
*/
|
1912 |
+
void *dt_slots;
|
1913 |
+
void *reserved[3];
|
1914 |
+
} PyArray_DTypeMeta;
|
1915 |
+
|
1916 |
+
#endif /* NPY_INTERNAL_BUILD */
|
1917 |
+
|
1918 |
+
|
1919 |
+
/*
|
1920 |
+
* Use the keyword NPY_DEPRECATED_INCLUDES to ensure that the header files
|
1921 |
+
* npy_*_*_deprecated_api.h are only included from here and nowhere else.
|
1922 |
+
*/
|
1923 |
+
#ifdef NPY_DEPRECATED_INCLUDES
|
1924 |
+
#error "Do not use the reserved keyword NPY_DEPRECATED_INCLUDES."
|
1925 |
+
#endif
|
1926 |
+
#define NPY_DEPRECATED_INCLUDES
|
1927 |
+
#if !defined(NPY_NO_DEPRECATED_API) || \
|
1928 |
+
(NPY_NO_DEPRECATED_API < NPY_1_7_API_VERSION)
|
1929 |
+
#include "npy_1_7_deprecated_api.h"
|
1930 |
+
#endif
|
1931 |
+
/*
|
1932 |
+
* There is no file npy_1_8_deprecated_api.h since there are no additional
|
1933 |
+
* deprecated API features in NumPy 1.8.
|
1934 |
+
*
|
1935 |
+
* Note to maintainers: insert code like the following in future NumPy
|
1936 |
+
* versions.
|
1937 |
+
*
|
1938 |
+
* #if !defined(NPY_NO_DEPRECATED_API) || \
|
1939 |
+
* (NPY_NO_DEPRECATED_API < NPY_1_9_API_VERSION)
|
1940 |
+
* #include "npy_1_9_deprecated_api.h"
|
1941 |
+
* #endif
|
1942 |
+
*/
|
1943 |
+
#undef NPY_DEPRECATED_INCLUDES
|
1944 |
+
|
1945 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/noprefix.h
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NOPREFIX_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_NOPREFIX_H_
|
3 |
+
|
4 |
+
/*
|
5 |
+
* You can directly include noprefix.h as a backward
|
6 |
+
* compatibility measure
|
7 |
+
*/
|
8 |
+
#ifndef NPY_NO_PREFIX
|
9 |
+
#include "ndarrayobject.h"
|
10 |
+
#include "npy_interrupt.h"
|
11 |
+
#endif
|
12 |
+
|
13 |
+
#define SIGSETJMP NPY_SIGSETJMP
|
14 |
+
#define SIGLONGJMP NPY_SIGLONGJMP
|
15 |
+
#define SIGJMP_BUF NPY_SIGJMP_BUF
|
16 |
+
|
17 |
+
#define MAX_DIMS NPY_MAXDIMS
|
18 |
+
|
19 |
+
#define longlong npy_longlong
|
20 |
+
#define ulonglong npy_ulonglong
|
21 |
+
#define Bool npy_bool
|
22 |
+
#define longdouble npy_longdouble
|
23 |
+
#define byte npy_byte
|
24 |
+
|
25 |
+
#ifndef _BSD_SOURCE
|
26 |
+
#define ushort npy_ushort
|
27 |
+
#define uint npy_uint
|
28 |
+
#define ulong npy_ulong
|
29 |
+
#endif
|
30 |
+
|
31 |
+
#define ubyte npy_ubyte
|
32 |
+
#define ushort npy_ushort
|
33 |
+
#define uint npy_uint
|
34 |
+
#define ulong npy_ulong
|
35 |
+
#define cfloat npy_cfloat
|
36 |
+
#define cdouble npy_cdouble
|
37 |
+
#define clongdouble npy_clongdouble
|
38 |
+
#define Int8 npy_int8
|
39 |
+
#define UInt8 npy_uint8
|
40 |
+
#define Int16 npy_int16
|
41 |
+
#define UInt16 npy_uint16
|
42 |
+
#define Int32 npy_int32
|
43 |
+
#define UInt32 npy_uint32
|
44 |
+
#define Int64 npy_int64
|
45 |
+
#define UInt64 npy_uint64
|
46 |
+
#define Int128 npy_int128
|
47 |
+
#define UInt128 npy_uint128
|
48 |
+
#define Int256 npy_int256
|
49 |
+
#define UInt256 npy_uint256
|
50 |
+
#define Float16 npy_float16
|
51 |
+
#define Complex32 npy_complex32
|
52 |
+
#define Float32 npy_float32
|
53 |
+
#define Complex64 npy_complex64
|
54 |
+
#define Float64 npy_float64
|
55 |
+
#define Complex128 npy_complex128
|
56 |
+
#define Float80 npy_float80
|
57 |
+
#define Complex160 npy_complex160
|
58 |
+
#define Float96 npy_float96
|
59 |
+
#define Complex192 npy_complex192
|
60 |
+
#define Float128 npy_float128
|
61 |
+
#define Complex256 npy_complex256
|
62 |
+
#define intp npy_intp
|
63 |
+
#define uintp npy_uintp
|
64 |
+
#define datetime npy_datetime
|
65 |
+
#define timedelta npy_timedelta
|
66 |
+
|
67 |
+
#define SIZEOF_LONGLONG NPY_SIZEOF_LONGLONG
|
68 |
+
#define SIZEOF_INTP NPY_SIZEOF_INTP
|
69 |
+
#define SIZEOF_UINTP NPY_SIZEOF_UINTP
|
70 |
+
#define SIZEOF_HALF NPY_SIZEOF_HALF
|
71 |
+
#define SIZEOF_LONGDOUBLE NPY_SIZEOF_LONGDOUBLE
|
72 |
+
#define SIZEOF_DATETIME NPY_SIZEOF_DATETIME
|
73 |
+
#define SIZEOF_TIMEDELTA NPY_SIZEOF_TIMEDELTA
|
74 |
+
|
75 |
+
#define LONGLONG_FMT NPY_LONGLONG_FMT
|
76 |
+
#define ULONGLONG_FMT NPY_ULONGLONG_FMT
|
77 |
+
#define LONGLONG_SUFFIX NPY_LONGLONG_SUFFIX
|
78 |
+
#define ULONGLONG_SUFFIX NPY_ULONGLONG_SUFFIX
|
79 |
+
|
80 |
+
#define MAX_INT8 127
|
81 |
+
#define MIN_INT8 -128
|
82 |
+
#define MAX_UINT8 255
|
83 |
+
#define MAX_INT16 32767
|
84 |
+
#define MIN_INT16 -32768
|
85 |
+
#define MAX_UINT16 65535
|
86 |
+
#define MAX_INT32 2147483647
|
87 |
+
#define MIN_INT32 (-MAX_INT32 - 1)
|
88 |
+
#define MAX_UINT32 4294967295U
|
89 |
+
#define MAX_INT64 LONGLONG_SUFFIX(9223372036854775807)
|
90 |
+
#define MIN_INT64 (-MAX_INT64 - LONGLONG_SUFFIX(1))
|
91 |
+
#define MAX_UINT64 ULONGLONG_SUFFIX(18446744073709551615)
|
92 |
+
#define MAX_INT128 LONGLONG_SUFFIX(85070591730234615865843651857942052864)
|
93 |
+
#define MIN_INT128 (-MAX_INT128 - LONGLONG_SUFFIX(1))
|
94 |
+
#define MAX_UINT128 ULONGLONG_SUFFIX(170141183460469231731687303715884105728)
|
95 |
+
#define MAX_INT256 LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967)
|
96 |
+
#define MIN_INT256 (-MAX_INT256 - LONGLONG_SUFFIX(1))
|
97 |
+
#define MAX_UINT256 ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935)
|
98 |
+
|
99 |
+
#define MAX_BYTE NPY_MAX_BYTE
|
100 |
+
#define MIN_BYTE NPY_MIN_BYTE
|
101 |
+
#define MAX_UBYTE NPY_MAX_UBYTE
|
102 |
+
#define MAX_SHORT NPY_MAX_SHORT
|
103 |
+
#define MIN_SHORT NPY_MIN_SHORT
|
104 |
+
#define MAX_USHORT NPY_MAX_USHORT
|
105 |
+
#define MAX_INT NPY_MAX_INT
|
106 |
+
#define MIN_INT NPY_MIN_INT
|
107 |
+
#define MAX_UINT NPY_MAX_UINT
|
108 |
+
#define MAX_LONG NPY_MAX_LONG
|
109 |
+
#define MIN_LONG NPY_MIN_LONG
|
110 |
+
#define MAX_ULONG NPY_MAX_ULONG
|
111 |
+
#define MAX_LONGLONG NPY_MAX_LONGLONG
|
112 |
+
#define MIN_LONGLONG NPY_MIN_LONGLONG
|
113 |
+
#define MAX_ULONGLONG NPY_MAX_ULONGLONG
|
114 |
+
#define MIN_DATETIME NPY_MIN_DATETIME
|
115 |
+
#define MAX_DATETIME NPY_MAX_DATETIME
|
116 |
+
#define MIN_TIMEDELTA NPY_MIN_TIMEDELTA
|
117 |
+
#define MAX_TIMEDELTA NPY_MAX_TIMEDELTA
|
118 |
+
|
119 |
+
#define BITSOF_BOOL NPY_BITSOF_BOOL
|
120 |
+
#define BITSOF_CHAR NPY_BITSOF_CHAR
|
121 |
+
#define BITSOF_SHORT NPY_BITSOF_SHORT
|
122 |
+
#define BITSOF_INT NPY_BITSOF_INT
|
123 |
+
#define BITSOF_LONG NPY_BITSOF_LONG
|
124 |
+
#define BITSOF_LONGLONG NPY_BITSOF_LONGLONG
|
125 |
+
#define BITSOF_HALF NPY_BITSOF_HALF
|
126 |
+
#define BITSOF_FLOAT NPY_BITSOF_FLOAT
|
127 |
+
#define BITSOF_DOUBLE NPY_BITSOF_DOUBLE
|
128 |
+
#define BITSOF_LONGDOUBLE NPY_BITSOF_LONGDOUBLE
|
129 |
+
#define BITSOF_DATETIME NPY_BITSOF_DATETIME
|
130 |
+
#define BITSOF_TIMEDELTA NPY_BITSOF_TIMEDELTA
|
131 |
+
|
132 |
+
#define _pya_malloc PyArray_malloc
|
133 |
+
#define _pya_free PyArray_free
|
134 |
+
#define _pya_realloc PyArray_realloc
|
135 |
+
|
136 |
+
#define BEGIN_THREADS_DEF NPY_BEGIN_THREADS_DEF
|
137 |
+
#define BEGIN_THREADS NPY_BEGIN_THREADS
|
138 |
+
#define END_THREADS NPY_END_THREADS
|
139 |
+
#define ALLOW_C_API_DEF NPY_ALLOW_C_API_DEF
|
140 |
+
#define ALLOW_C_API NPY_ALLOW_C_API
|
141 |
+
#define DISABLE_C_API NPY_DISABLE_C_API
|
142 |
+
|
143 |
+
#define PY_FAIL NPY_FAIL
|
144 |
+
#define PY_SUCCEED NPY_SUCCEED
|
145 |
+
|
146 |
+
#ifndef TRUE
|
147 |
+
#define TRUE NPY_TRUE
|
148 |
+
#endif
|
149 |
+
|
150 |
+
#ifndef FALSE
|
151 |
+
#define FALSE NPY_FALSE
|
152 |
+
#endif
|
153 |
+
|
154 |
+
#define LONGDOUBLE_FMT NPY_LONGDOUBLE_FMT
|
155 |
+
|
156 |
+
#define CONTIGUOUS NPY_CONTIGUOUS
|
157 |
+
#define C_CONTIGUOUS NPY_C_CONTIGUOUS
|
158 |
+
#define FORTRAN NPY_FORTRAN
|
159 |
+
#define F_CONTIGUOUS NPY_F_CONTIGUOUS
|
160 |
+
#define OWNDATA NPY_OWNDATA
|
161 |
+
#define FORCECAST NPY_FORCECAST
|
162 |
+
#define ENSURECOPY NPY_ENSURECOPY
|
163 |
+
#define ENSUREARRAY NPY_ENSUREARRAY
|
164 |
+
#define ELEMENTSTRIDES NPY_ELEMENTSTRIDES
|
165 |
+
#define ALIGNED NPY_ALIGNED
|
166 |
+
#define NOTSWAPPED NPY_NOTSWAPPED
|
167 |
+
#define WRITEABLE NPY_WRITEABLE
|
168 |
+
#define WRITEBACKIFCOPY NPY_ARRAY_WRITEBACKIFCOPY
|
169 |
+
#define ARR_HAS_DESCR NPY_ARR_HAS_DESCR
|
170 |
+
#define BEHAVED NPY_BEHAVED
|
171 |
+
#define BEHAVED_NS NPY_BEHAVED_NS
|
172 |
+
#define CARRAY NPY_CARRAY
|
173 |
+
#define CARRAY_RO NPY_CARRAY_RO
|
174 |
+
#define FARRAY NPY_FARRAY
|
175 |
+
#define FARRAY_RO NPY_FARRAY_RO
|
176 |
+
#define DEFAULT NPY_DEFAULT
|
177 |
+
#define IN_ARRAY NPY_IN_ARRAY
|
178 |
+
#define OUT_ARRAY NPY_OUT_ARRAY
|
179 |
+
#define INOUT_ARRAY NPY_INOUT_ARRAY
|
180 |
+
#define IN_FARRAY NPY_IN_FARRAY
|
181 |
+
#define OUT_FARRAY NPY_OUT_FARRAY
|
182 |
+
#define INOUT_FARRAY NPY_INOUT_FARRAY
|
183 |
+
#define UPDATE_ALL NPY_UPDATE_ALL
|
184 |
+
|
185 |
+
#define OWN_DATA NPY_OWNDATA
|
186 |
+
#define BEHAVED_FLAGS NPY_BEHAVED
|
187 |
+
#define BEHAVED_FLAGS_NS NPY_BEHAVED_NS
|
188 |
+
#define CARRAY_FLAGS_RO NPY_CARRAY_RO
|
189 |
+
#define CARRAY_FLAGS NPY_CARRAY
|
190 |
+
#define FARRAY_FLAGS NPY_FARRAY
|
191 |
+
#define FARRAY_FLAGS_RO NPY_FARRAY_RO
|
192 |
+
#define DEFAULT_FLAGS NPY_DEFAULT
|
193 |
+
#define UPDATE_ALL_FLAGS NPY_UPDATE_ALL_FLAGS
|
194 |
+
|
195 |
+
#ifndef MIN
|
196 |
+
#define MIN PyArray_MIN
|
197 |
+
#endif
|
198 |
+
#ifndef MAX
|
199 |
+
#define MAX PyArray_MAX
|
200 |
+
#endif
|
201 |
+
#define MAX_INTP NPY_MAX_INTP
|
202 |
+
#define MIN_INTP NPY_MIN_INTP
|
203 |
+
#define MAX_UINTP NPY_MAX_UINTP
|
204 |
+
#define INTP_FMT NPY_INTP_FMT
|
205 |
+
|
206 |
+
#ifndef PYPY_VERSION
|
207 |
+
#define REFCOUNT PyArray_REFCOUNT
|
208 |
+
#define MAX_ELSIZE NPY_MAX_ELSIZE
|
209 |
+
#endif
|
210 |
+
|
211 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_NOPREFIX_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_common.h
ADDED
@@ -0,0 +1,1086 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_
|
3 |
+
|
4 |
+
/* need Python.h for npy_intp, npy_uintp */
|
5 |
+
#include <Python.h>
|
6 |
+
|
7 |
+
/* numpconfig.h is auto-generated */
|
8 |
+
#include "numpyconfig.h"
|
9 |
+
#ifdef HAVE_NPY_CONFIG_H
|
10 |
+
#include <npy_config.h>
|
11 |
+
#endif
|
12 |
+
|
13 |
+
/*
|
14 |
+
* using static inline modifiers when defining npy_math functions
|
15 |
+
* allows the compiler to make optimizations when possible
|
16 |
+
*/
|
17 |
+
#ifndef NPY_INLINE_MATH
|
18 |
+
#if defined(NPY_INTERNAL_BUILD) && NPY_INTERNAL_BUILD
|
19 |
+
#define NPY_INLINE_MATH 1
|
20 |
+
#else
|
21 |
+
#define NPY_INLINE_MATH 0
|
22 |
+
#endif
|
23 |
+
#endif
|
24 |
+
|
25 |
+
/*
|
26 |
+
* gcc does not unroll even with -O3
|
27 |
+
* use with care, unrolling on modern cpus rarely speeds things up
|
28 |
+
*/
|
29 |
+
#ifdef HAVE_ATTRIBUTE_OPTIMIZE_UNROLL_LOOPS
|
30 |
+
#define NPY_GCC_UNROLL_LOOPS \
|
31 |
+
__attribute__((optimize("unroll-loops")))
|
32 |
+
#else
|
33 |
+
#define NPY_GCC_UNROLL_LOOPS
|
34 |
+
#endif
|
35 |
+
|
36 |
+
/* highest gcc optimization level, enabled autovectorizer */
|
37 |
+
#ifdef HAVE_ATTRIBUTE_OPTIMIZE_OPT_3
|
38 |
+
#define NPY_GCC_OPT_3 __attribute__((optimize("O3")))
|
39 |
+
#else
|
40 |
+
#define NPY_GCC_OPT_3
|
41 |
+
#endif
|
42 |
+
|
43 |
+
/*
|
44 |
+
* mark an argument (starting from 1) that must not be NULL and is not checked
|
45 |
+
* DO NOT USE IF FUNCTION CHECKS FOR NULL!! the compiler will remove the check
|
46 |
+
*/
|
47 |
+
#ifdef HAVE_ATTRIBUTE_NONNULL
|
48 |
+
#define NPY_GCC_NONNULL(n) __attribute__((nonnull(n)))
|
49 |
+
#else
|
50 |
+
#define NPY_GCC_NONNULL(n)
|
51 |
+
#endif
|
52 |
+
|
53 |
+
/*
|
54 |
+
* give a hint to the compiler which branch is more likely or unlikely
|
55 |
+
* to occur, e.g. rare error cases:
|
56 |
+
*
|
57 |
+
* if (NPY_UNLIKELY(failure == 0))
|
58 |
+
* return NULL;
|
59 |
+
*
|
60 |
+
* the double !! is to cast the expression (e.g. NULL) to a boolean required by
|
61 |
+
* the intrinsic
|
62 |
+
*/
|
63 |
+
#ifdef HAVE___BUILTIN_EXPECT
|
64 |
+
#define NPY_LIKELY(x) __builtin_expect(!!(x), 1)
|
65 |
+
#define NPY_UNLIKELY(x) __builtin_expect(!!(x), 0)
|
66 |
+
#else
|
67 |
+
#define NPY_LIKELY(x) (x)
|
68 |
+
#define NPY_UNLIKELY(x) (x)
|
69 |
+
#endif
|
70 |
+
|
71 |
+
#ifdef HAVE___BUILTIN_PREFETCH
|
72 |
+
/* unlike _mm_prefetch also works on non-x86 */
|
73 |
+
#define NPY_PREFETCH(x, rw, loc) __builtin_prefetch((x), (rw), (loc))
|
74 |
+
#else
|
75 |
+
#ifdef NPY_HAVE_SSE
|
76 |
+
/* _MM_HINT_ET[01] (rw = 1) unsupported, only available in gcc >= 4.9 */
|
77 |
+
#define NPY_PREFETCH(x, rw, loc) _mm_prefetch((x), loc == 0 ? _MM_HINT_NTA : \
|
78 |
+
(loc == 1 ? _MM_HINT_T2 : \
|
79 |
+
(loc == 2 ? _MM_HINT_T1 : \
|
80 |
+
(loc == 3 ? _MM_HINT_T0 : -1))))
|
81 |
+
#else
|
82 |
+
#define NPY_PREFETCH(x, rw,loc)
|
83 |
+
#endif
|
84 |
+
#endif
|
85 |
+
|
86 |
+
/* `NPY_INLINE` kept for backwards compatibility; use `inline` instead */
|
87 |
+
#if defined(_MSC_VER) && !defined(__clang__)
|
88 |
+
#define NPY_INLINE __inline
|
89 |
+
/* clang included here to handle clang-cl on Windows */
|
90 |
+
#elif defined(__GNUC__) || defined(__clang__)
|
91 |
+
#if defined(__STRICT_ANSI__)
|
92 |
+
#define NPY_INLINE __inline__
|
93 |
+
#else
|
94 |
+
#define NPY_INLINE inline
|
95 |
+
#endif
|
96 |
+
#else
|
97 |
+
#define NPY_INLINE
|
98 |
+
#endif
|
99 |
+
|
100 |
+
#ifdef _MSC_VER
|
101 |
+
#define NPY_FINLINE static __forceinline
|
102 |
+
#elif defined(__GNUC__)
|
103 |
+
#define NPY_FINLINE static inline __attribute__((always_inline))
|
104 |
+
#else
|
105 |
+
#define NPY_FINLINE static
|
106 |
+
#endif
|
107 |
+
|
108 |
+
#if defined(_MSC_VER)
|
109 |
+
#define NPY_NOINLINE static __declspec(noinline)
|
110 |
+
#elif defined(__GNUC__) || defined(__clang__)
|
111 |
+
#define NPY_NOINLINE static __attribute__((noinline))
|
112 |
+
#else
|
113 |
+
#define NPY_NOINLINE static
|
114 |
+
#endif
|
115 |
+
|
116 |
+
#ifdef HAVE___THREAD
|
117 |
+
#define NPY_TLS __thread
|
118 |
+
#else
|
119 |
+
#ifdef HAVE___DECLSPEC_THREAD_
|
120 |
+
#define NPY_TLS __declspec(thread)
|
121 |
+
#else
|
122 |
+
#define NPY_TLS
|
123 |
+
#endif
|
124 |
+
#endif
|
125 |
+
|
126 |
+
#ifdef WITH_CPYCHECKER_RETURNS_BORROWED_REF_ATTRIBUTE
|
127 |
+
#define NPY_RETURNS_BORROWED_REF \
|
128 |
+
__attribute__((cpychecker_returns_borrowed_ref))
|
129 |
+
#else
|
130 |
+
#define NPY_RETURNS_BORROWED_REF
|
131 |
+
#endif
|
132 |
+
|
133 |
+
#ifdef WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUTE
|
134 |
+
#define NPY_STEALS_REF_TO_ARG(n) \
|
135 |
+
__attribute__((cpychecker_steals_reference_to_arg(n)))
|
136 |
+
#else
|
137 |
+
#define NPY_STEALS_REF_TO_ARG(n)
|
138 |
+
#endif
|
139 |
+
|
140 |
+
/* 64 bit file position support, also on win-amd64. Issue gh-2256 */
|
141 |
+
#if defined(_MSC_VER) && defined(_WIN64) && (_MSC_VER > 1400) || \
|
142 |
+
defined(__MINGW32__) || defined(__MINGW64__)
|
143 |
+
#include <io.h>
|
144 |
+
|
145 |
+
#define npy_fseek _fseeki64
|
146 |
+
#define npy_ftell _ftelli64
|
147 |
+
#define npy_lseek _lseeki64
|
148 |
+
#define npy_off_t npy_int64
|
149 |
+
|
150 |
+
#if NPY_SIZEOF_INT == 8
|
151 |
+
#define NPY_OFF_T_PYFMT "i"
|
152 |
+
#elif NPY_SIZEOF_LONG == 8
|
153 |
+
#define NPY_OFF_T_PYFMT "l"
|
154 |
+
#elif NPY_SIZEOF_LONGLONG == 8
|
155 |
+
#define NPY_OFF_T_PYFMT "L"
|
156 |
+
#else
|
157 |
+
#error Unsupported size for type off_t
|
158 |
+
#endif
|
159 |
+
#else
|
160 |
+
#ifdef HAVE_FSEEKO
|
161 |
+
#define npy_fseek fseeko
|
162 |
+
#else
|
163 |
+
#define npy_fseek fseek
|
164 |
+
#endif
|
165 |
+
#ifdef HAVE_FTELLO
|
166 |
+
#define npy_ftell ftello
|
167 |
+
#else
|
168 |
+
#define npy_ftell ftell
|
169 |
+
#endif
|
170 |
+
#include <sys/types.h>
|
171 |
+
#ifndef _WIN32
|
172 |
+
#include <unistd.h>
|
173 |
+
#endif
|
174 |
+
#define npy_lseek lseek
|
175 |
+
#define npy_off_t off_t
|
176 |
+
|
177 |
+
#if NPY_SIZEOF_OFF_T == NPY_SIZEOF_SHORT
|
178 |
+
#define NPY_OFF_T_PYFMT "h"
|
179 |
+
#elif NPY_SIZEOF_OFF_T == NPY_SIZEOF_INT
|
180 |
+
#define NPY_OFF_T_PYFMT "i"
|
181 |
+
#elif NPY_SIZEOF_OFF_T == NPY_SIZEOF_LONG
|
182 |
+
#define NPY_OFF_T_PYFMT "l"
|
183 |
+
#elif NPY_SIZEOF_OFF_T == NPY_SIZEOF_LONGLONG
|
184 |
+
#define NPY_OFF_T_PYFMT "L"
|
185 |
+
#else
|
186 |
+
#error Unsupported size for type off_t
|
187 |
+
#endif
|
188 |
+
#endif
|
189 |
+
|
190 |
+
/* enums for detected endianness */
|
191 |
+
enum {
|
192 |
+
NPY_CPU_UNKNOWN_ENDIAN,
|
193 |
+
NPY_CPU_LITTLE,
|
194 |
+
NPY_CPU_BIG
|
195 |
+
};
|
196 |
+
|
197 |
+
/*
|
198 |
+
* This is to typedef npy_intp to the appropriate pointer size for this
|
199 |
+
* platform. Py_intptr_t, Py_uintptr_t are defined in pyport.h.
|
200 |
+
*/
|
201 |
+
typedef Py_intptr_t npy_intp;
|
202 |
+
typedef Py_uintptr_t npy_uintp;
|
203 |
+
|
204 |
+
/*
|
205 |
+
* Define sizes that were not defined in numpyconfig.h.
|
206 |
+
*/
|
207 |
+
#define NPY_SIZEOF_CHAR 1
|
208 |
+
#define NPY_SIZEOF_BYTE 1
|
209 |
+
#define NPY_SIZEOF_DATETIME 8
|
210 |
+
#define NPY_SIZEOF_TIMEDELTA 8
|
211 |
+
#define NPY_SIZEOF_INTP NPY_SIZEOF_PY_INTPTR_T
|
212 |
+
#define NPY_SIZEOF_UINTP NPY_SIZEOF_PY_INTPTR_T
|
213 |
+
#define NPY_SIZEOF_HALF 2
|
214 |
+
#define NPY_SIZEOF_CFLOAT NPY_SIZEOF_COMPLEX_FLOAT
|
215 |
+
#define NPY_SIZEOF_CDOUBLE NPY_SIZEOF_COMPLEX_DOUBLE
|
216 |
+
#define NPY_SIZEOF_CLONGDOUBLE NPY_SIZEOF_COMPLEX_LONGDOUBLE
|
217 |
+
|
218 |
+
#ifdef constchar
|
219 |
+
#undef constchar
|
220 |
+
#endif
|
221 |
+
|
222 |
+
#define NPY_SSIZE_T_PYFMT "n"
|
223 |
+
#define constchar char
|
224 |
+
|
225 |
+
/* NPY_INTP_FMT Note:
|
226 |
+
* Unlike the other NPY_*_FMT macros, which are used with PyOS_snprintf,
|
227 |
+
* NPY_INTP_FMT is used with PyErr_Format and PyUnicode_FromFormat. Those
|
228 |
+
* functions use different formatting codes that are portably specified
|
229 |
+
* according to the Python documentation. See issue gh-2388.
|
230 |
+
*/
|
231 |
+
#if NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_INT
|
232 |
+
#define NPY_INTP NPY_INT
|
233 |
+
#define NPY_UINTP NPY_UINT
|
234 |
+
#define PyIntpArrType_Type PyIntArrType_Type
|
235 |
+
#define PyUIntpArrType_Type PyUIntArrType_Type
|
236 |
+
#define NPY_MAX_INTP NPY_MAX_INT
|
237 |
+
#define NPY_MIN_INTP NPY_MIN_INT
|
238 |
+
#define NPY_MAX_UINTP NPY_MAX_UINT
|
239 |
+
#define NPY_INTP_FMT "d"
|
240 |
+
#elif NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONG
|
241 |
+
#define NPY_INTP NPY_LONG
|
242 |
+
#define NPY_UINTP NPY_ULONG
|
243 |
+
#define PyIntpArrType_Type PyLongArrType_Type
|
244 |
+
#define PyUIntpArrType_Type PyULongArrType_Type
|
245 |
+
#define NPY_MAX_INTP NPY_MAX_LONG
|
246 |
+
#define NPY_MIN_INTP NPY_MIN_LONG
|
247 |
+
#define NPY_MAX_UINTP NPY_MAX_ULONG
|
248 |
+
#define NPY_INTP_FMT "ld"
|
249 |
+
#elif defined(PY_LONG_LONG) && (NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONGLONG)
|
250 |
+
#define NPY_INTP NPY_LONGLONG
|
251 |
+
#define NPY_UINTP NPY_ULONGLONG
|
252 |
+
#define PyIntpArrType_Type PyLongLongArrType_Type
|
253 |
+
#define PyUIntpArrType_Type PyULongLongArrType_Type
|
254 |
+
#define NPY_MAX_INTP NPY_MAX_LONGLONG
|
255 |
+
#define NPY_MIN_INTP NPY_MIN_LONGLONG
|
256 |
+
#define NPY_MAX_UINTP NPY_MAX_ULONGLONG
|
257 |
+
#define NPY_INTP_FMT "lld"
|
258 |
+
#endif
|
259 |
+
|
260 |
+
/*
|
261 |
+
* We can only use C99 formats for npy_int_p if it is the same as
|
262 |
+
* intp_t, hence the condition on HAVE_UNITPTR_T
|
263 |
+
*/
|
264 |
+
#if (NPY_USE_C99_FORMATS) == 1 \
|
265 |
+
&& (defined HAVE_UINTPTR_T) \
|
266 |
+
&& (defined HAVE_INTTYPES_H)
|
267 |
+
#include <inttypes.h>
|
268 |
+
#undef NPY_INTP_FMT
|
269 |
+
#define NPY_INTP_FMT PRIdPTR
|
270 |
+
#endif
|
271 |
+
|
272 |
+
|
273 |
+
/*
|
274 |
+
* Some platforms don't define bool, long long, or long double.
|
275 |
+
* Handle that here.
|
276 |
+
*/
|
277 |
+
#define NPY_BYTE_FMT "hhd"
|
278 |
+
#define NPY_UBYTE_FMT "hhu"
|
279 |
+
#define NPY_SHORT_FMT "hd"
|
280 |
+
#define NPY_USHORT_FMT "hu"
|
281 |
+
#define NPY_INT_FMT "d"
|
282 |
+
#define NPY_UINT_FMT "u"
|
283 |
+
#define NPY_LONG_FMT "ld"
|
284 |
+
#define NPY_ULONG_FMT "lu"
|
285 |
+
#define NPY_HALF_FMT "g"
|
286 |
+
#define NPY_FLOAT_FMT "g"
|
287 |
+
#define NPY_DOUBLE_FMT "g"
|
288 |
+
|
289 |
+
|
290 |
+
#ifdef PY_LONG_LONG
|
291 |
+
typedef PY_LONG_LONG npy_longlong;
|
292 |
+
typedef unsigned PY_LONG_LONG npy_ulonglong;
|
293 |
+
# ifdef _MSC_VER
|
294 |
+
# define NPY_LONGLONG_FMT "I64d"
|
295 |
+
# define NPY_ULONGLONG_FMT "I64u"
|
296 |
+
# else
|
297 |
+
# define NPY_LONGLONG_FMT "lld"
|
298 |
+
# define NPY_ULONGLONG_FMT "llu"
|
299 |
+
# endif
|
300 |
+
# ifdef _MSC_VER
|
301 |
+
# define NPY_LONGLONG_SUFFIX(x) (x##i64)
|
302 |
+
# define NPY_ULONGLONG_SUFFIX(x) (x##Ui64)
|
303 |
+
# else
|
304 |
+
# define NPY_LONGLONG_SUFFIX(x) (x##LL)
|
305 |
+
# define NPY_ULONGLONG_SUFFIX(x) (x##ULL)
|
306 |
+
# endif
|
307 |
+
#else
|
308 |
+
typedef long npy_longlong;
|
309 |
+
typedef unsigned long npy_ulonglong;
|
310 |
+
# define NPY_LONGLONG_SUFFIX(x) (x##L)
|
311 |
+
# define NPY_ULONGLONG_SUFFIX(x) (x##UL)
|
312 |
+
#endif
|
313 |
+
|
314 |
+
|
315 |
+
typedef unsigned char npy_bool;
|
316 |
+
#define NPY_FALSE 0
|
317 |
+
#define NPY_TRUE 1
|
318 |
+
/*
|
319 |
+
* `NPY_SIZEOF_LONGDOUBLE` isn't usually equal to sizeof(long double).
|
320 |
+
* In some certain cases, it may forced to be equal to sizeof(double)
|
321 |
+
* even against the compiler implementation and the same goes for
|
322 |
+
* `complex long double`.
|
323 |
+
*
|
324 |
+
* Therefore, avoid `long double`, use `npy_longdouble` instead,
|
325 |
+
* and when it comes to standard math functions make sure of using
|
326 |
+
* the double version when `NPY_SIZEOF_LONGDOUBLE` == `NPY_SIZEOF_DOUBLE`.
|
327 |
+
* For example:
|
328 |
+
* npy_longdouble *ptr, x;
|
329 |
+
* #if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
|
330 |
+
* npy_longdouble r = modf(x, ptr);
|
331 |
+
* #else
|
332 |
+
* npy_longdouble r = modfl(x, ptr);
|
333 |
+
* #endif
|
334 |
+
*
|
335 |
+
* See https://github.com/numpy/numpy/issues/20348
|
336 |
+
*/
|
337 |
+
#if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
|
338 |
+
#define NPY_LONGDOUBLE_FMT "g"
|
339 |
+
typedef double npy_longdouble;
|
340 |
+
#else
|
341 |
+
#define NPY_LONGDOUBLE_FMT "Lg"
|
342 |
+
typedef long double npy_longdouble;
|
343 |
+
#endif
|
344 |
+
|
345 |
+
#ifndef Py_USING_UNICODE
|
346 |
+
#error Must use Python with unicode enabled.
|
347 |
+
#endif
|
348 |
+
|
349 |
+
|
350 |
+
typedef signed char npy_byte;
|
351 |
+
typedef unsigned char npy_ubyte;
|
352 |
+
typedef unsigned short npy_ushort;
|
353 |
+
typedef unsigned int npy_uint;
|
354 |
+
typedef unsigned long npy_ulong;
|
355 |
+
|
356 |
+
/* These are for completeness */
|
357 |
+
typedef char npy_char;
|
358 |
+
typedef short npy_short;
|
359 |
+
typedef int npy_int;
|
360 |
+
typedef long npy_long;
|
361 |
+
typedef float npy_float;
|
362 |
+
typedef double npy_double;
|
363 |
+
|
364 |
+
typedef Py_hash_t npy_hash_t;
|
365 |
+
#define NPY_SIZEOF_HASH_T NPY_SIZEOF_INTP
|
366 |
+
|
367 |
+
/*
|
368 |
+
* Disabling C99 complex usage: a lot of C code in numpy/scipy rely on being
|
369 |
+
* able to do .real/.imag. Will have to convert code first.
|
370 |
+
*/
|
371 |
+
#if 0
|
372 |
+
#if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_DOUBLE)
|
373 |
+
typedef complex npy_cdouble;
|
374 |
+
#else
|
375 |
+
typedef struct { double real, imag; } npy_cdouble;
|
376 |
+
#endif
|
377 |
+
|
378 |
+
#if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_FLOAT)
|
379 |
+
typedef complex float npy_cfloat;
|
380 |
+
#else
|
381 |
+
typedef struct { float real, imag; } npy_cfloat;
|
382 |
+
#endif
|
383 |
+
|
384 |
+
#if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_LONG_DOUBLE)
|
385 |
+
typedef complex long double npy_clongdouble;
|
386 |
+
#else
|
387 |
+
typedef struct {npy_longdouble real, imag;} npy_clongdouble;
|
388 |
+
#endif
|
389 |
+
#endif
|
390 |
+
#if NPY_SIZEOF_COMPLEX_DOUBLE != 2 * NPY_SIZEOF_DOUBLE
|
391 |
+
#error npy_cdouble definition is not compatible with C99 complex definition ! \
|
392 |
+
Please contact NumPy maintainers and give detailed information about your \
|
393 |
+
compiler and platform
|
394 |
+
#endif
|
395 |
+
typedef struct { double real, imag; } npy_cdouble;
|
396 |
+
|
397 |
+
#if NPY_SIZEOF_COMPLEX_FLOAT != 2 * NPY_SIZEOF_FLOAT
|
398 |
+
#error npy_cfloat definition is not compatible with C99 complex definition ! \
|
399 |
+
Please contact NumPy maintainers and give detailed information about your \
|
400 |
+
compiler and platform
|
401 |
+
#endif
|
402 |
+
typedef struct { float real, imag; } npy_cfloat;
|
403 |
+
|
404 |
+
#if NPY_SIZEOF_COMPLEX_LONGDOUBLE != 2 * NPY_SIZEOF_LONGDOUBLE
|
405 |
+
#error npy_clongdouble definition is not compatible with C99 complex definition ! \
|
406 |
+
Please contact NumPy maintainers and give detailed information about your \
|
407 |
+
compiler and platform
|
408 |
+
#endif
|
409 |
+
typedef struct { npy_longdouble real, imag; } npy_clongdouble;
|
410 |
+
|
411 |
+
/*
|
412 |
+
* numarray-style bit-width typedefs
|
413 |
+
*/
|
414 |
+
#define NPY_MAX_INT8 127
|
415 |
+
#define NPY_MIN_INT8 -128
|
416 |
+
#define NPY_MAX_UINT8 255
|
417 |
+
#define NPY_MAX_INT16 32767
|
418 |
+
#define NPY_MIN_INT16 -32768
|
419 |
+
#define NPY_MAX_UINT16 65535
|
420 |
+
#define NPY_MAX_INT32 2147483647
|
421 |
+
#define NPY_MIN_INT32 (-NPY_MAX_INT32 - 1)
|
422 |
+
#define NPY_MAX_UINT32 4294967295U
|
423 |
+
#define NPY_MAX_INT64 NPY_LONGLONG_SUFFIX(9223372036854775807)
|
424 |
+
#define NPY_MIN_INT64 (-NPY_MAX_INT64 - NPY_LONGLONG_SUFFIX(1))
|
425 |
+
#define NPY_MAX_UINT64 NPY_ULONGLONG_SUFFIX(18446744073709551615)
|
426 |
+
#define NPY_MAX_INT128 NPY_LONGLONG_SUFFIX(85070591730234615865843651857942052864)
|
427 |
+
#define NPY_MIN_INT128 (-NPY_MAX_INT128 - NPY_LONGLONG_SUFFIX(1))
|
428 |
+
#define NPY_MAX_UINT128 NPY_ULONGLONG_SUFFIX(170141183460469231731687303715884105728)
|
429 |
+
#define NPY_MAX_INT256 NPY_LONGLONG_SUFFIX(57896044618658097711785492504343953926634992332820282019728792003956564819967)
|
430 |
+
#define NPY_MIN_INT256 (-NPY_MAX_INT256 - NPY_LONGLONG_SUFFIX(1))
|
431 |
+
#define NPY_MAX_UINT256 NPY_ULONGLONG_SUFFIX(115792089237316195423570985008687907853269984665640564039457584007913129639935)
|
432 |
+
#define NPY_MIN_DATETIME NPY_MIN_INT64
|
433 |
+
#define NPY_MAX_DATETIME NPY_MAX_INT64
|
434 |
+
#define NPY_MIN_TIMEDELTA NPY_MIN_INT64
|
435 |
+
#define NPY_MAX_TIMEDELTA NPY_MAX_INT64
|
436 |
+
|
437 |
+
/* Need to find the number of bits for each type and
|
438 |
+
make definitions accordingly.
|
439 |
+
|
440 |
+
C states that sizeof(char) == 1 by definition
|
441 |
+
|
442 |
+
So, just using the sizeof keyword won't help.
|
443 |
+
|
444 |
+
It also looks like Python itself uses sizeof(char) quite a
|
445 |
+
bit, which by definition should be 1 all the time.
|
446 |
+
|
447 |
+
Idea: Make Use of CHAR_BIT which should tell us how many
|
448 |
+
BITS per CHARACTER
|
449 |
+
*/
|
450 |
+
|
451 |
+
/* Include platform definitions -- These are in the C89/90 standard */
|
452 |
+
#include <limits.h>
|
453 |
+
#define NPY_MAX_BYTE SCHAR_MAX
|
454 |
+
#define NPY_MIN_BYTE SCHAR_MIN
|
455 |
+
#define NPY_MAX_UBYTE UCHAR_MAX
|
456 |
+
#define NPY_MAX_SHORT SHRT_MAX
|
457 |
+
#define NPY_MIN_SHORT SHRT_MIN
|
458 |
+
#define NPY_MAX_USHORT USHRT_MAX
|
459 |
+
#define NPY_MAX_INT INT_MAX
|
460 |
+
#ifndef INT_MIN
|
461 |
+
#define INT_MIN (-INT_MAX - 1)
|
462 |
+
#endif
|
463 |
+
#define NPY_MIN_INT INT_MIN
|
464 |
+
#define NPY_MAX_UINT UINT_MAX
|
465 |
+
#define NPY_MAX_LONG LONG_MAX
|
466 |
+
#define NPY_MIN_LONG LONG_MIN
|
467 |
+
#define NPY_MAX_ULONG ULONG_MAX
|
468 |
+
|
469 |
+
#define NPY_BITSOF_BOOL (sizeof(npy_bool) * CHAR_BIT)
|
470 |
+
#define NPY_BITSOF_CHAR CHAR_BIT
|
471 |
+
#define NPY_BITSOF_BYTE (NPY_SIZEOF_BYTE * CHAR_BIT)
|
472 |
+
#define NPY_BITSOF_SHORT (NPY_SIZEOF_SHORT * CHAR_BIT)
|
473 |
+
#define NPY_BITSOF_INT (NPY_SIZEOF_INT * CHAR_BIT)
|
474 |
+
#define NPY_BITSOF_LONG (NPY_SIZEOF_LONG * CHAR_BIT)
|
475 |
+
#define NPY_BITSOF_LONGLONG (NPY_SIZEOF_LONGLONG * CHAR_BIT)
|
476 |
+
#define NPY_BITSOF_INTP (NPY_SIZEOF_INTP * CHAR_BIT)
|
477 |
+
#define NPY_BITSOF_HALF (NPY_SIZEOF_HALF * CHAR_BIT)
|
478 |
+
#define NPY_BITSOF_FLOAT (NPY_SIZEOF_FLOAT * CHAR_BIT)
|
479 |
+
#define NPY_BITSOF_DOUBLE (NPY_SIZEOF_DOUBLE * CHAR_BIT)
|
480 |
+
#define NPY_BITSOF_LONGDOUBLE (NPY_SIZEOF_LONGDOUBLE * CHAR_BIT)
|
481 |
+
#define NPY_BITSOF_CFLOAT (NPY_SIZEOF_CFLOAT * CHAR_BIT)
|
482 |
+
#define NPY_BITSOF_CDOUBLE (NPY_SIZEOF_CDOUBLE * CHAR_BIT)
|
483 |
+
#define NPY_BITSOF_CLONGDOUBLE (NPY_SIZEOF_CLONGDOUBLE * CHAR_BIT)
|
484 |
+
#define NPY_BITSOF_DATETIME (NPY_SIZEOF_DATETIME * CHAR_BIT)
|
485 |
+
#define NPY_BITSOF_TIMEDELTA (NPY_SIZEOF_TIMEDELTA * CHAR_BIT)
|
486 |
+
|
487 |
+
#if NPY_BITSOF_LONG == 8
|
488 |
+
#define NPY_INT8 NPY_LONG
|
489 |
+
#define NPY_UINT8 NPY_ULONG
|
490 |
+
typedef long npy_int8;
|
491 |
+
typedef unsigned long npy_uint8;
|
492 |
+
#define PyInt8ScalarObject PyLongScalarObject
|
493 |
+
#define PyInt8ArrType_Type PyLongArrType_Type
|
494 |
+
#define PyUInt8ScalarObject PyULongScalarObject
|
495 |
+
#define PyUInt8ArrType_Type PyULongArrType_Type
|
496 |
+
#define NPY_INT8_FMT NPY_LONG_FMT
|
497 |
+
#define NPY_UINT8_FMT NPY_ULONG_FMT
|
498 |
+
#elif NPY_BITSOF_LONG == 16
|
499 |
+
#define NPY_INT16 NPY_LONG
|
500 |
+
#define NPY_UINT16 NPY_ULONG
|
501 |
+
typedef long npy_int16;
|
502 |
+
typedef unsigned long npy_uint16;
|
503 |
+
#define PyInt16ScalarObject PyLongScalarObject
|
504 |
+
#define PyInt16ArrType_Type PyLongArrType_Type
|
505 |
+
#define PyUInt16ScalarObject PyULongScalarObject
|
506 |
+
#define PyUInt16ArrType_Type PyULongArrType_Type
|
507 |
+
#define NPY_INT16_FMT NPY_LONG_FMT
|
508 |
+
#define NPY_UINT16_FMT NPY_ULONG_FMT
|
509 |
+
#elif NPY_BITSOF_LONG == 32
|
510 |
+
#define NPY_INT32 NPY_LONG
|
511 |
+
#define NPY_UINT32 NPY_ULONG
|
512 |
+
typedef long npy_int32;
|
513 |
+
typedef unsigned long npy_uint32;
|
514 |
+
typedef unsigned long npy_ucs4;
|
515 |
+
#define PyInt32ScalarObject PyLongScalarObject
|
516 |
+
#define PyInt32ArrType_Type PyLongArrType_Type
|
517 |
+
#define PyUInt32ScalarObject PyULongScalarObject
|
518 |
+
#define PyUInt32ArrType_Type PyULongArrType_Type
|
519 |
+
#define NPY_INT32_FMT NPY_LONG_FMT
|
520 |
+
#define NPY_UINT32_FMT NPY_ULONG_FMT
|
521 |
+
#elif NPY_BITSOF_LONG == 64
|
522 |
+
#define NPY_INT64 NPY_LONG
|
523 |
+
#define NPY_UINT64 NPY_ULONG
|
524 |
+
typedef long npy_int64;
|
525 |
+
typedef unsigned long npy_uint64;
|
526 |
+
#define PyInt64ScalarObject PyLongScalarObject
|
527 |
+
#define PyInt64ArrType_Type PyLongArrType_Type
|
528 |
+
#define PyUInt64ScalarObject PyULongScalarObject
|
529 |
+
#define PyUInt64ArrType_Type PyULongArrType_Type
|
530 |
+
#define NPY_INT64_FMT NPY_LONG_FMT
|
531 |
+
#define NPY_UINT64_FMT NPY_ULONG_FMT
|
532 |
+
#define MyPyLong_FromInt64 PyLong_FromLong
|
533 |
+
#define MyPyLong_AsInt64 PyLong_AsLong
|
534 |
+
#elif NPY_BITSOF_LONG == 128
|
535 |
+
#define NPY_INT128 NPY_LONG
|
536 |
+
#define NPY_UINT128 NPY_ULONG
|
537 |
+
typedef long npy_int128;
|
538 |
+
typedef unsigned long npy_uint128;
|
539 |
+
#define PyInt128ScalarObject PyLongScalarObject
|
540 |
+
#define PyInt128ArrType_Type PyLongArrType_Type
|
541 |
+
#define PyUInt128ScalarObject PyULongScalarObject
|
542 |
+
#define PyUInt128ArrType_Type PyULongArrType_Type
|
543 |
+
#define NPY_INT128_FMT NPY_LONG_FMT
|
544 |
+
#define NPY_UINT128_FMT NPY_ULONG_FMT
|
545 |
+
#endif
|
546 |
+
|
547 |
+
#if NPY_BITSOF_LONGLONG == 8
|
548 |
+
# ifndef NPY_INT8
|
549 |
+
# define NPY_INT8 NPY_LONGLONG
|
550 |
+
# define NPY_UINT8 NPY_ULONGLONG
|
551 |
+
typedef npy_longlong npy_int8;
|
552 |
+
typedef npy_ulonglong npy_uint8;
|
553 |
+
# define PyInt8ScalarObject PyLongLongScalarObject
|
554 |
+
# define PyInt8ArrType_Type PyLongLongArrType_Type
|
555 |
+
# define PyUInt8ScalarObject PyULongLongScalarObject
|
556 |
+
# define PyUInt8ArrType_Type PyULongLongArrType_Type
|
557 |
+
#define NPY_INT8_FMT NPY_LONGLONG_FMT
|
558 |
+
#define NPY_UINT8_FMT NPY_ULONGLONG_FMT
|
559 |
+
# endif
|
560 |
+
# define NPY_MAX_LONGLONG NPY_MAX_INT8
|
561 |
+
# define NPY_MIN_LONGLONG NPY_MIN_INT8
|
562 |
+
# define NPY_MAX_ULONGLONG NPY_MAX_UINT8
|
563 |
+
#elif NPY_BITSOF_LONGLONG == 16
|
564 |
+
# ifndef NPY_INT16
|
565 |
+
# define NPY_INT16 NPY_LONGLONG
|
566 |
+
# define NPY_UINT16 NPY_ULONGLONG
|
567 |
+
typedef npy_longlong npy_int16;
|
568 |
+
typedef npy_ulonglong npy_uint16;
|
569 |
+
# define PyInt16ScalarObject PyLongLongScalarObject
|
570 |
+
# define PyInt16ArrType_Type PyLongLongArrType_Type
|
571 |
+
# define PyUInt16ScalarObject PyULongLongScalarObject
|
572 |
+
# define PyUInt16ArrType_Type PyULongLongArrType_Type
|
573 |
+
#define NPY_INT16_FMT NPY_LONGLONG_FMT
|
574 |
+
#define NPY_UINT16_FMT NPY_ULONGLONG_FMT
|
575 |
+
# endif
|
576 |
+
# define NPY_MAX_LONGLONG NPY_MAX_INT16
|
577 |
+
# define NPY_MIN_LONGLONG NPY_MIN_INT16
|
578 |
+
# define NPY_MAX_ULONGLONG NPY_MAX_UINT16
|
579 |
+
#elif NPY_BITSOF_LONGLONG == 32
|
580 |
+
# ifndef NPY_INT32
|
581 |
+
# define NPY_INT32 NPY_LONGLONG
|
582 |
+
# define NPY_UINT32 NPY_ULONGLONG
|
583 |
+
typedef npy_longlong npy_int32;
|
584 |
+
typedef npy_ulonglong npy_uint32;
|
585 |
+
typedef npy_ulonglong npy_ucs4;
|
586 |
+
# define PyInt32ScalarObject PyLongLongScalarObject
|
587 |
+
# define PyInt32ArrType_Type PyLongLongArrType_Type
|
588 |
+
# define PyUInt32ScalarObject PyULongLongScalarObject
|
589 |
+
# define PyUInt32ArrType_Type PyULongLongArrType_Type
|
590 |
+
#define NPY_INT32_FMT NPY_LONGLONG_FMT
|
591 |
+
#define NPY_UINT32_FMT NPY_ULONGLONG_FMT
|
592 |
+
# endif
|
593 |
+
# define NPY_MAX_LONGLONG NPY_MAX_INT32
|
594 |
+
# define NPY_MIN_LONGLONG NPY_MIN_INT32
|
595 |
+
# define NPY_MAX_ULONGLONG NPY_MAX_UINT32
|
596 |
+
#elif NPY_BITSOF_LONGLONG == 64
|
597 |
+
# ifndef NPY_INT64
|
598 |
+
# define NPY_INT64 NPY_LONGLONG
|
599 |
+
# define NPY_UINT64 NPY_ULONGLONG
|
600 |
+
typedef npy_longlong npy_int64;
|
601 |
+
typedef npy_ulonglong npy_uint64;
|
602 |
+
# define PyInt64ScalarObject PyLongLongScalarObject
|
603 |
+
# define PyInt64ArrType_Type PyLongLongArrType_Type
|
604 |
+
# define PyUInt64ScalarObject PyULongLongScalarObject
|
605 |
+
# define PyUInt64ArrType_Type PyULongLongArrType_Type
|
606 |
+
#define NPY_INT64_FMT NPY_LONGLONG_FMT
|
607 |
+
#define NPY_UINT64_FMT NPY_ULONGLONG_FMT
|
608 |
+
# define MyPyLong_FromInt64 PyLong_FromLongLong
|
609 |
+
# define MyPyLong_AsInt64 PyLong_AsLongLong
|
610 |
+
# endif
|
611 |
+
# define NPY_MAX_LONGLONG NPY_MAX_INT64
|
612 |
+
# define NPY_MIN_LONGLONG NPY_MIN_INT64
|
613 |
+
# define NPY_MAX_ULONGLONG NPY_MAX_UINT64
|
614 |
+
#elif NPY_BITSOF_LONGLONG == 128
|
615 |
+
# ifndef NPY_INT128
|
616 |
+
# define NPY_INT128 NPY_LONGLONG
|
617 |
+
# define NPY_UINT128 NPY_ULONGLONG
|
618 |
+
typedef npy_longlong npy_int128;
|
619 |
+
typedef npy_ulonglong npy_uint128;
|
620 |
+
# define PyInt128ScalarObject PyLongLongScalarObject
|
621 |
+
# define PyInt128ArrType_Type PyLongLongArrType_Type
|
622 |
+
# define PyUInt128ScalarObject PyULongLongScalarObject
|
623 |
+
# define PyUInt128ArrType_Type PyULongLongArrType_Type
|
624 |
+
#define NPY_INT128_FMT NPY_LONGLONG_FMT
|
625 |
+
#define NPY_UINT128_FMT NPY_ULONGLONG_FMT
|
626 |
+
# endif
|
627 |
+
# define NPY_MAX_LONGLONG NPY_MAX_INT128
|
628 |
+
# define NPY_MIN_LONGLONG NPY_MIN_INT128
|
629 |
+
# define NPY_MAX_ULONGLONG NPY_MAX_UINT128
|
630 |
+
#elif NPY_BITSOF_LONGLONG == 256
|
631 |
+
# define NPY_INT256 NPY_LONGLONG
|
632 |
+
# define NPY_UINT256 NPY_ULONGLONG
|
633 |
+
typedef npy_longlong npy_int256;
|
634 |
+
typedef npy_ulonglong npy_uint256;
|
635 |
+
# define PyInt256ScalarObject PyLongLongScalarObject
|
636 |
+
# define PyInt256ArrType_Type PyLongLongArrType_Type
|
637 |
+
# define PyUInt256ScalarObject PyULongLongScalarObject
|
638 |
+
# define PyUInt256ArrType_Type PyULongLongArrType_Type
|
639 |
+
#define NPY_INT256_FMT NPY_LONGLONG_FMT
|
640 |
+
#define NPY_UINT256_FMT NPY_ULONGLONG_FMT
|
641 |
+
# define NPY_MAX_LONGLONG NPY_MAX_INT256
|
642 |
+
# define NPY_MIN_LONGLONG NPY_MIN_INT256
|
643 |
+
# define NPY_MAX_ULONGLONG NPY_MAX_UINT256
|
644 |
+
#endif
|
645 |
+
|
646 |
+
#if NPY_BITSOF_INT == 8
|
647 |
+
#ifndef NPY_INT8
|
648 |
+
#define NPY_INT8 NPY_INT
|
649 |
+
#define NPY_UINT8 NPY_UINT
|
650 |
+
typedef int npy_int8;
|
651 |
+
typedef unsigned int npy_uint8;
|
652 |
+
# define PyInt8ScalarObject PyIntScalarObject
|
653 |
+
# define PyInt8ArrType_Type PyIntArrType_Type
|
654 |
+
# define PyUInt8ScalarObject PyUIntScalarObject
|
655 |
+
# define PyUInt8ArrType_Type PyUIntArrType_Type
|
656 |
+
#define NPY_INT8_FMT NPY_INT_FMT
|
657 |
+
#define NPY_UINT8_FMT NPY_UINT_FMT
|
658 |
+
#endif
|
659 |
+
#elif NPY_BITSOF_INT == 16
|
660 |
+
#ifndef NPY_INT16
|
661 |
+
#define NPY_INT16 NPY_INT
|
662 |
+
#define NPY_UINT16 NPY_UINT
|
663 |
+
typedef int npy_int16;
|
664 |
+
typedef unsigned int npy_uint16;
|
665 |
+
# define PyInt16ScalarObject PyIntScalarObject
|
666 |
+
# define PyInt16ArrType_Type PyIntArrType_Type
|
667 |
+
# define PyUInt16ScalarObject PyIntUScalarObject
|
668 |
+
# define PyUInt16ArrType_Type PyIntUArrType_Type
|
669 |
+
#define NPY_INT16_FMT NPY_INT_FMT
|
670 |
+
#define NPY_UINT16_FMT NPY_UINT_FMT
|
671 |
+
#endif
|
672 |
+
#elif NPY_BITSOF_INT == 32
|
673 |
+
#ifndef NPY_INT32
|
674 |
+
#define NPY_INT32 NPY_INT
|
675 |
+
#define NPY_UINT32 NPY_UINT
|
676 |
+
typedef int npy_int32;
|
677 |
+
typedef unsigned int npy_uint32;
|
678 |
+
typedef unsigned int npy_ucs4;
|
679 |
+
# define PyInt32ScalarObject PyIntScalarObject
|
680 |
+
# define PyInt32ArrType_Type PyIntArrType_Type
|
681 |
+
# define PyUInt32ScalarObject PyUIntScalarObject
|
682 |
+
# define PyUInt32ArrType_Type PyUIntArrType_Type
|
683 |
+
#define NPY_INT32_FMT NPY_INT_FMT
|
684 |
+
#define NPY_UINT32_FMT NPY_UINT_FMT
|
685 |
+
#endif
|
686 |
+
#elif NPY_BITSOF_INT == 64
|
687 |
+
#ifndef NPY_INT64
|
688 |
+
#define NPY_INT64 NPY_INT
|
689 |
+
#define NPY_UINT64 NPY_UINT
|
690 |
+
typedef int npy_int64;
|
691 |
+
typedef unsigned int npy_uint64;
|
692 |
+
# define PyInt64ScalarObject PyIntScalarObject
|
693 |
+
# define PyInt64ArrType_Type PyIntArrType_Type
|
694 |
+
# define PyUInt64ScalarObject PyUIntScalarObject
|
695 |
+
# define PyUInt64ArrType_Type PyUIntArrType_Type
|
696 |
+
#define NPY_INT64_FMT NPY_INT_FMT
|
697 |
+
#define NPY_UINT64_FMT NPY_UINT_FMT
|
698 |
+
# define MyPyLong_FromInt64 PyLong_FromLong
|
699 |
+
# define MyPyLong_AsInt64 PyLong_AsLong
|
700 |
+
#endif
|
701 |
+
#elif NPY_BITSOF_INT == 128
|
702 |
+
#ifndef NPY_INT128
|
703 |
+
#define NPY_INT128 NPY_INT
|
704 |
+
#define NPY_UINT128 NPY_UINT
|
705 |
+
typedef int npy_int128;
|
706 |
+
typedef unsigned int npy_uint128;
|
707 |
+
# define PyInt128ScalarObject PyIntScalarObject
|
708 |
+
# define PyInt128ArrType_Type PyIntArrType_Type
|
709 |
+
# define PyUInt128ScalarObject PyUIntScalarObject
|
710 |
+
# define PyUInt128ArrType_Type PyUIntArrType_Type
|
711 |
+
#define NPY_INT128_FMT NPY_INT_FMT
|
712 |
+
#define NPY_UINT128_FMT NPY_UINT_FMT
|
713 |
+
#endif
|
714 |
+
#endif
|
715 |
+
|
716 |
+
#if NPY_BITSOF_SHORT == 8
|
717 |
+
#ifndef NPY_INT8
|
718 |
+
#define NPY_INT8 NPY_SHORT
|
719 |
+
#define NPY_UINT8 NPY_USHORT
|
720 |
+
typedef short npy_int8;
|
721 |
+
typedef unsigned short npy_uint8;
|
722 |
+
# define PyInt8ScalarObject PyShortScalarObject
|
723 |
+
# define PyInt8ArrType_Type PyShortArrType_Type
|
724 |
+
# define PyUInt8ScalarObject PyUShortScalarObject
|
725 |
+
# define PyUInt8ArrType_Type PyUShortArrType_Type
|
726 |
+
#define NPY_INT8_FMT NPY_SHORT_FMT
|
727 |
+
#define NPY_UINT8_FMT NPY_USHORT_FMT
|
728 |
+
#endif
|
729 |
+
#elif NPY_BITSOF_SHORT == 16
|
730 |
+
#ifndef NPY_INT16
|
731 |
+
#define NPY_INT16 NPY_SHORT
|
732 |
+
#define NPY_UINT16 NPY_USHORT
|
733 |
+
typedef short npy_int16;
|
734 |
+
typedef unsigned short npy_uint16;
|
735 |
+
# define PyInt16ScalarObject PyShortScalarObject
|
736 |
+
# define PyInt16ArrType_Type PyShortArrType_Type
|
737 |
+
# define PyUInt16ScalarObject PyUShortScalarObject
|
738 |
+
# define PyUInt16ArrType_Type PyUShortArrType_Type
|
739 |
+
#define NPY_INT16_FMT NPY_SHORT_FMT
|
740 |
+
#define NPY_UINT16_FMT NPY_USHORT_FMT
|
741 |
+
#endif
|
742 |
+
#elif NPY_BITSOF_SHORT == 32
|
743 |
+
#ifndef NPY_INT32
|
744 |
+
#define NPY_INT32 NPY_SHORT
|
745 |
+
#define NPY_UINT32 NPY_USHORT
|
746 |
+
typedef short npy_int32;
|
747 |
+
typedef unsigned short npy_uint32;
|
748 |
+
typedef unsigned short npy_ucs4;
|
749 |
+
# define PyInt32ScalarObject PyShortScalarObject
|
750 |
+
# define PyInt32ArrType_Type PyShortArrType_Type
|
751 |
+
# define PyUInt32ScalarObject PyUShortScalarObject
|
752 |
+
# define PyUInt32ArrType_Type PyUShortArrType_Type
|
753 |
+
#define NPY_INT32_FMT NPY_SHORT_FMT
|
754 |
+
#define NPY_UINT32_FMT NPY_USHORT_FMT
|
755 |
+
#endif
|
756 |
+
#elif NPY_BITSOF_SHORT == 64
|
757 |
+
#ifndef NPY_INT64
|
758 |
+
#define NPY_INT64 NPY_SHORT
|
759 |
+
#define NPY_UINT64 NPY_USHORT
|
760 |
+
typedef short npy_int64;
|
761 |
+
typedef unsigned short npy_uint64;
|
762 |
+
# define PyInt64ScalarObject PyShortScalarObject
|
763 |
+
# define PyInt64ArrType_Type PyShortArrType_Type
|
764 |
+
# define PyUInt64ScalarObject PyUShortScalarObject
|
765 |
+
# define PyUInt64ArrType_Type PyUShortArrType_Type
|
766 |
+
#define NPY_INT64_FMT NPY_SHORT_FMT
|
767 |
+
#define NPY_UINT64_FMT NPY_USHORT_FMT
|
768 |
+
# define MyPyLong_FromInt64 PyLong_FromLong
|
769 |
+
# define MyPyLong_AsInt64 PyLong_AsLong
|
770 |
+
#endif
|
771 |
+
#elif NPY_BITSOF_SHORT == 128
|
772 |
+
#ifndef NPY_INT128
|
773 |
+
#define NPY_INT128 NPY_SHORT
|
774 |
+
#define NPY_UINT128 NPY_USHORT
|
775 |
+
typedef short npy_int128;
|
776 |
+
typedef unsigned short npy_uint128;
|
777 |
+
# define PyInt128ScalarObject PyShortScalarObject
|
778 |
+
# define PyInt128ArrType_Type PyShortArrType_Type
|
779 |
+
# define PyUInt128ScalarObject PyUShortScalarObject
|
780 |
+
# define PyUInt128ArrType_Type PyUShortArrType_Type
|
781 |
+
#define NPY_INT128_FMT NPY_SHORT_FMT
|
782 |
+
#define NPY_UINT128_FMT NPY_USHORT_FMT
|
783 |
+
#endif
|
784 |
+
#endif
|
785 |
+
|
786 |
+
|
787 |
+
#if NPY_BITSOF_CHAR == 8
|
788 |
+
#ifndef NPY_INT8
|
789 |
+
#define NPY_INT8 NPY_BYTE
|
790 |
+
#define NPY_UINT8 NPY_UBYTE
|
791 |
+
typedef signed char npy_int8;
|
792 |
+
typedef unsigned char npy_uint8;
|
793 |
+
# define PyInt8ScalarObject PyByteScalarObject
|
794 |
+
# define PyInt8ArrType_Type PyByteArrType_Type
|
795 |
+
# define PyUInt8ScalarObject PyUByteScalarObject
|
796 |
+
# define PyUInt8ArrType_Type PyUByteArrType_Type
|
797 |
+
#define NPY_INT8_FMT NPY_BYTE_FMT
|
798 |
+
#define NPY_UINT8_FMT NPY_UBYTE_FMT
|
799 |
+
#endif
|
800 |
+
#elif NPY_BITSOF_CHAR == 16
|
801 |
+
#ifndef NPY_INT16
|
802 |
+
#define NPY_INT16 NPY_BYTE
|
803 |
+
#define NPY_UINT16 NPY_UBYTE
|
804 |
+
typedef signed char npy_int16;
|
805 |
+
typedef unsigned char npy_uint16;
|
806 |
+
# define PyInt16ScalarObject PyByteScalarObject
|
807 |
+
# define PyInt16ArrType_Type PyByteArrType_Type
|
808 |
+
# define PyUInt16ScalarObject PyUByteScalarObject
|
809 |
+
# define PyUInt16ArrType_Type PyUByteArrType_Type
|
810 |
+
#define NPY_INT16_FMT NPY_BYTE_FMT
|
811 |
+
#define NPY_UINT16_FMT NPY_UBYTE_FMT
|
812 |
+
#endif
|
813 |
+
#elif NPY_BITSOF_CHAR == 32
|
814 |
+
#ifndef NPY_INT32
|
815 |
+
#define NPY_INT32 NPY_BYTE
|
816 |
+
#define NPY_UINT32 NPY_UBYTE
|
817 |
+
typedef signed char npy_int32;
|
818 |
+
typedef unsigned char npy_uint32;
|
819 |
+
typedef unsigned char npy_ucs4;
|
820 |
+
# define PyInt32ScalarObject PyByteScalarObject
|
821 |
+
# define PyInt32ArrType_Type PyByteArrType_Type
|
822 |
+
# define PyUInt32ScalarObject PyUByteScalarObject
|
823 |
+
# define PyUInt32ArrType_Type PyUByteArrType_Type
|
824 |
+
#define NPY_INT32_FMT NPY_BYTE_FMT
|
825 |
+
#define NPY_UINT32_FMT NPY_UBYTE_FMT
|
826 |
+
#endif
|
827 |
+
#elif NPY_BITSOF_CHAR == 64
|
828 |
+
#ifndef NPY_INT64
|
829 |
+
#define NPY_INT64 NPY_BYTE
|
830 |
+
#define NPY_UINT64 NPY_UBYTE
|
831 |
+
typedef signed char npy_int64;
|
832 |
+
typedef unsigned char npy_uint64;
|
833 |
+
# define PyInt64ScalarObject PyByteScalarObject
|
834 |
+
# define PyInt64ArrType_Type PyByteArrType_Type
|
835 |
+
# define PyUInt64ScalarObject PyUByteScalarObject
|
836 |
+
# define PyUInt64ArrType_Type PyUByteArrType_Type
|
837 |
+
#define NPY_INT64_FMT NPY_BYTE_FMT
|
838 |
+
#define NPY_UINT64_FMT NPY_UBYTE_FMT
|
839 |
+
# define MyPyLong_FromInt64 PyLong_FromLong
|
840 |
+
# define MyPyLong_AsInt64 PyLong_AsLong
|
841 |
+
#endif
|
842 |
+
#elif NPY_BITSOF_CHAR == 128
|
843 |
+
#ifndef NPY_INT128
|
844 |
+
#define NPY_INT128 NPY_BYTE
|
845 |
+
#define NPY_UINT128 NPY_UBYTE
|
846 |
+
typedef signed char npy_int128;
|
847 |
+
typedef unsigned char npy_uint128;
|
848 |
+
# define PyInt128ScalarObject PyByteScalarObject
|
849 |
+
# define PyInt128ArrType_Type PyByteArrType_Type
|
850 |
+
# define PyUInt128ScalarObject PyUByteScalarObject
|
851 |
+
# define PyUInt128ArrType_Type PyUByteArrType_Type
|
852 |
+
#define NPY_INT128_FMT NPY_BYTE_FMT
|
853 |
+
#define NPY_UINT128_FMT NPY_UBYTE_FMT
|
854 |
+
#endif
|
855 |
+
#endif
|
856 |
+
|
857 |
+
|
858 |
+
|
859 |
+
#if NPY_BITSOF_DOUBLE == 32
|
860 |
+
#ifndef NPY_FLOAT32
|
861 |
+
#define NPY_FLOAT32 NPY_DOUBLE
|
862 |
+
#define NPY_COMPLEX64 NPY_CDOUBLE
|
863 |
+
typedef double npy_float32;
|
864 |
+
typedef npy_cdouble npy_complex64;
|
865 |
+
# define PyFloat32ScalarObject PyDoubleScalarObject
|
866 |
+
# define PyComplex64ScalarObject PyCDoubleScalarObject
|
867 |
+
# define PyFloat32ArrType_Type PyDoubleArrType_Type
|
868 |
+
# define PyComplex64ArrType_Type PyCDoubleArrType_Type
|
869 |
+
#define NPY_FLOAT32_FMT NPY_DOUBLE_FMT
|
870 |
+
#define NPY_COMPLEX64_FMT NPY_CDOUBLE_FMT
|
871 |
+
#endif
|
872 |
+
#elif NPY_BITSOF_DOUBLE == 64
|
873 |
+
#ifndef NPY_FLOAT64
|
874 |
+
#define NPY_FLOAT64 NPY_DOUBLE
|
875 |
+
#define NPY_COMPLEX128 NPY_CDOUBLE
|
876 |
+
typedef double npy_float64;
|
877 |
+
typedef npy_cdouble npy_complex128;
|
878 |
+
# define PyFloat64ScalarObject PyDoubleScalarObject
|
879 |
+
# define PyComplex128ScalarObject PyCDoubleScalarObject
|
880 |
+
# define PyFloat64ArrType_Type PyDoubleArrType_Type
|
881 |
+
# define PyComplex128ArrType_Type PyCDoubleArrType_Type
|
882 |
+
#define NPY_FLOAT64_FMT NPY_DOUBLE_FMT
|
883 |
+
#define NPY_COMPLEX128_FMT NPY_CDOUBLE_FMT
|
884 |
+
#endif
|
885 |
+
#elif NPY_BITSOF_DOUBLE == 80
|
886 |
+
#ifndef NPY_FLOAT80
|
887 |
+
#define NPY_FLOAT80 NPY_DOUBLE
|
888 |
+
#define NPY_COMPLEX160 NPY_CDOUBLE
|
889 |
+
typedef double npy_float80;
|
890 |
+
typedef npy_cdouble npy_complex160;
|
891 |
+
# define PyFloat80ScalarObject PyDoubleScalarObject
|
892 |
+
# define PyComplex160ScalarObject PyCDoubleScalarObject
|
893 |
+
# define PyFloat80ArrType_Type PyDoubleArrType_Type
|
894 |
+
# define PyComplex160ArrType_Type PyCDoubleArrType_Type
|
895 |
+
#define NPY_FLOAT80_FMT NPY_DOUBLE_FMT
|
896 |
+
#define NPY_COMPLEX160_FMT NPY_CDOUBLE_FMT
|
897 |
+
#endif
|
898 |
+
#elif NPY_BITSOF_DOUBLE == 96
|
899 |
+
#ifndef NPY_FLOAT96
|
900 |
+
#define NPY_FLOAT96 NPY_DOUBLE
|
901 |
+
#define NPY_COMPLEX192 NPY_CDOUBLE
|
902 |
+
typedef double npy_float96;
|
903 |
+
typedef npy_cdouble npy_complex192;
|
904 |
+
# define PyFloat96ScalarObject PyDoubleScalarObject
|
905 |
+
# define PyComplex192ScalarObject PyCDoubleScalarObject
|
906 |
+
# define PyFloat96ArrType_Type PyDoubleArrType_Type
|
907 |
+
# define PyComplex192ArrType_Type PyCDoubleArrType_Type
|
908 |
+
#define NPY_FLOAT96_FMT NPY_DOUBLE_FMT
|
909 |
+
#define NPY_COMPLEX192_FMT NPY_CDOUBLE_FMT
|
910 |
+
#endif
|
911 |
+
#elif NPY_BITSOF_DOUBLE == 128
|
912 |
+
#ifndef NPY_FLOAT128
|
913 |
+
#define NPY_FLOAT128 NPY_DOUBLE
|
914 |
+
#define NPY_COMPLEX256 NPY_CDOUBLE
|
915 |
+
typedef double npy_float128;
|
916 |
+
typedef npy_cdouble npy_complex256;
|
917 |
+
# define PyFloat128ScalarObject PyDoubleScalarObject
|
918 |
+
# define PyComplex256ScalarObject PyCDoubleScalarObject
|
919 |
+
# define PyFloat128ArrType_Type PyDoubleArrType_Type
|
920 |
+
# define PyComplex256ArrType_Type PyCDoubleArrType_Type
|
921 |
+
#define NPY_FLOAT128_FMT NPY_DOUBLE_FMT
|
922 |
+
#define NPY_COMPLEX256_FMT NPY_CDOUBLE_FMT
|
923 |
+
#endif
|
924 |
+
#endif
|
925 |
+
|
926 |
+
|
927 |
+
|
928 |
+
#if NPY_BITSOF_FLOAT == 32
|
929 |
+
#ifndef NPY_FLOAT32
|
930 |
+
#define NPY_FLOAT32 NPY_FLOAT
|
931 |
+
#define NPY_COMPLEX64 NPY_CFLOAT
|
932 |
+
typedef float npy_float32;
|
933 |
+
typedef npy_cfloat npy_complex64;
|
934 |
+
# define PyFloat32ScalarObject PyFloatScalarObject
|
935 |
+
# define PyComplex64ScalarObject PyCFloatScalarObject
|
936 |
+
# define PyFloat32ArrType_Type PyFloatArrType_Type
|
937 |
+
# define PyComplex64ArrType_Type PyCFloatArrType_Type
|
938 |
+
#define NPY_FLOAT32_FMT NPY_FLOAT_FMT
|
939 |
+
#define NPY_COMPLEX64_FMT NPY_CFLOAT_FMT
|
940 |
+
#endif
|
941 |
+
#elif NPY_BITSOF_FLOAT == 64
|
942 |
+
#ifndef NPY_FLOAT64
|
943 |
+
#define NPY_FLOAT64 NPY_FLOAT
|
944 |
+
#define NPY_COMPLEX128 NPY_CFLOAT
|
945 |
+
typedef float npy_float64;
|
946 |
+
typedef npy_cfloat npy_complex128;
|
947 |
+
# define PyFloat64ScalarObject PyFloatScalarObject
|
948 |
+
# define PyComplex128ScalarObject PyCFloatScalarObject
|
949 |
+
# define PyFloat64ArrType_Type PyFloatArrType_Type
|
950 |
+
# define PyComplex128ArrType_Type PyCFloatArrType_Type
|
951 |
+
#define NPY_FLOAT64_FMT NPY_FLOAT_FMT
|
952 |
+
#define NPY_COMPLEX128_FMT NPY_CFLOAT_FMT
|
953 |
+
#endif
|
954 |
+
#elif NPY_BITSOF_FLOAT == 80
|
955 |
+
#ifndef NPY_FLOAT80
|
956 |
+
#define NPY_FLOAT80 NPY_FLOAT
|
957 |
+
#define NPY_COMPLEX160 NPY_CFLOAT
|
958 |
+
typedef float npy_float80;
|
959 |
+
typedef npy_cfloat npy_complex160;
|
960 |
+
# define PyFloat80ScalarObject PyFloatScalarObject
|
961 |
+
# define PyComplex160ScalarObject PyCFloatScalarObject
|
962 |
+
# define PyFloat80ArrType_Type PyFloatArrType_Type
|
963 |
+
# define PyComplex160ArrType_Type PyCFloatArrType_Type
|
964 |
+
#define NPY_FLOAT80_FMT NPY_FLOAT_FMT
|
965 |
+
#define NPY_COMPLEX160_FMT NPY_CFLOAT_FMT
|
966 |
+
#endif
|
967 |
+
#elif NPY_BITSOF_FLOAT == 96
|
968 |
+
#ifndef NPY_FLOAT96
|
969 |
+
#define NPY_FLOAT96 NPY_FLOAT
|
970 |
+
#define NPY_COMPLEX192 NPY_CFLOAT
|
971 |
+
typedef float npy_float96;
|
972 |
+
typedef npy_cfloat npy_complex192;
|
973 |
+
# define PyFloat96ScalarObject PyFloatScalarObject
|
974 |
+
# define PyComplex192ScalarObject PyCFloatScalarObject
|
975 |
+
# define PyFloat96ArrType_Type PyFloatArrType_Type
|
976 |
+
# define PyComplex192ArrType_Type PyCFloatArrType_Type
|
977 |
+
#define NPY_FLOAT96_FMT NPY_FLOAT_FMT
|
978 |
+
#define NPY_COMPLEX192_FMT NPY_CFLOAT_FMT
|
979 |
+
#endif
|
980 |
+
#elif NPY_BITSOF_FLOAT == 128
|
981 |
+
#ifndef NPY_FLOAT128
|
982 |
+
#define NPY_FLOAT128 NPY_FLOAT
|
983 |
+
#define NPY_COMPLEX256 NPY_CFLOAT
|
984 |
+
typedef float npy_float128;
|
985 |
+
typedef npy_cfloat npy_complex256;
|
986 |
+
# define PyFloat128ScalarObject PyFloatScalarObject
|
987 |
+
# define PyComplex256ScalarObject PyCFloatScalarObject
|
988 |
+
# define PyFloat128ArrType_Type PyFloatArrType_Type
|
989 |
+
# define PyComplex256ArrType_Type PyCFloatArrType_Type
|
990 |
+
#define NPY_FLOAT128_FMT NPY_FLOAT_FMT
|
991 |
+
#define NPY_COMPLEX256_FMT NPY_CFLOAT_FMT
|
992 |
+
#endif
|
993 |
+
#endif
|
994 |
+
|
995 |
+
/* half/float16 isn't a floating-point type in C */
|
996 |
+
#define NPY_FLOAT16 NPY_HALF
|
997 |
+
typedef npy_uint16 npy_half;
|
998 |
+
typedef npy_half npy_float16;
|
999 |
+
|
1000 |
+
#if NPY_BITSOF_LONGDOUBLE == 32
|
1001 |
+
#ifndef NPY_FLOAT32
|
1002 |
+
#define NPY_FLOAT32 NPY_LONGDOUBLE
|
1003 |
+
#define NPY_COMPLEX64 NPY_CLONGDOUBLE
|
1004 |
+
typedef npy_longdouble npy_float32;
|
1005 |
+
typedef npy_clongdouble npy_complex64;
|
1006 |
+
# define PyFloat32ScalarObject PyLongDoubleScalarObject
|
1007 |
+
# define PyComplex64ScalarObject PyCLongDoubleScalarObject
|
1008 |
+
# define PyFloat32ArrType_Type PyLongDoubleArrType_Type
|
1009 |
+
# define PyComplex64ArrType_Type PyCLongDoubleArrType_Type
|
1010 |
+
#define NPY_FLOAT32_FMT NPY_LONGDOUBLE_FMT
|
1011 |
+
#define NPY_COMPLEX64_FMT NPY_CLONGDOUBLE_FMT
|
1012 |
+
#endif
|
1013 |
+
#elif NPY_BITSOF_LONGDOUBLE == 64
|
1014 |
+
#ifndef NPY_FLOAT64
|
1015 |
+
#define NPY_FLOAT64 NPY_LONGDOUBLE
|
1016 |
+
#define NPY_COMPLEX128 NPY_CLONGDOUBLE
|
1017 |
+
typedef npy_longdouble npy_float64;
|
1018 |
+
typedef npy_clongdouble npy_complex128;
|
1019 |
+
# define PyFloat64ScalarObject PyLongDoubleScalarObject
|
1020 |
+
# define PyComplex128ScalarObject PyCLongDoubleScalarObject
|
1021 |
+
# define PyFloat64ArrType_Type PyLongDoubleArrType_Type
|
1022 |
+
# define PyComplex128ArrType_Type PyCLongDoubleArrType_Type
|
1023 |
+
#define NPY_FLOAT64_FMT NPY_LONGDOUBLE_FMT
|
1024 |
+
#define NPY_COMPLEX128_FMT NPY_CLONGDOUBLE_FMT
|
1025 |
+
#endif
|
1026 |
+
#elif NPY_BITSOF_LONGDOUBLE == 80
|
1027 |
+
#ifndef NPY_FLOAT80
|
1028 |
+
#define NPY_FLOAT80 NPY_LONGDOUBLE
|
1029 |
+
#define NPY_COMPLEX160 NPY_CLONGDOUBLE
|
1030 |
+
typedef npy_longdouble npy_float80;
|
1031 |
+
typedef npy_clongdouble npy_complex160;
|
1032 |
+
# define PyFloat80ScalarObject PyLongDoubleScalarObject
|
1033 |
+
# define PyComplex160ScalarObject PyCLongDoubleScalarObject
|
1034 |
+
# define PyFloat80ArrType_Type PyLongDoubleArrType_Type
|
1035 |
+
# define PyComplex160ArrType_Type PyCLongDoubleArrType_Type
|
1036 |
+
#define NPY_FLOAT80_FMT NPY_LONGDOUBLE_FMT
|
1037 |
+
#define NPY_COMPLEX160_FMT NPY_CLONGDOUBLE_FMT
|
1038 |
+
#endif
|
1039 |
+
#elif NPY_BITSOF_LONGDOUBLE == 96
|
1040 |
+
#ifndef NPY_FLOAT96
|
1041 |
+
#define NPY_FLOAT96 NPY_LONGDOUBLE
|
1042 |
+
#define NPY_COMPLEX192 NPY_CLONGDOUBLE
|
1043 |
+
typedef npy_longdouble npy_float96;
|
1044 |
+
typedef npy_clongdouble npy_complex192;
|
1045 |
+
# define PyFloat96ScalarObject PyLongDoubleScalarObject
|
1046 |
+
# define PyComplex192ScalarObject PyCLongDoubleScalarObject
|
1047 |
+
# define PyFloat96ArrType_Type PyLongDoubleArrType_Type
|
1048 |
+
# define PyComplex192ArrType_Type PyCLongDoubleArrType_Type
|
1049 |
+
#define NPY_FLOAT96_FMT NPY_LONGDOUBLE_FMT
|
1050 |
+
#define NPY_COMPLEX192_FMT NPY_CLONGDOUBLE_FMT
|
1051 |
+
#endif
|
1052 |
+
#elif NPY_BITSOF_LONGDOUBLE == 128
|
1053 |
+
#ifndef NPY_FLOAT128
|
1054 |
+
#define NPY_FLOAT128 NPY_LONGDOUBLE
|
1055 |
+
#define NPY_COMPLEX256 NPY_CLONGDOUBLE
|
1056 |
+
typedef npy_longdouble npy_float128;
|
1057 |
+
typedef npy_clongdouble npy_complex256;
|
1058 |
+
# define PyFloat128ScalarObject PyLongDoubleScalarObject
|
1059 |
+
# define PyComplex256ScalarObject PyCLongDoubleScalarObject
|
1060 |
+
# define PyFloat128ArrType_Type PyLongDoubleArrType_Type
|
1061 |
+
# define PyComplex256ArrType_Type PyCLongDoubleArrType_Type
|
1062 |
+
#define NPY_FLOAT128_FMT NPY_LONGDOUBLE_FMT
|
1063 |
+
#define NPY_COMPLEX256_FMT NPY_CLONGDOUBLE_FMT
|
1064 |
+
#endif
|
1065 |
+
#elif NPY_BITSOF_LONGDOUBLE == 256
|
1066 |
+
#define NPY_FLOAT256 NPY_LONGDOUBLE
|
1067 |
+
#define NPY_COMPLEX512 NPY_CLONGDOUBLE
|
1068 |
+
typedef npy_longdouble npy_float256;
|
1069 |
+
typedef npy_clongdouble npy_complex512;
|
1070 |
+
# define PyFloat256ScalarObject PyLongDoubleScalarObject
|
1071 |
+
# define PyComplex512ScalarObject PyCLongDoubleScalarObject
|
1072 |
+
# define PyFloat256ArrType_Type PyLongDoubleArrType_Type
|
1073 |
+
# define PyComplex512ArrType_Type PyCLongDoubleArrType_Type
|
1074 |
+
#define NPY_FLOAT256_FMT NPY_LONGDOUBLE_FMT
|
1075 |
+
#define NPY_COMPLEX512_FMT NPY_CLONGDOUBLE_FMT
|
1076 |
+
#endif
|
1077 |
+
|
1078 |
+
/* datetime typedefs */
|
1079 |
+
typedef npy_int64 npy_timedelta;
|
1080 |
+
typedef npy_int64 npy_datetime;
|
1081 |
+
#define NPY_DATETIME_FMT NPY_INT64_FMT
|
1082 |
+
#define NPY_TIMEDELTA_FMT NPY_INT64_FMT
|
1083 |
+
|
1084 |
+
/* End of typedefs for numarray style bit-width names */
|
1085 |
+
|
1086 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_cpu.h
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* This set (target) cpu specific macros:
|
3 |
+
* - Possible values:
|
4 |
+
* NPY_CPU_X86
|
5 |
+
* NPY_CPU_AMD64
|
6 |
+
* NPY_CPU_PPC
|
7 |
+
* NPY_CPU_PPC64
|
8 |
+
* NPY_CPU_PPC64LE
|
9 |
+
* NPY_CPU_SPARC
|
10 |
+
* NPY_CPU_S390
|
11 |
+
* NPY_CPU_IA64
|
12 |
+
* NPY_CPU_HPPA
|
13 |
+
* NPY_CPU_ALPHA
|
14 |
+
* NPY_CPU_ARMEL
|
15 |
+
* NPY_CPU_ARMEB
|
16 |
+
* NPY_CPU_SH_LE
|
17 |
+
* NPY_CPU_SH_BE
|
18 |
+
* NPY_CPU_ARCEL
|
19 |
+
* NPY_CPU_ARCEB
|
20 |
+
* NPY_CPU_RISCV64
|
21 |
+
* NPY_CPU_LOONGARCH
|
22 |
+
* NPY_CPU_WASM
|
23 |
+
*/
|
24 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_
|
25 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_
|
26 |
+
|
27 |
+
#include "numpyconfig.h"
|
28 |
+
|
29 |
+
#if defined( __i386__ ) || defined(i386) || defined(_M_IX86)
|
30 |
+
/*
|
31 |
+
* __i386__ is defined by gcc and Intel compiler on Linux,
|
32 |
+
* _M_IX86 by VS compiler,
|
33 |
+
* i386 by Sun compilers on opensolaris at least
|
34 |
+
*/
|
35 |
+
#define NPY_CPU_X86
|
36 |
+
#elif defined(__x86_64__) || defined(__amd64__) || defined(__x86_64) || defined(_M_AMD64)
|
37 |
+
/*
|
38 |
+
* both __x86_64__ and __amd64__ are defined by gcc
|
39 |
+
* __x86_64 defined by sun compiler on opensolaris at least
|
40 |
+
* _M_AMD64 defined by MS compiler
|
41 |
+
*/
|
42 |
+
#define NPY_CPU_AMD64
|
43 |
+
#elif defined(__powerpc64__) && defined(__LITTLE_ENDIAN__)
|
44 |
+
#define NPY_CPU_PPC64LE
|
45 |
+
#elif defined(__powerpc64__) && defined(__BIG_ENDIAN__)
|
46 |
+
#define NPY_CPU_PPC64
|
47 |
+
#elif defined(__ppc__) || defined(__powerpc__) || defined(_ARCH_PPC)
|
48 |
+
/*
|
49 |
+
* __ppc__ is defined by gcc, I remember having seen __powerpc__ once,
|
50 |
+
* but can't find it ATM
|
51 |
+
* _ARCH_PPC is used by at least gcc on AIX
|
52 |
+
* As __powerpc__ and _ARCH_PPC are also defined by PPC64 check
|
53 |
+
* for those specifically first before defaulting to ppc
|
54 |
+
*/
|
55 |
+
#define NPY_CPU_PPC
|
56 |
+
#elif defined(__sparc__) || defined(__sparc)
|
57 |
+
/* __sparc__ is defined by gcc and Forte (e.g. Sun) compilers */
|
58 |
+
#define NPY_CPU_SPARC
|
59 |
+
#elif defined(__s390__)
|
60 |
+
#define NPY_CPU_S390
|
61 |
+
#elif defined(__ia64)
|
62 |
+
#define NPY_CPU_IA64
|
63 |
+
#elif defined(__hppa)
|
64 |
+
#define NPY_CPU_HPPA
|
65 |
+
#elif defined(__alpha__)
|
66 |
+
#define NPY_CPU_ALPHA
|
67 |
+
#elif defined(__arm__) || defined(__aarch64__) || defined(_M_ARM64)
|
68 |
+
/* _M_ARM64 is defined in MSVC for ARM64 compilation on Windows */
|
69 |
+
#if defined(__ARMEB__) || defined(__AARCH64EB__)
|
70 |
+
#if defined(__ARM_32BIT_STATE)
|
71 |
+
#define NPY_CPU_ARMEB_AARCH32
|
72 |
+
#elif defined(__ARM_64BIT_STATE)
|
73 |
+
#define NPY_CPU_ARMEB_AARCH64
|
74 |
+
#else
|
75 |
+
#define NPY_CPU_ARMEB
|
76 |
+
#endif
|
77 |
+
#elif defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)
|
78 |
+
#if defined(__ARM_32BIT_STATE)
|
79 |
+
#define NPY_CPU_ARMEL_AARCH32
|
80 |
+
#elif defined(__ARM_64BIT_STATE) || defined(_M_ARM64) || defined(__AARCH64EL__)
|
81 |
+
#define NPY_CPU_ARMEL_AARCH64
|
82 |
+
#else
|
83 |
+
#define NPY_CPU_ARMEL
|
84 |
+
#endif
|
85 |
+
#else
|
86 |
+
# error Unknown ARM CPU, please report this to numpy maintainers with \
|
87 |
+
information about your platform (OS, CPU and compiler)
|
88 |
+
#endif
|
89 |
+
#elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
|
90 |
+
#define NPY_CPU_SH_LE
|
91 |
+
#elif defined(__sh__) && defined(__BIG_ENDIAN__)
|
92 |
+
#define NPY_CPU_SH_BE
|
93 |
+
#elif defined(__MIPSEL__)
|
94 |
+
#define NPY_CPU_MIPSEL
|
95 |
+
#elif defined(__MIPSEB__)
|
96 |
+
#define NPY_CPU_MIPSEB
|
97 |
+
#elif defined(__or1k__)
|
98 |
+
#define NPY_CPU_OR1K
|
99 |
+
#elif defined(__mc68000__)
|
100 |
+
#define NPY_CPU_M68K
|
101 |
+
#elif defined(__arc__) && defined(__LITTLE_ENDIAN__)
|
102 |
+
#define NPY_CPU_ARCEL
|
103 |
+
#elif defined(__arc__) && defined(__BIG_ENDIAN__)
|
104 |
+
#define NPY_CPU_ARCEB
|
105 |
+
#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
|
106 |
+
#define NPY_CPU_RISCV64
|
107 |
+
#elif defined(__loongarch__)
|
108 |
+
#define NPY_CPU_LOONGARCH
|
109 |
+
#elif defined(__EMSCRIPTEN__)
|
110 |
+
/* __EMSCRIPTEN__ is defined by emscripten: an LLVM-to-Web compiler */
|
111 |
+
#define NPY_CPU_WASM
|
112 |
+
#else
|
113 |
+
#error Unknown CPU, please report this to numpy maintainers with \
|
114 |
+
information about your platform (OS, CPU and compiler)
|
115 |
+
#endif
|
116 |
+
|
117 |
+
/*
|
118 |
+
* Except for the following architectures, memory access is limited to the natural
|
119 |
+
* alignment of data types otherwise it may lead to bus error or performance regression.
|
120 |
+
* For more details about unaligned access, see https://www.kernel.org/doc/Documentation/unaligned-memory-access.txt.
|
121 |
+
*/
|
122 |
+
#if defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64) || defined(__aarch64__) || defined(__powerpc64__)
|
123 |
+
#define NPY_ALIGNMENT_REQUIRED 0
|
124 |
+
#endif
|
125 |
+
#ifndef NPY_ALIGNMENT_REQUIRED
|
126 |
+
#define NPY_ALIGNMENT_REQUIRED 1
|
127 |
+
#endif
|
128 |
+
|
129 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_CPU_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_endian.h
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_ENDIAN_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_NPY_ENDIAN_H_
|
3 |
+
|
4 |
+
/*
|
5 |
+
* NPY_BYTE_ORDER is set to the same value as BYTE_ORDER set by glibc in
|
6 |
+
* endian.h
|
7 |
+
*/
|
8 |
+
|
9 |
+
#if defined(NPY_HAVE_ENDIAN_H) || defined(NPY_HAVE_SYS_ENDIAN_H)
|
10 |
+
/* Use endian.h if available */
|
11 |
+
|
12 |
+
#if defined(NPY_HAVE_ENDIAN_H)
|
13 |
+
#include <endian.h>
|
14 |
+
#elif defined(NPY_HAVE_SYS_ENDIAN_H)
|
15 |
+
#include <sys/endian.h>
|
16 |
+
#endif
|
17 |
+
|
18 |
+
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN)
|
19 |
+
#define NPY_BYTE_ORDER BYTE_ORDER
|
20 |
+
#define NPY_LITTLE_ENDIAN LITTLE_ENDIAN
|
21 |
+
#define NPY_BIG_ENDIAN BIG_ENDIAN
|
22 |
+
#elif defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN)
|
23 |
+
#define NPY_BYTE_ORDER _BYTE_ORDER
|
24 |
+
#define NPY_LITTLE_ENDIAN _LITTLE_ENDIAN
|
25 |
+
#define NPY_BIG_ENDIAN _BIG_ENDIAN
|
26 |
+
#elif defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
|
27 |
+
#define NPY_BYTE_ORDER __BYTE_ORDER
|
28 |
+
#define NPY_LITTLE_ENDIAN __LITTLE_ENDIAN
|
29 |
+
#define NPY_BIG_ENDIAN __BIG_ENDIAN
|
30 |
+
#endif
|
31 |
+
#endif
|
32 |
+
|
33 |
+
#ifndef NPY_BYTE_ORDER
|
34 |
+
/* Set endianness info using target CPU */
|
35 |
+
#include "npy_cpu.h"
|
36 |
+
|
37 |
+
#define NPY_LITTLE_ENDIAN 1234
|
38 |
+
#define NPY_BIG_ENDIAN 4321
|
39 |
+
|
40 |
+
#if defined(NPY_CPU_X86) \
|
41 |
+
|| defined(NPY_CPU_AMD64) \
|
42 |
+
|| defined(NPY_CPU_IA64) \
|
43 |
+
|| defined(NPY_CPU_ALPHA) \
|
44 |
+
|| defined(NPY_CPU_ARMEL) \
|
45 |
+
|| defined(NPY_CPU_ARMEL_AARCH32) \
|
46 |
+
|| defined(NPY_CPU_ARMEL_AARCH64) \
|
47 |
+
|| defined(NPY_CPU_SH_LE) \
|
48 |
+
|| defined(NPY_CPU_MIPSEL) \
|
49 |
+
|| defined(NPY_CPU_PPC64LE) \
|
50 |
+
|| defined(NPY_CPU_ARCEL) \
|
51 |
+
|| defined(NPY_CPU_RISCV64) \
|
52 |
+
|| defined(NPY_CPU_LOONGARCH) \
|
53 |
+
|| defined(NPY_CPU_WASM)
|
54 |
+
#define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
|
55 |
+
|
56 |
+
#elif defined(NPY_CPU_PPC) \
|
57 |
+
|| defined(NPY_CPU_SPARC) \
|
58 |
+
|| defined(NPY_CPU_S390) \
|
59 |
+
|| defined(NPY_CPU_HPPA) \
|
60 |
+
|| defined(NPY_CPU_PPC64) \
|
61 |
+
|| defined(NPY_CPU_ARMEB) \
|
62 |
+
|| defined(NPY_CPU_ARMEB_AARCH32) \
|
63 |
+
|| defined(NPY_CPU_ARMEB_AARCH64) \
|
64 |
+
|| defined(NPY_CPU_SH_BE) \
|
65 |
+
|| defined(NPY_CPU_MIPSEB) \
|
66 |
+
|| defined(NPY_CPU_OR1K) \
|
67 |
+
|| defined(NPY_CPU_M68K) \
|
68 |
+
|| defined(NPY_CPU_ARCEB)
|
69 |
+
#define NPY_BYTE_ORDER NPY_BIG_ENDIAN
|
70 |
+
|
71 |
+
#else
|
72 |
+
#error Unknown CPU: can not set endianness
|
73 |
+
#endif
|
74 |
+
|
75 |
+
#endif
|
76 |
+
|
77 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_ENDIAN_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_math.h
ADDED
@@ -0,0 +1,563 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_MATH_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_NPY_MATH_H_
|
3 |
+
|
4 |
+
#include <numpy/npy_common.h>
|
5 |
+
|
6 |
+
#include <math.h>
|
7 |
+
|
8 |
+
/* By adding static inline specifiers to npy_math function definitions when
|
9 |
+
appropriate, compiler is given the opportunity to optimize */
|
10 |
+
#if NPY_INLINE_MATH
|
11 |
+
#define NPY_INPLACE static inline
|
12 |
+
#else
|
13 |
+
#define NPY_INPLACE
|
14 |
+
#endif
|
15 |
+
|
16 |
+
|
17 |
+
#ifdef __cplusplus
|
18 |
+
extern "C" {
|
19 |
+
#endif
|
20 |
+
|
21 |
+
/*
|
22 |
+
* NAN and INFINITY like macros (same behavior as glibc for NAN, same as C99
|
23 |
+
* for INFINITY)
|
24 |
+
*
|
25 |
+
* XXX: I should test whether INFINITY and NAN are available on the platform
|
26 |
+
*/
|
27 |
+
static inline float __npy_inff(void)
|
28 |
+
{
|
29 |
+
const union { npy_uint32 __i; float __f;} __bint = {0x7f800000UL};
|
30 |
+
return __bint.__f;
|
31 |
+
}
|
32 |
+
|
33 |
+
static inline float __npy_nanf(void)
|
34 |
+
{
|
35 |
+
const union { npy_uint32 __i; float __f;} __bint = {0x7fc00000UL};
|
36 |
+
return __bint.__f;
|
37 |
+
}
|
38 |
+
|
39 |
+
static inline float __npy_pzerof(void)
|
40 |
+
{
|
41 |
+
const union { npy_uint32 __i; float __f;} __bint = {0x00000000UL};
|
42 |
+
return __bint.__f;
|
43 |
+
}
|
44 |
+
|
45 |
+
static inline float __npy_nzerof(void)
|
46 |
+
{
|
47 |
+
const union { npy_uint32 __i; float __f;} __bint = {0x80000000UL};
|
48 |
+
return __bint.__f;
|
49 |
+
}
|
50 |
+
|
51 |
+
#define NPY_INFINITYF __npy_inff()
|
52 |
+
#define NPY_NANF __npy_nanf()
|
53 |
+
#define NPY_PZEROF __npy_pzerof()
|
54 |
+
#define NPY_NZEROF __npy_nzerof()
|
55 |
+
|
56 |
+
#define NPY_INFINITY ((npy_double)NPY_INFINITYF)
|
57 |
+
#define NPY_NAN ((npy_double)NPY_NANF)
|
58 |
+
#define NPY_PZERO ((npy_double)NPY_PZEROF)
|
59 |
+
#define NPY_NZERO ((npy_double)NPY_NZEROF)
|
60 |
+
|
61 |
+
#define NPY_INFINITYL ((npy_longdouble)NPY_INFINITYF)
|
62 |
+
#define NPY_NANL ((npy_longdouble)NPY_NANF)
|
63 |
+
#define NPY_PZEROL ((npy_longdouble)NPY_PZEROF)
|
64 |
+
#define NPY_NZEROL ((npy_longdouble)NPY_NZEROF)
|
65 |
+
|
66 |
+
/*
|
67 |
+
* Useful constants
|
68 |
+
*/
|
69 |
+
#define NPY_E 2.718281828459045235360287471352662498 /* e */
|
70 |
+
#define NPY_LOG2E 1.442695040888963407359924681001892137 /* log_2 e */
|
71 |
+
#define NPY_LOG10E 0.434294481903251827651128918916605082 /* log_10 e */
|
72 |
+
#define NPY_LOGE2 0.693147180559945309417232121458176568 /* log_e 2 */
|
73 |
+
#define NPY_LOGE10 2.302585092994045684017991454684364208 /* log_e 10 */
|
74 |
+
#define NPY_PI 3.141592653589793238462643383279502884 /* pi */
|
75 |
+
#define NPY_PI_2 1.570796326794896619231321691639751442 /* pi/2 */
|
76 |
+
#define NPY_PI_4 0.785398163397448309615660845819875721 /* pi/4 */
|
77 |
+
#define NPY_1_PI 0.318309886183790671537767526745028724 /* 1/pi */
|
78 |
+
#define NPY_2_PI 0.636619772367581343075535053490057448 /* 2/pi */
|
79 |
+
#define NPY_EULER 0.577215664901532860606512090082402431 /* Euler constant */
|
80 |
+
#define NPY_SQRT2 1.414213562373095048801688724209698079 /* sqrt(2) */
|
81 |
+
#define NPY_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */
|
82 |
+
|
83 |
+
#define NPY_Ef 2.718281828459045235360287471352662498F /* e */
|
84 |
+
#define NPY_LOG2Ef 1.442695040888963407359924681001892137F /* log_2 e */
|
85 |
+
#define NPY_LOG10Ef 0.434294481903251827651128918916605082F /* log_10 e */
|
86 |
+
#define NPY_LOGE2f 0.693147180559945309417232121458176568F /* log_e 2 */
|
87 |
+
#define NPY_LOGE10f 2.302585092994045684017991454684364208F /* log_e 10 */
|
88 |
+
#define NPY_PIf 3.141592653589793238462643383279502884F /* pi */
|
89 |
+
#define NPY_PI_2f 1.570796326794896619231321691639751442F /* pi/2 */
|
90 |
+
#define NPY_PI_4f 0.785398163397448309615660845819875721F /* pi/4 */
|
91 |
+
#define NPY_1_PIf 0.318309886183790671537767526745028724F /* 1/pi */
|
92 |
+
#define NPY_2_PIf 0.636619772367581343075535053490057448F /* 2/pi */
|
93 |
+
#define NPY_EULERf 0.577215664901532860606512090082402431F /* Euler constant */
|
94 |
+
#define NPY_SQRT2f 1.414213562373095048801688724209698079F /* sqrt(2) */
|
95 |
+
#define NPY_SQRT1_2f 0.707106781186547524400844362104849039F /* 1/sqrt(2) */
|
96 |
+
|
97 |
+
#define NPY_El 2.718281828459045235360287471352662498L /* e */
|
98 |
+
#define NPY_LOG2El 1.442695040888963407359924681001892137L /* log_2 e */
|
99 |
+
#define NPY_LOG10El 0.434294481903251827651128918916605082L /* log_10 e */
|
100 |
+
#define NPY_LOGE2l 0.693147180559945309417232121458176568L /* log_e 2 */
|
101 |
+
#define NPY_LOGE10l 2.302585092994045684017991454684364208L /* log_e 10 */
|
102 |
+
#define NPY_PIl 3.141592653589793238462643383279502884L /* pi */
|
103 |
+
#define NPY_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */
|
104 |
+
#define NPY_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */
|
105 |
+
#define NPY_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */
|
106 |
+
#define NPY_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */
|
107 |
+
#define NPY_EULERl 0.577215664901532860606512090082402431L /* Euler constant */
|
108 |
+
#define NPY_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */
|
109 |
+
#define NPY_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */
|
110 |
+
|
111 |
+
/*
|
112 |
+
* Integer functions.
|
113 |
+
*/
|
114 |
+
NPY_INPLACE npy_uint npy_gcdu(npy_uint a, npy_uint b);
|
115 |
+
NPY_INPLACE npy_uint npy_lcmu(npy_uint a, npy_uint b);
|
116 |
+
NPY_INPLACE npy_ulong npy_gcdul(npy_ulong a, npy_ulong b);
|
117 |
+
NPY_INPLACE npy_ulong npy_lcmul(npy_ulong a, npy_ulong b);
|
118 |
+
NPY_INPLACE npy_ulonglong npy_gcdull(npy_ulonglong a, npy_ulonglong b);
|
119 |
+
NPY_INPLACE npy_ulonglong npy_lcmull(npy_ulonglong a, npy_ulonglong b);
|
120 |
+
|
121 |
+
NPY_INPLACE npy_int npy_gcd(npy_int a, npy_int b);
|
122 |
+
NPY_INPLACE npy_int npy_lcm(npy_int a, npy_int b);
|
123 |
+
NPY_INPLACE npy_long npy_gcdl(npy_long a, npy_long b);
|
124 |
+
NPY_INPLACE npy_long npy_lcml(npy_long a, npy_long b);
|
125 |
+
NPY_INPLACE npy_longlong npy_gcdll(npy_longlong a, npy_longlong b);
|
126 |
+
NPY_INPLACE npy_longlong npy_lcmll(npy_longlong a, npy_longlong b);
|
127 |
+
|
128 |
+
NPY_INPLACE npy_ubyte npy_rshiftuhh(npy_ubyte a, npy_ubyte b);
|
129 |
+
NPY_INPLACE npy_ubyte npy_lshiftuhh(npy_ubyte a, npy_ubyte b);
|
130 |
+
NPY_INPLACE npy_ushort npy_rshiftuh(npy_ushort a, npy_ushort b);
|
131 |
+
NPY_INPLACE npy_ushort npy_lshiftuh(npy_ushort a, npy_ushort b);
|
132 |
+
NPY_INPLACE npy_uint npy_rshiftu(npy_uint a, npy_uint b);
|
133 |
+
NPY_INPLACE npy_uint npy_lshiftu(npy_uint a, npy_uint b);
|
134 |
+
NPY_INPLACE npy_ulong npy_rshiftul(npy_ulong a, npy_ulong b);
|
135 |
+
NPY_INPLACE npy_ulong npy_lshiftul(npy_ulong a, npy_ulong b);
|
136 |
+
NPY_INPLACE npy_ulonglong npy_rshiftull(npy_ulonglong a, npy_ulonglong b);
|
137 |
+
NPY_INPLACE npy_ulonglong npy_lshiftull(npy_ulonglong a, npy_ulonglong b);
|
138 |
+
|
139 |
+
NPY_INPLACE npy_byte npy_rshifthh(npy_byte a, npy_byte b);
|
140 |
+
NPY_INPLACE npy_byte npy_lshifthh(npy_byte a, npy_byte b);
|
141 |
+
NPY_INPLACE npy_short npy_rshifth(npy_short a, npy_short b);
|
142 |
+
NPY_INPLACE npy_short npy_lshifth(npy_short a, npy_short b);
|
143 |
+
NPY_INPLACE npy_int npy_rshift(npy_int a, npy_int b);
|
144 |
+
NPY_INPLACE npy_int npy_lshift(npy_int a, npy_int b);
|
145 |
+
NPY_INPLACE npy_long npy_rshiftl(npy_long a, npy_long b);
|
146 |
+
NPY_INPLACE npy_long npy_lshiftl(npy_long a, npy_long b);
|
147 |
+
NPY_INPLACE npy_longlong npy_rshiftll(npy_longlong a, npy_longlong b);
|
148 |
+
NPY_INPLACE npy_longlong npy_lshiftll(npy_longlong a, npy_longlong b);
|
149 |
+
|
150 |
+
NPY_INPLACE uint8_t npy_popcountuhh(npy_ubyte a);
|
151 |
+
NPY_INPLACE uint8_t npy_popcountuh(npy_ushort a);
|
152 |
+
NPY_INPLACE uint8_t npy_popcountu(npy_uint a);
|
153 |
+
NPY_INPLACE uint8_t npy_popcountul(npy_ulong a);
|
154 |
+
NPY_INPLACE uint8_t npy_popcountull(npy_ulonglong a);
|
155 |
+
NPY_INPLACE uint8_t npy_popcounthh(npy_byte a);
|
156 |
+
NPY_INPLACE uint8_t npy_popcounth(npy_short a);
|
157 |
+
NPY_INPLACE uint8_t npy_popcount(npy_int a);
|
158 |
+
NPY_INPLACE uint8_t npy_popcountl(npy_long a);
|
159 |
+
NPY_INPLACE uint8_t npy_popcountll(npy_longlong a);
|
160 |
+
|
161 |
+
/*
|
162 |
+
* C99 double math funcs that need fixups or are blocklist-able
|
163 |
+
*/
|
164 |
+
NPY_INPLACE double npy_sin(double x);
|
165 |
+
NPY_INPLACE double npy_cos(double x);
|
166 |
+
NPY_INPLACE double npy_tan(double x);
|
167 |
+
NPY_INPLACE double npy_hypot(double x, double y);
|
168 |
+
NPY_INPLACE double npy_log2(double x);
|
169 |
+
NPY_INPLACE double npy_atan2(double x, double y);
|
170 |
+
|
171 |
+
/* Mandatory C99 double math funcs, no blocklisting or fixups */
|
172 |
+
/* defined for legacy reasons, should be deprecated at some point */
|
173 |
+
#define npy_sinh sinh
|
174 |
+
#define npy_cosh cosh
|
175 |
+
#define npy_tanh tanh
|
176 |
+
#define npy_asin asin
|
177 |
+
#define npy_acos acos
|
178 |
+
#define npy_atan atan
|
179 |
+
#define npy_log log
|
180 |
+
#define npy_log10 log10
|
181 |
+
#define npy_cbrt cbrt
|
182 |
+
#define npy_fabs fabs
|
183 |
+
#define npy_ceil ceil
|
184 |
+
#define npy_fmod fmod
|
185 |
+
#define npy_floor floor
|
186 |
+
#define npy_expm1 expm1
|
187 |
+
#define npy_log1p log1p
|
188 |
+
#define npy_acosh acosh
|
189 |
+
#define npy_asinh asinh
|
190 |
+
#define npy_atanh atanh
|
191 |
+
#define npy_rint rint
|
192 |
+
#define npy_trunc trunc
|
193 |
+
#define npy_exp2 exp2
|
194 |
+
#define npy_frexp frexp
|
195 |
+
#define npy_ldexp ldexp
|
196 |
+
#define npy_copysign copysign
|
197 |
+
#define npy_exp exp
|
198 |
+
#define npy_sqrt sqrt
|
199 |
+
#define npy_pow pow
|
200 |
+
#define npy_modf modf
|
201 |
+
#define npy_nextafter nextafter
|
202 |
+
|
203 |
+
double npy_spacing(double x);
|
204 |
+
|
205 |
+
/*
|
206 |
+
* IEEE 754 fpu handling
|
207 |
+
*/
|
208 |
+
|
209 |
+
/* use builtins to avoid function calls in tight loops
|
210 |
+
* only available if npy_config.h is available (= numpys own build) */
|
211 |
+
#ifdef HAVE___BUILTIN_ISNAN
|
212 |
+
#define npy_isnan(x) __builtin_isnan(x)
|
213 |
+
#else
|
214 |
+
#define npy_isnan(x) isnan(x)
|
215 |
+
#endif
|
216 |
+
|
217 |
+
|
218 |
+
/* only available if npy_config.h is available (= numpys own build) */
|
219 |
+
#ifdef HAVE___BUILTIN_ISFINITE
|
220 |
+
#define npy_isfinite(x) __builtin_isfinite(x)
|
221 |
+
#else
|
222 |
+
#define npy_isfinite(x) isfinite((x))
|
223 |
+
#endif
|
224 |
+
|
225 |
+
/* only available if npy_config.h is available (= numpys own build) */
|
226 |
+
#ifdef HAVE___BUILTIN_ISINF
|
227 |
+
#define npy_isinf(x) __builtin_isinf(x)
|
228 |
+
#else
|
229 |
+
#define npy_isinf(x) isinf((x))
|
230 |
+
#endif
|
231 |
+
|
232 |
+
#define npy_signbit(x) signbit((x))
|
233 |
+
|
234 |
+
/*
|
235 |
+
* float C99 math funcs that need fixups or are blocklist-able
|
236 |
+
*/
|
237 |
+
NPY_INPLACE float npy_sinf(float x);
|
238 |
+
NPY_INPLACE float npy_cosf(float x);
|
239 |
+
NPY_INPLACE float npy_tanf(float x);
|
240 |
+
NPY_INPLACE float npy_expf(float x);
|
241 |
+
NPY_INPLACE float npy_sqrtf(float x);
|
242 |
+
NPY_INPLACE float npy_hypotf(float x, float y);
|
243 |
+
NPY_INPLACE float npy_log2f(float x);
|
244 |
+
NPY_INPLACE float npy_atan2f(float x, float y);
|
245 |
+
NPY_INPLACE float npy_powf(float x, float y);
|
246 |
+
NPY_INPLACE float npy_modff(float x, float* y);
|
247 |
+
|
248 |
+
/* Mandatory C99 float math funcs, no blocklisting or fixups */
|
249 |
+
/* defined for legacy reasons, should be deprecated at some point */
|
250 |
+
|
251 |
+
#define npy_sinhf sinhf
|
252 |
+
#define npy_coshf coshf
|
253 |
+
#define npy_tanhf tanhf
|
254 |
+
#define npy_asinf asinf
|
255 |
+
#define npy_acosf acosf
|
256 |
+
#define npy_atanf atanf
|
257 |
+
#define npy_logf logf
|
258 |
+
#define npy_log10f log10f
|
259 |
+
#define npy_cbrtf cbrtf
|
260 |
+
#define npy_fabsf fabsf
|
261 |
+
#define npy_ceilf ceilf
|
262 |
+
#define npy_fmodf fmodf
|
263 |
+
#define npy_floorf floorf
|
264 |
+
#define npy_expm1f expm1f
|
265 |
+
#define npy_log1pf log1pf
|
266 |
+
#define npy_asinhf asinhf
|
267 |
+
#define npy_acoshf acoshf
|
268 |
+
#define npy_atanhf atanhf
|
269 |
+
#define npy_rintf rintf
|
270 |
+
#define npy_truncf truncf
|
271 |
+
#define npy_exp2f exp2f
|
272 |
+
#define npy_frexpf frexpf
|
273 |
+
#define npy_ldexpf ldexpf
|
274 |
+
#define npy_copysignf copysignf
|
275 |
+
#define npy_nextafterf nextafterf
|
276 |
+
|
277 |
+
float npy_spacingf(float x);
|
278 |
+
|
279 |
+
/*
|
280 |
+
* long double C99 double math funcs that need fixups or are blocklist-able
|
281 |
+
*/
|
282 |
+
NPY_INPLACE npy_longdouble npy_sinl(npy_longdouble x);
|
283 |
+
NPY_INPLACE npy_longdouble npy_cosl(npy_longdouble x);
|
284 |
+
NPY_INPLACE npy_longdouble npy_tanl(npy_longdouble x);
|
285 |
+
NPY_INPLACE npy_longdouble npy_expl(npy_longdouble x);
|
286 |
+
NPY_INPLACE npy_longdouble npy_sqrtl(npy_longdouble x);
|
287 |
+
NPY_INPLACE npy_longdouble npy_hypotl(npy_longdouble x, npy_longdouble y);
|
288 |
+
NPY_INPLACE npy_longdouble npy_log2l(npy_longdouble x);
|
289 |
+
NPY_INPLACE npy_longdouble npy_atan2l(npy_longdouble x, npy_longdouble y);
|
290 |
+
NPY_INPLACE npy_longdouble npy_powl(npy_longdouble x, npy_longdouble y);
|
291 |
+
NPY_INPLACE npy_longdouble npy_modfl(npy_longdouble x, npy_longdouble* y);
|
292 |
+
|
293 |
+
/* Mandatory C99 double math funcs, no blocklisting or fixups */
|
294 |
+
/* defined for legacy reasons, should be deprecated at some point */
|
295 |
+
#define npy_sinhl sinhl
|
296 |
+
#define npy_coshl coshl
|
297 |
+
#define npy_tanhl tanhl
|
298 |
+
#define npy_fabsl fabsl
|
299 |
+
#define npy_floorl floorl
|
300 |
+
#define npy_ceill ceill
|
301 |
+
#define npy_rintl rintl
|
302 |
+
#define npy_truncl truncl
|
303 |
+
#define npy_cbrtl cbrtl
|
304 |
+
#define npy_log10l log10l
|
305 |
+
#define npy_logl logl
|
306 |
+
#define npy_expm1l expm1l
|
307 |
+
#define npy_asinl asinl
|
308 |
+
#define npy_acosl acosl
|
309 |
+
#define npy_atanl atanl
|
310 |
+
#define npy_asinhl asinhl
|
311 |
+
#define npy_acoshl acoshl
|
312 |
+
#define npy_atanhl atanhl
|
313 |
+
#define npy_log1pl log1pl
|
314 |
+
#define npy_exp2l exp2l
|
315 |
+
#define npy_fmodl fmodl
|
316 |
+
#define npy_frexpl frexpl
|
317 |
+
#define npy_ldexpl ldexpl
|
318 |
+
#define npy_copysignl copysignl
|
319 |
+
#define npy_nextafterl nextafterl
|
320 |
+
|
321 |
+
npy_longdouble npy_spacingl(npy_longdouble x);
|
322 |
+
|
323 |
+
/*
|
324 |
+
* Non standard functions
|
325 |
+
*/
|
326 |
+
NPY_INPLACE double npy_deg2rad(double x);
|
327 |
+
NPY_INPLACE double npy_rad2deg(double x);
|
328 |
+
NPY_INPLACE double npy_logaddexp(double x, double y);
|
329 |
+
NPY_INPLACE double npy_logaddexp2(double x, double y);
|
330 |
+
NPY_INPLACE double npy_divmod(double x, double y, double *modulus);
|
331 |
+
NPY_INPLACE double npy_heaviside(double x, double h0);
|
332 |
+
|
333 |
+
NPY_INPLACE float npy_deg2radf(float x);
|
334 |
+
NPY_INPLACE float npy_rad2degf(float x);
|
335 |
+
NPY_INPLACE float npy_logaddexpf(float x, float y);
|
336 |
+
NPY_INPLACE float npy_logaddexp2f(float x, float y);
|
337 |
+
NPY_INPLACE float npy_divmodf(float x, float y, float *modulus);
|
338 |
+
NPY_INPLACE float npy_heavisidef(float x, float h0);
|
339 |
+
|
340 |
+
NPY_INPLACE npy_longdouble npy_deg2radl(npy_longdouble x);
|
341 |
+
NPY_INPLACE npy_longdouble npy_rad2degl(npy_longdouble x);
|
342 |
+
NPY_INPLACE npy_longdouble npy_logaddexpl(npy_longdouble x, npy_longdouble y);
|
343 |
+
NPY_INPLACE npy_longdouble npy_logaddexp2l(npy_longdouble x, npy_longdouble y);
|
344 |
+
NPY_INPLACE npy_longdouble npy_divmodl(npy_longdouble x, npy_longdouble y,
|
345 |
+
npy_longdouble *modulus);
|
346 |
+
NPY_INPLACE npy_longdouble npy_heavisidel(npy_longdouble x, npy_longdouble h0);
|
347 |
+
|
348 |
+
#define npy_degrees npy_rad2deg
|
349 |
+
#define npy_degreesf npy_rad2degf
|
350 |
+
#define npy_degreesl npy_rad2degl
|
351 |
+
|
352 |
+
#define npy_radians npy_deg2rad
|
353 |
+
#define npy_radiansf npy_deg2radf
|
354 |
+
#define npy_radiansl npy_deg2radl
|
355 |
+
|
356 |
+
/*
|
357 |
+
* Complex declarations
|
358 |
+
*/
|
359 |
+
|
360 |
+
/*
|
361 |
+
* C99 specifies that complex numbers have the same representation as
|
362 |
+
* an array of two elements, where the first element is the real part
|
363 |
+
* and the second element is the imaginary part.
|
364 |
+
*/
|
365 |
+
#define __NPY_CPACK_IMP(x, y, type, ctype) \
|
366 |
+
union { \
|
367 |
+
ctype z; \
|
368 |
+
type a[2]; \
|
369 |
+
} z1; \
|
370 |
+
\
|
371 |
+
z1.a[0] = (x); \
|
372 |
+
z1.a[1] = (y); \
|
373 |
+
\
|
374 |
+
return z1.z;
|
375 |
+
|
376 |
+
static inline npy_cdouble npy_cpack(double x, double y)
|
377 |
+
{
|
378 |
+
__NPY_CPACK_IMP(x, y, double, npy_cdouble);
|
379 |
+
}
|
380 |
+
|
381 |
+
static inline npy_cfloat npy_cpackf(float x, float y)
|
382 |
+
{
|
383 |
+
__NPY_CPACK_IMP(x, y, float, npy_cfloat);
|
384 |
+
}
|
385 |
+
|
386 |
+
static inline npy_clongdouble npy_cpackl(npy_longdouble x, npy_longdouble y)
|
387 |
+
{
|
388 |
+
__NPY_CPACK_IMP(x, y, npy_longdouble, npy_clongdouble);
|
389 |
+
}
|
390 |
+
#undef __NPY_CPACK_IMP
|
391 |
+
|
392 |
+
/*
|
393 |
+
* Same remark as above, but in the other direction: extract first/second
|
394 |
+
* member of complex number, assuming a C99-compatible representation
|
395 |
+
*
|
396 |
+
* Those are defineds as static inline, and such as a reasonable compiler would
|
397 |
+
* most likely compile this to one or two instructions (on CISC at least)
|
398 |
+
*/
|
399 |
+
#define __NPY_CEXTRACT_IMP(z, index, type, ctype) \
|
400 |
+
union { \
|
401 |
+
ctype z; \
|
402 |
+
type a[2]; \
|
403 |
+
} __z_repr; \
|
404 |
+
__z_repr.z = z; \
|
405 |
+
\
|
406 |
+
return __z_repr.a[index];
|
407 |
+
|
408 |
+
static inline double npy_creal(npy_cdouble z)
|
409 |
+
{
|
410 |
+
__NPY_CEXTRACT_IMP(z, 0, double, npy_cdouble);
|
411 |
+
}
|
412 |
+
|
413 |
+
static inline double npy_cimag(npy_cdouble z)
|
414 |
+
{
|
415 |
+
__NPY_CEXTRACT_IMP(z, 1, double, npy_cdouble);
|
416 |
+
}
|
417 |
+
|
418 |
+
static inline float npy_crealf(npy_cfloat z)
|
419 |
+
{
|
420 |
+
__NPY_CEXTRACT_IMP(z, 0, float, npy_cfloat);
|
421 |
+
}
|
422 |
+
|
423 |
+
static inline float npy_cimagf(npy_cfloat z)
|
424 |
+
{
|
425 |
+
__NPY_CEXTRACT_IMP(z, 1, float, npy_cfloat);
|
426 |
+
}
|
427 |
+
|
428 |
+
static inline npy_longdouble npy_creall(npy_clongdouble z)
|
429 |
+
{
|
430 |
+
__NPY_CEXTRACT_IMP(z, 0, npy_longdouble, npy_clongdouble);
|
431 |
+
}
|
432 |
+
|
433 |
+
static inline npy_longdouble npy_cimagl(npy_clongdouble z)
|
434 |
+
{
|
435 |
+
__NPY_CEXTRACT_IMP(z, 1, npy_longdouble, npy_clongdouble);
|
436 |
+
}
|
437 |
+
#undef __NPY_CEXTRACT_IMP
|
438 |
+
|
439 |
+
/*
|
440 |
+
* Double precision complex functions
|
441 |
+
*/
|
442 |
+
double npy_cabs(npy_cdouble z);
|
443 |
+
double npy_carg(npy_cdouble z);
|
444 |
+
|
445 |
+
npy_cdouble npy_cexp(npy_cdouble z);
|
446 |
+
npy_cdouble npy_clog(npy_cdouble z);
|
447 |
+
npy_cdouble npy_cpow(npy_cdouble x, npy_cdouble y);
|
448 |
+
|
449 |
+
npy_cdouble npy_csqrt(npy_cdouble z);
|
450 |
+
|
451 |
+
npy_cdouble npy_ccos(npy_cdouble z);
|
452 |
+
npy_cdouble npy_csin(npy_cdouble z);
|
453 |
+
npy_cdouble npy_ctan(npy_cdouble z);
|
454 |
+
|
455 |
+
npy_cdouble npy_ccosh(npy_cdouble z);
|
456 |
+
npy_cdouble npy_csinh(npy_cdouble z);
|
457 |
+
npy_cdouble npy_ctanh(npy_cdouble z);
|
458 |
+
|
459 |
+
npy_cdouble npy_cacos(npy_cdouble z);
|
460 |
+
npy_cdouble npy_casin(npy_cdouble z);
|
461 |
+
npy_cdouble npy_catan(npy_cdouble z);
|
462 |
+
|
463 |
+
npy_cdouble npy_cacosh(npy_cdouble z);
|
464 |
+
npy_cdouble npy_casinh(npy_cdouble z);
|
465 |
+
npy_cdouble npy_catanh(npy_cdouble z);
|
466 |
+
|
467 |
+
/*
|
468 |
+
* Single precision complex functions
|
469 |
+
*/
|
470 |
+
float npy_cabsf(npy_cfloat z);
|
471 |
+
float npy_cargf(npy_cfloat z);
|
472 |
+
|
473 |
+
npy_cfloat npy_cexpf(npy_cfloat z);
|
474 |
+
npy_cfloat npy_clogf(npy_cfloat z);
|
475 |
+
npy_cfloat npy_cpowf(npy_cfloat x, npy_cfloat y);
|
476 |
+
|
477 |
+
npy_cfloat npy_csqrtf(npy_cfloat z);
|
478 |
+
|
479 |
+
npy_cfloat npy_ccosf(npy_cfloat z);
|
480 |
+
npy_cfloat npy_csinf(npy_cfloat z);
|
481 |
+
npy_cfloat npy_ctanf(npy_cfloat z);
|
482 |
+
|
483 |
+
npy_cfloat npy_ccoshf(npy_cfloat z);
|
484 |
+
npy_cfloat npy_csinhf(npy_cfloat z);
|
485 |
+
npy_cfloat npy_ctanhf(npy_cfloat z);
|
486 |
+
|
487 |
+
npy_cfloat npy_cacosf(npy_cfloat z);
|
488 |
+
npy_cfloat npy_casinf(npy_cfloat z);
|
489 |
+
npy_cfloat npy_catanf(npy_cfloat z);
|
490 |
+
|
491 |
+
npy_cfloat npy_cacoshf(npy_cfloat z);
|
492 |
+
npy_cfloat npy_casinhf(npy_cfloat z);
|
493 |
+
npy_cfloat npy_catanhf(npy_cfloat z);
|
494 |
+
|
495 |
+
|
496 |
+
/*
|
497 |
+
* Extended precision complex functions
|
498 |
+
*/
|
499 |
+
npy_longdouble npy_cabsl(npy_clongdouble z);
|
500 |
+
npy_longdouble npy_cargl(npy_clongdouble z);
|
501 |
+
|
502 |
+
npy_clongdouble npy_cexpl(npy_clongdouble z);
|
503 |
+
npy_clongdouble npy_clogl(npy_clongdouble z);
|
504 |
+
npy_clongdouble npy_cpowl(npy_clongdouble x, npy_clongdouble y);
|
505 |
+
|
506 |
+
npy_clongdouble npy_csqrtl(npy_clongdouble z);
|
507 |
+
|
508 |
+
npy_clongdouble npy_ccosl(npy_clongdouble z);
|
509 |
+
npy_clongdouble npy_csinl(npy_clongdouble z);
|
510 |
+
npy_clongdouble npy_ctanl(npy_clongdouble z);
|
511 |
+
|
512 |
+
npy_clongdouble npy_ccoshl(npy_clongdouble z);
|
513 |
+
npy_clongdouble npy_csinhl(npy_clongdouble z);
|
514 |
+
npy_clongdouble npy_ctanhl(npy_clongdouble z);
|
515 |
+
|
516 |
+
npy_clongdouble npy_cacosl(npy_clongdouble z);
|
517 |
+
npy_clongdouble npy_casinl(npy_clongdouble z);
|
518 |
+
npy_clongdouble npy_catanl(npy_clongdouble z);
|
519 |
+
|
520 |
+
npy_clongdouble npy_cacoshl(npy_clongdouble z);
|
521 |
+
npy_clongdouble npy_casinhl(npy_clongdouble z);
|
522 |
+
npy_clongdouble npy_catanhl(npy_clongdouble z);
|
523 |
+
|
524 |
+
|
525 |
+
/*
|
526 |
+
* Functions that set the floating point error
|
527 |
+
* status word.
|
528 |
+
*/
|
529 |
+
|
530 |
+
/*
|
531 |
+
* platform-dependent code translates floating point
|
532 |
+
* status to an integer sum of these values
|
533 |
+
*/
|
534 |
+
#define NPY_FPE_DIVIDEBYZERO 1
|
535 |
+
#define NPY_FPE_OVERFLOW 2
|
536 |
+
#define NPY_FPE_UNDERFLOW 4
|
537 |
+
#define NPY_FPE_INVALID 8
|
538 |
+
|
539 |
+
int npy_clear_floatstatus_barrier(char*);
|
540 |
+
int npy_get_floatstatus_barrier(char*);
|
541 |
+
/*
|
542 |
+
* use caution with these - clang and gcc8.1 are known to reorder calls
|
543 |
+
* to this form of the function which can defeat the check. The _barrier
|
544 |
+
* form of the call is preferable, where the argument is
|
545 |
+
* (char*)&local_variable
|
546 |
+
*/
|
547 |
+
int npy_clear_floatstatus(void);
|
548 |
+
int npy_get_floatstatus(void);
|
549 |
+
|
550 |
+
void npy_set_floatstatus_divbyzero(void);
|
551 |
+
void npy_set_floatstatus_overflow(void);
|
552 |
+
void npy_set_floatstatus_underflow(void);
|
553 |
+
void npy_set_floatstatus_invalid(void);
|
554 |
+
|
555 |
+
#ifdef __cplusplus
|
556 |
+
}
|
557 |
+
#endif
|
558 |
+
|
559 |
+
#if NPY_INLINE_MATH
|
560 |
+
#include "npy_math_internal.h"
|
561 |
+
#endif
|
562 |
+
|
563 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_MATH_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_no_deprecated_api.h
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* This include file is provided for inclusion in Cython *.pyd files where
|
3 |
+
* one would like to define the NPY_NO_DEPRECATED_API macro. It can be
|
4 |
+
* included by
|
5 |
+
*
|
6 |
+
* cdef extern from "npy_no_deprecated_api.h": pass
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
#ifndef NPY_NO_DEPRECATED_API
|
10 |
+
|
11 |
+
/* put this check here since there may be multiple includes in C extensions. */
|
12 |
+
#if defined(NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_) || \
|
13 |
+
defined(NUMPY_CORE_INCLUDE_NUMPY_NPY_DEPRECATED_API_H) || \
|
14 |
+
defined(NUMPY_CORE_INCLUDE_NUMPY_OLD_DEFINES_H_)
|
15 |
+
#error "npy_no_deprecated_api.h" must be first among numpy includes.
|
16 |
+
#else
|
17 |
+
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
|
18 |
+
#endif
|
19 |
+
|
20 |
+
#endif /* NPY_NO_DEPRECATED_API */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/npy_os.h
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_
|
3 |
+
|
4 |
+
#if defined(linux) || defined(__linux) || defined(__linux__)
|
5 |
+
#define NPY_OS_LINUX
|
6 |
+
#elif defined(__FreeBSD__) || defined(__NetBSD__) || \
|
7 |
+
defined(__OpenBSD__) || defined(__DragonFly__)
|
8 |
+
#define NPY_OS_BSD
|
9 |
+
#ifdef __FreeBSD__
|
10 |
+
#define NPY_OS_FREEBSD
|
11 |
+
#elif defined(__NetBSD__)
|
12 |
+
#define NPY_OS_NETBSD
|
13 |
+
#elif defined(__OpenBSD__)
|
14 |
+
#define NPY_OS_OPENBSD
|
15 |
+
#elif defined(__DragonFly__)
|
16 |
+
#define NPY_OS_DRAGONFLY
|
17 |
+
#endif
|
18 |
+
#elif defined(sun) || defined(__sun)
|
19 |
+
#define NPY_OS_SOLARIS
|
20 |
+
#elif defined(__CYGWIN__)
|
21 |
+
#define NPY_OS_CYGWIN
|
22 |
+
/* We are on Windows.*/
|
23 |
+
#elif defined(_WIN32)
|
24 |
+
/* We are using MinGW (64-bit or 32-bit)*/
|
25 |
+
#if defined(__MINGW32__) || defined(__MINGW64__)
|
26 |
+
#define NPY_OS_MINGW
|
27 |
+
/* Otherwise, if _WIN64 is defined, we are targeting 64-bit Windows*/
|
28 |
+
#elif defined(_WIN64)
|
29 |
+
#define NPY_OS_WIN64
|
30 |
+
/* Otherwise assume we are targeting 32-bit Windows*/
|
31 |
+
#else
|
32 |
+
#define NPY_OS_WIN32
|
33 |
+
#endif
|
34 |
+
#elif defined(__APPLE__)
|
35 |
+
#define NPY_OS_DARWIN
|
36 |
+
#elif defined(__HAIKU__)
|
37 |
+
#define NPY_OS_HAIKU
|
38 |
+
#else
|
39 |
+
#define NPY_OS_UNKNOWN
|
40 |
+
#endif
|
41 |
+
|
42 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/numpyconfig.h
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_
|
3 |
+
|
4 |
+
#include "_numpyconfig.h"
|
5 |
+
|
6 |
+
/*
|
7 |
+
* On Mac OS X, because there is only one configuration stage for all the archs
|
8 |
+
* in universal builds, any macro which depends on the arch needs to be
|
9 |
+
* hardcoded.
|
10 |
+
*
|
11 |
+
* Note that distutils/pip will attempt a universal2 build when Python itself
|
12 |
+
* is built as universal2, hence this hardcoding is needed even if we do not
|
13 |
+
* support universal2 wheels anymore (see gh-22796).
|
14 |
+
* This code block can be removed after we have dropped the setup.py based
|
15 |
+
* build completely.
|
16 |
+
*/
|
17 |
+
#ifdef __APPLE__
|
18 |
+
#undef NPY_SIZEOF_LONG
|
19 |
+
#undef NPY_SIZEOF_PY_INTPTR_T
|
20 |
+
|
21 |
+
#ifdef __LP64__
|
22 |
+
#define NPY_SIZEOF_LONG 8
|
23 |
+
#define NPY_SIZEOF_PY_INTPTR_T 8
|
24 |
+
#else
|
25 |
+
#define NPY_SIZEOF_LONG 4
|
26 |
+
#define NPY_SIZEOF_PY_INTPTR_T 4
|
27 |
+
#endif
|
28 |
+
|
29 |
+
#undef NPY_SIZEOF_LONGDOUBLE
|
30 |
+
#undef NPY_SIZEOF_COMPLEX_LONGDOUBLE
|
31 |
+
#ifdef HAVE_LDOUBLE_IEEE_DOUBLE_LE
|
32 |
+
#undef HAVE_LDOUBLE_IEEE_DOUBLE_LE
|
33 |
+
#endif
|
34 |
+
#ifdef HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
|
35 |
+
#undef HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
|
36 |
+
#endif
|
37 |
+
|
38 |
+
#if defined(__arm64__)
|
39 |
+
#define NPY_SIZEOF_LONGDOUBLE 8
|
40 |
+
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16
|
41 |
+
#define HAVE_LDOUBLE_IEEE_DOUBLE_LE 1
|
42 |
+
#elif defined(__x86_64)
|
43 |
+
#define NPY_SIZEOF_LONGDOUBLE 16
|
44 |
+
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
|
45 |
+
#define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1
|
46 |
+
#elif defined (__i386)
|
47 |
+
#define NPY_SIZEOF_LONGDOUBLE 12
|
48 |
+
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 24
|
49 |
+
#elif defined(__ppc__) || defined (__ppc64__)
|
50 |
+
#define NPY_SIZEOF_LONGDOUBLE 16
|
51 |
+
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
|
52 |
+
#else
|
53 |
+
#error "unknown architecture"
|
54 |
+
#endif
|
55 |
+
#endif
|
56 |
+
|
57 |
+
|
58 |
+
/**
|
59 |
+
* To help with both NPY_TARGET_VERSION and the NPY_NO_DEPRECATED_API macro,
|
60 |
+
* we include API version numbers for specific versions of NumPy.
|
61 |
+
* To exclude all API that was deprecated as of 1.7, add the following before
|
62 |
+
* #including any NumPy headers:
|
63 |
+
* #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
|
64 |
+
* The same is true for NPY_TARGET_VERSION, although NumPy will default to
|
65 |
+
* a backwards compatible build anyway.
|
66 |
+
*/
|
67 |
+
#define NPY_1_7_API_VERSION 0x00000007
|
68 |
+
#define NPY_1_8_API_VERSION 0x00000008
|
69 |
+
#define NPY_1_9_API_VERSION 0x00000009
|
70 |
+
#define NPY_1_10_API_VERSION 0x0000000a
|
71 |
+
#define NPY_1_11_API_VERSION 0x0000000a
|
72 |
+
#define NPY_1_12_API_VERSION 0x0000000a
|
73 |
+
#define NPY_1_13_API_VERSION 0x0000000b
|
74 |
+
#define NPY_1_14_API_VERSION 0x0000000c
|
75 |
+
#define NPY_1_15_API_VERSION 0x0000000c
|
76 |
+
#define NPY_1_16_API_VERSION 0x0000000d
|
77 |
+
#define NPY_1_17_API_VERSION 0x0000000d
|
78 |
+
#define NPY_1_18_API_VERSION 0x0000000d
|
79 |
+
#define NPY_1_19_API_VERSION 0x0000000d
|
80 |
+
#define NPY_1_20_API_VERSION 0x0000000e
|
81 |
+
#define NPY_1_21_API_VERSION 0x0000000e
|
82 |
+
#define NPY_1_22_API_VERSION 0x0000000f
|
83 |
+
#define NPY_1_23_API_VERSION 0x00000010
|
84 |
+
#define NPY_1_24_API_VERSION 0x00000010
|
85 |
+
#define NPY_1_25_API_VERSION 0x00000011
|
86 |
+
|
87 |
+
|
88 |
+
/*
|
89 |
+
* Binary compatibility version number. This number is increased
|
90 |
+
* whenever the C-API is changed such that binary compatibility is
|
91 |
+
* broken, i.e. whenever a recompile of extension modules is needed.
|
92 |
+
*/
|
93 |
+
#define NPY_VERSION NPY_ABI_VERSION
|
94 |
+
|
95 |
+
/*
|
96 |
+
* Minor API version we are compiling to be compatible with. The version
|
97 |
+
* Number is always increased when the API changes via: `NPY_API_VERSION`
|
98 |
+
* (and should maybe just track the NumPy version).
|
99 |
+
*
|
100 |
+
* If we have an internal build, we always target the current version of
|
101 |
+
* course.
|
102 |
+
*
|
103 |
+
* For downstream users, we default to an older version to provide them with
|
104 |
+
* maximum compatibility by default. Downstream can choose to extend that
|
105 |
+
* default, or narrow it down if they wish to use newer API. If you adjust
|
106 |
+
* this, consider the Python version support (example for 1.25.x):
|
107 |
+
*
|
108 |
+
* NumPy 1.25.x supports Python: 3.9 3.10 3.11 (3.12)
|
109 |
+
* NumPy 1.19.x supports Python: 3.6 3.7 3.8 3.9
|
110 |
+
* NumPy 1.17.x supports Python: 3.5 3.6 3.7 3.8
|
111 |
+
* NumPy 1.15.x supports Python: ... 3.6 3.7
|
112 |
+
*
|
113 |
+
* Users of the stable ABI may wish to target the last Python that is not
|
114 |
+
* end of life. This would be 3.8 at NumPy 1.25 release time.
|
115 |
+
* 1.17 as default was the choice of oldest-support-numpy at the time and
|
116 |
+
* has in practice no limit (comapared to 1.19). Even earlier becomes legacy.
|
117 |
+
*/
|
118 |
+
#if defined(NPY_INTERNAL_BUILD) && NPY_INTERNAL_BUILD
|
119 |
+
/* NumPy internal build, always use current version. */
|
120 |
+
#define NPY_FEATURE_VERSION NPY_API_VERSION
|
121 |
+
#elif defined(NPY_TARGET_VERSION) && NPY_TARGET_VERSION
|
122 |
+
/* user provided a target version, use it */
|
123 |
+
#define NPY_FEATURE_VERSION NPY_TARGET_VERSION
|
124 |
+
#else
|
125 |
+
/* Use the default (increase when dropping Python 3.9 support) */
|
126 |
+
#define NPY_FEATURE_VERSION NPY_1_19_API_VERSION
|
127 |
+
#endif
|
128 |
+
|
129 |
+
/* Sanity check the (requested) feature version */
|
130 |
+
#if NPY_FEATURE_VERSION > NPY_API_VERSION
|
131 |
+
#error "NPY_TARGET_VERSION higher than NumPy headers!"
|
132 |
+
#elif NPY_FEATURE_VERSION < NPY_1_15_API_VERSION
|
133 |
+
/* No support for irrelevant old targets, no need for error, but warn. */
|
134 |
+
#warning "Requested NumPy target lower than supported NumPy 1.15."
|
135 |
+
#endif
|
136 |
+
|
137 |
+
|
138 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/old_defines.h
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* This header is deprecated as of NumPy 1.7 */
|
2 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_OLD_DEFINES_H_
|
3 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_OLD_DEFINES_H_
|
4 |
+
|
5 |
+
#if defined(NPY_NO_DEPRECATED_API) && NPY_NO_DEPRECATED_API >= NPY_1_7_API_VERSION
|
6 |
+
#error The header "old_defines.h" is deprecated as of NumPy 1.7.
|
7 |
+
#endif
|
8 |
+
|
9 |
+
#define NDARRAY_VERSION NPY_VERSION
|
10 |
+
|
11 |
+
#define PyArray_MIN_BUFSIZE NPY_MIN_BUFSIZE
|
12 |
+
#define PyArray_MAX_BUFSIZE NPY_MAX_BUFSIZE
|
13 |
+
#define PyArray_BUFSIZE NPY_BUFSIZE
|
14 |
+
|
15 |
+
#define PyArray_PRIORITY NPY_PRIORITY
|
16 |
+
#define PyArray_SUBTYPE_PRIORITY NPY_PRIORITY
|
17 |
+
#define PyArray_NUM_FLOATTYPE NPY_NUM_FLOATTYPE
|
18 |
+
|
19 |
+
#define NPY_MAX PyArray_MAX
|
20 |
+
#define NPY_MIN PyArray_MIN
|
21 |
+
|
22 |
+
#define PyArray_TYPES NPY_TYPES
|
23 |
+
#define PyArray_BOOL NPY_BOOL
|
24 |
+
#define PyArray_BYTE NPY_BYTE
|
25 |
+
#define PyArray_UBYTE NPY_UBYTE
|
26 |
+
#define PyArray_SHORT NPY_SHORT
|
27 |
+
#define PyArray_USHORT NPY_USHORT
|
28 |
+
#define PyArray_INT NPY_INT
|
29 |
+
#define PyArray_UINT NPY_UINT
|
30 |
+
#define PyArray_LONG NPY_LONG
|
31 |
+
#define PyArray_ULONG NPY_ULONG
|
32 |
+
#define PyArray_LONGLONG NPY_LONGLONG
|
33 |
+
#define PyArray_ULONGLONG NPY_ULONGLONG
|
34 |
+
#define PyArray_HALF NPY_HALF
|
35 |
+
#define PyArray_FLOAT NPY_FLOAT
|
36 |
+
#define PyArray_DOUBLE NPY_DOUBLE
|
37 |
+
#define PyArray_LONGDOUBLE NPY_LONGDOUBLE
|
38 |
+
#define PyArray_CFLOAT NPY_CFLOAT
|
39 |
+
#define PyArray_CDOUBLE NPY_CDOUBLE
|
40 |
+
#define PyArray_CLONGDOUBLE NPY_CLONGDOUBLE
|
41 |
+
#define PyArray_OBJECT NPY_OBJECT
|
42 |
+
#define PyArray_STRING NPY_STRING
|
43 |
+
#define PyArray_UNICODE NPY_UNICODE
|
44 |
+
#define PyArray_VOID NPY_VOID
|
45 |
+
#define PyArray_DATETIME NPY_DATETIME
|
46 |
+
#define PyArray_TIMEDELTA NPY_TIMEDELTA
|
47 |
+
#define PyArray_NTYPES NPY_NTYPES
|
48 |
+
#define PyArray_NOTYPE NPY_NOTYPE
|
49 |
+
#define PyArray_CHAR NPY_CHAR
|
50 |
+
#define PyArray_USERDEF NPY_USERDEF
|
51 |
+
#define PyArray_NUMUSERTYPES NPY_NUMUSERTYPES
|
52 |
+
|
53 |
+
#define PyArray_INTP NPY_INTP
|
54 |
+
#define PyArray_UINTP NPY_UINTP
|
55 |
+
|
56 |
+
#define PyArray_INT8 NPY_INT8
|
57 |
+
#define PyArray_UINT8 NPY_UINT8
|
58 |
+
#define PyArray_INT16 NPY_INT16
|
59 |
+
#define PyArray_UINT16 NPY_UINT16
|
60 |
+
#define PyArray_INT32 NPY_INT32
|
61 |
+
#define PyArray_UINT32 NPY_UINT32
|
62 |
+
|
63 |
+
#ifdef NPY_INT64
|
64 |
+
#define PyArray_INT64 NPY_INT64
|
65 |
+
#define PyArray_UINT64 NPY_UINT64
|
66 |
+
#endif
|
67 |
+
|
68 |
+
#ifdef NPY_INT128
|
69 |
+
#define PyArray_INT128 NPY_INT128
|
70 |
+
#define PyArray_UINT128 NPY_UINT128
|
71 |
+
#endif
|
72 |
+
|
73 |
+
#ifdef NPY_FLOAT16
|
74 |
+
#define PyArray_FLOAT16 NPY_FLOAT16
|
75 |
+
#define PyArray_COMPLEX32 NPY_COMPLEX32
|
76 |
+
#endif
|
77 |
+
|
78 |
+
#ifdef NPY_FLOAT80
|
79 |
+
#define PyArray_FLOAT80 NPY_FLOAT80
|
80 |
+
#define PyArray_COMPLEX160 NPY_COMPLEX160
|
81 |
+
#endif
|
82 |
+
|
83 |
+
#ifdef NPY_FLOAT96
|
84 |
+
#define PyArray_FLOAT96 NPY_FLOAT96
|
85 |
+
#define PyArray_COMPLEX192 NPY_COMPLEX192
|
86 |
+
#endif
|
87 |
+
|
88 |
+
#ifdef NPY_FLOAT128
|
89 |
+
#define PyArray_FLOAT128 NPY_FLOAT128
|
90 |
+
#define PyArray_COMPLEX256 NPY_COMPLEX256
|
91 |
+
#endif
|
92 |
+
|
93 |
+
#define PyArray_FLOAT32 NPY_FLOAT32
|
94 |
+
#define PyArray_COMPLEX64 NPY_COMPLEX64
|
95 |
+
#define PyArray_FLOAT64 NPY_FLOAT64
|
96 |
+
#define PyArray_COMPLEX128 NPY_COMPLEX128
|
97 |
+
|
98 |
+
|
99 |
+
#define PyArray_TYPECHAR NPY_TYPECHAR
|
100 |
+
#define PyArray_BOOLLTR NPY_BOOLLTR
|
101 |
+
#define PyArray_BYTELTR NPY_BYTELTR
|
102 |
+
#define PyArray_UBYTELTR NPY_UBYTELTR
|
103 |
+
#define PyArray_SHORTLTR NPY_SHORTLTR
|
104 |
+
#define PyArray_USHORTLTR NPY_USHORTLTR
|
105 |
+
#define PyArray_INTLTR NPY_INTLTR
|
106 |
+
#define PyArray_UINTLTR NPY_UINTLTR
|
107 |
+
#define PyArray_LONGLTR NPY_LONGLTR
|
108 |
+
#define PyArray_ULONGLTR NPY_ULONGLTR
|
109 |
+
#define PyArray_LONGLONGLTR NPY_LONGLONGLTR
|
110 |
+
#define PyArray_ULONGLONGLTR NPY_ULONGLONGLTR
|
111 |
+
#define PyArray_HALFLTR NPY_HALFLTR
|
112 |
+
#define PyArray_FLOATLTR NPY_FLOATLTR
|
113 |
+
#define PyArray_DOUBLELTR NPY_DOUBLELTR
|
114 |
+
#define PyArray_LONGDOUBLELTR NPY_LONGDOUBLELTR
|
115 |
+
#define PyArray_CFLOATLTR NPY_CFLOATLTR
|
116 |
+
#define PyArray_CDOUBLELTR NPY_CDOUBLELTR
|
117 |
+
#define PyArray_CLONGDOUBLELTR NPY_CLONGDOUBLELTR
|
118 |
+
#define PyArray_OBJECTLTR NPY_OBJECTLTR
|
119 |
+
#define PyArray_STRINGLTR NPY_STRINGLTR
|
120 |
+
#define PyArray_STRINGLTR2 NPY_STRINGLTR2
|
121 |
+
#define PyArray_UNICODELTR NPY_UNICODELTR
|
122 |
+
#define PyArray_VOIDLTR NPY_VOIDLTR
|
123 |
+
#define PyArray_DATETIMELTR NPY_DATETIMELTR
|
124 |
+
#define PyArray_TIMEDELTALTR NPY_TIMEDELTALTR
|
125 |
+
#define PyArray_CHARLTR NPY_CHARLTR
|
126 |
+
#define PyArray_INTPLTR NPY_INTPLTR
|
127 |
+
#define PyArray_UINTPLTR NPY_UINTPLTR
|
128 |
+
#define PyArray_GENBOOLLTR NPY_GENBOOLLTR
|
129 |
+
#define PyArray_SIGNEDLTR NPY_SIGNEDLTR
|
130 |
+
#define PyArray_UNSIGNEDLTR NPY_UNSIGNEDLTR
|
131 |
+
#define PyArray_FLOATINGLTR NPY_FLOATINGLTR
|
132 |
+
#define PyArray_COMPLEXLTR NPY_COMPLEXLTR
|
133 |
+
|
134 |
+
#define PyArray_QUICKSORT NPY_QUICKSORT
|
135 |
+
#define PyArray_HEAPSORT NPY_HEAPSORT
|
136 |
+
#define PyArray_MERGESORT NPY_MERGESORT
|
137 |
+
#define PyArray_SORTKIND NPY_SORTKIND
|
138 |
+
#define PyArray_NSORTS NPY_NSORTS
|
139 |
+
|
140 |
+
#define PyArray_NOSCALAR NPY_NOSCALAR
|
141 |
+
#define PyArray_BOOL_SCALAR NPY_BOOL_SCALAR
|
142 |
+
#define PyArray_INTPOS_SCALAR NPY_INTPOS_SCALAR
|
143 |
+
#define PyArray_INTNEG_SCALAR NPY_INTNEG_SCALAR
|
144 |
+
#define PyArray_FLOAT_SCALAR NPY_FLOAT_SCALAR
|
145 |
+
#define PyArray_COMPLEX_SCALAR NPY_COMPLEX_SCALAR
|
146 |
+
#define PyArray_OBJECT_SCALAR NPY_OBJECT_SCALAR
|
147 |
+
#define PyArray_SCALARKIND NPY_SCALARKIND
|
148 |
+
#define PyArray_NSCALARKINDS NPY_NSCALARKINDS
|
149 |
+
|
150 |
+
#define PyArray_ANYORDER NPY_ANYORDER
|
151 |
+
#define PyArray_CORDER NPY_CORDER
|
152 |
+
#define PyArray_FORTRANORDER NPY_FORTRANORDER
|
153 |
+
#define PyArray_ORDER NPY_ORDER
|
154 |
+
|
155 |
+
#define PyDescr_ISBOOL PyDataType_ISBOOL
|
156 |
+
#define PyDescr_ISUNSIGNED PyDataType_ISUNSIGNED
|
157 |
+
#define PyDescr_ISSIGNED PyDataType_ISSIGNED
|
158 |
+
#define PyDescr_ISINTEGER PyDataType_ISINTEGER
|
159 |
+
#define PyDescr_ISFLOAT PyDataType_ISFLOAT
|
160 |
+
#define PyDescr_ISNUMBER PyDataType_ISNUMBER
|
161 |
+
#define PyDescr_ISSTRING PyDataType_ISSTRING
|
162 |
+
#define PyDescr_ISCOMPLEX PyDataType_ISCOMPLEX
|
163 |
+
#define PyDescr_ISPYTHON PyDataType_ISPYTHON
|
164 |
+
#define PyDescr_ISFLEXIBLE PyDataType_ISFLEXIBLE
|
165 |
+
#define PyDescr_ISUSERDEF PyDataType_ISUSERDEF
|
166 |
+
#define PyDescr_ISEXTENDED PyDataType_ISEXTENDED
|
167 |
+
#define PyDescr_ISOBJECT PyDataType_ISOBJECT
|
168 |
+
#define PyDescr_HASFIELDS PyDataType_HASFIELDS
|
169 |
+
|
170 |
+
#define PyArray_LITTLE NPY_LITTLE
|
171 |
+
#define PyArray_BIG NPY_BIG
|
172 |
+
#define PyArray_NATIVE NPY_NATIVE
|
173 |
+
#define PyArray_SWAP NPY_SWAP
|
174 |
+
#define PyArray_IGNORE NPY_IGNORE
|
175 |
+
|
176 |
+
#define PyArray_NATBYTE NPY_NATBYTE
|
177 |
+
#define PyArray_OPPBYTE NPY_OPPBYTE
|
178 |
+
|
179 |
+
#define PyArray_MAX_ELSIZE NPY_MAX_ELSIZE
|
180 |
+
|
181 |
+
#define PyArray_USE_PYMEM NPY_USE_PYMEM
|
182 |
+
|
183 |
+
#define PyArray_RemoveLargest PyArray_RemoveSmallest
|
184 |
+
|
185 |
+
#define PyArray_UCS4 npy_ucs4
|
186 |
+
|
187 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_OLD_DEFINES_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/ufuncobject.h
ADDED
@@ -0,0 +1,359 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_UFUNCOBJECT_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_UFUNCOBJECT_H_
|
3 |
+
|
4 |
+
#include <numpy/npy_math.h>
|
5 |
+
#include <numpy/npy_common.h>
|
6 |
+
|
7 |
+
#ifdef __cplusplus
|
8 |
+
extern "C" {
|
9 |
+
#endif
|
10 |
+
|
11 |
+
/*
|
12 |
+
* The legacy generic inner loop for a standard element-wise or
|
13 |
+
* generalized ufunc.
|
14 |
+
*/
|
15 |
+
typedef void (*PyUFuncGenericFunction)
|
16 |
+
(char **args,
|
17 |
+
npy_intp const *dimensions,
|
18 |
+
npy_intp const *strides,
|
19 |
+
void *innerloopdata);
|
20 |
+
|
21 |
+
/*
|
22 |
+
* The most generic one-dimensional inner loop for
|
23 |
+
* a masked standard element-wise ufunc. "Masked" here means that it skips
|
24 |
+
* doing calculations on any items for which the maskptr array has a true
|
25 |
+
* value.
|
26 |
+
*/
|
27 |
+
typedef void (PyUFunc_MaskedStridedInnerLoopFunc)(
|
28 |
+
char **dataptrs, npy_intp *strides,
|
29 |
+
char *maskptr, npy_intp mask_stride,
|
30 |
+
npy_intp count,
|
31 |
+
NpyAuxData *innerloopdata);
|
32 |
+
|
33 |
+
/* Forward declaration for the type resolver and loop selector typedefs */
|
34 |
+
struct _tagPyUFuncObject;
|
35 |
+
|
36 |
+
/*
|
37 |
+
* Given the operands for calling a ufunc, should determine the
|
38 |
+
* calculation input and output data types and return an inner loop function.
|
39 |
+
* This function should validate that the casting rule is being followed,
|
40 |
+
* and fail if it is not.
|
41 |
+
*
|
42 |
+
* For backwards compatibility, the regular type resolution function does not
|
43 |
+
* support auxiliary data with object semantics. The type resolution call
|
44 |
+
* which returns a masked generic function returns a standard NpyAuxData
|
45 |
+
* object, for which the NPY_AUXDATA_FREE and NPY_AUXDATA_CLONE macros
|
46 |
+
* work.
|
47 |
+
*
|
48 |
+
* ufunc: The ufunc object.
|
49 |
+
* casting: The 'casting' parameter provided to the ufunc.
|
50 |
+
* operands: An array of length (ufunc->nin + ufunc->nout),
|
51 |
+
* with the output parameters possibly NULL.
|
52 |
+
* type_tup: Either NULL, or the type_tup passed to the ufunc.
|
53 |
+
* out_dtypes: An array which should be populated with new
|
54 |
+
* references to (ufunc->nin + ufunc->nout) new
|
55 |
+
* dtypes, one for each input and output. These
|
56 |
+
* dtypes should all be in native-endian format.
|
57 |
+
*
|
58 |
+
* Should return 0 on success, -1 on failure (with exception set),
|
59 |
+
* or -2 if Py_NotImplemented should be returned.
|
60 |
+
*/
|
61 |
+
typedef int (PyUFunc_TypeResolutionFunc)(
|
62 |
+
struct _tagPyUFuncObject *ufunc,
|
63 |
+
NPY_CASTING casting,
|
64 |
+
PyArrayObject **operands,
|
65 |
+
PyObject *type_tup,
|
66 |
+
PyArray_Descr **out_dtypes);
|
67 |
+
|
68 |
+
/*
|
69 |
+
* Legacy loop selector. (This should NOT normally be used and we can expect
|
70 |
+
* that only the `PyUFunc_DefaultLegacyInnerLoopSelector` is ever set).
|
71 |
+
* However, unlike the masked version, it probably still works.
|
72 |
+
*
|
73 |
+
* ufunc: The ufunc object.
|
74 |
+
* dtypes: An array which has been populated with dtypes,
|
75 |
+
* in most cases by the type resolution function
|
76 |
+
* for the same ufunc.
|
77 |
+
* out_innerloop: Should be populated with the correct ufunc inner
|
78 |
+
* loop for the given type.
|
79 |
+
* out_innerloopdata: Should be populated with the void* data to
|
80 |
+
* be passed into the out_innerloop function.
|
81 |
+
* out_needs_api: If the inner loop needs to use the Python API,
|
82 |
+
* should set the to 1, otherwise should leave
|
83 |
+
* this untouched.
|
84 |
+
*/
|
85 |
+
typedef int (PyUFunc_LegacyInnerLoopSelectionFunc)(
|
86 |
+
struct _tagPyUFuncObject *ufunc,
|
87 |
+
PyArray_Descr **dtypes,
|
88 |
+
PyUFuncGenericFunction *out_innerloop,
|
89 |
+
void **out_innerloopdata,
|
90 |
+
int *out_needs_api);
|
91 |
+
|
92 |
+
|
93 |
+
typedef struct _tagPyUFuncObject {
|
94 |
+
PyObject_HEAD
|
95 |
+
/*
|
96 |
+
* nin: Number of inputs
|
97 |
+
* nout: Number of outputs
|
98 |
+
* nargs: Always nin + nout (Why is it stored?)
|
99 |
+
*/
|
100 |
+
int nin, nout, nargs;
|
101 |
+
|
102 |
+
/*
|
103 |
+
* Identity for reduction, any of PyUFunc_One, PyUFunc_Zero
|
104 |
+
* PyUFunc_MinusOne, PyUFunc_None, PyUFunc_ReorderableNone,
|
105 |
+
* PyUFunc_IdentityValue.
|
106 |
+
*/
|
107 |
+
int identity;
|
108 |
+
|
109 |
+
/* Array of one-dimensional core loops */
|
110 |
+
PyUFuncGenericFunction *functions;
|
111 |
+
/* Array of funcdata that gets passed into the functions */
|
112 |
+
void **data;
|
113 |
+
/* The number of elements in 'functions' and 'data' */
|
114 |
+
int ntypes;
|
115 |
+
|
116 |
+
/* Used to be unused field 'check_return' */
|
117 |
+
int reserved1;
|
118 |
+
|
119 |
+
/* The name of the ufunc */
|
120 |
+
const char *name;
|
121 |
+
|
122 |
+
/* Array of type numbers, of size ('nargs' * 'ntypes') */
|
123 |
+
char *types;
|
124 |
+
|
125 |
+
/* Documentation string */
|
126 |
+
const char *doc;
|
127 |
+
|
128 |
+
void *ptr;
|
129 |
+
PyObject *obj;
|
130 |
+
PyObject *userloops;
|
131 |
+
|
132 |
+
/* generalized ufunc parameters */
|
133 |
+
|
134 |
+
/* 0 for scalar ufunc; 1 for generalized ufunc */
|
135 |
+
int core_enabled;
|
136 |
+
/* number of distinct dimension names in signature */
|
137 |
+
int core_num_dim_ix;
|
138 |
+
|
139 |
+
/*
|
140 |
+
* dimension indices of input/output argument k are stored in
|
141 |
+
* core_dim_ixs[core_offsets[k]..core_offsets[k]+core_num_dims[k]-1]
|
142 |
+
*/
|
143 |
+
|
144 |
+
/* numbers of core dimensions of each argument */
|
145 |
+
int *core_num_dims;
|
146 |
+
/*
|
147 |
+
* dimension indices in a flatted form; indices
|
148 |
+
* are in the range of [0,core_num_dim_ix)
|
149 |
+
*/
|
150 |
+
int *core_dim_ixs;
|
151 |
+
/*
|
152 |
+
* positions of 1st core dimensions of each
|
153 |
+
* argument in core_dim_ixs, equivalent to cumsum(core_num_dims)
|
154 |
+
*/
|
155 |
+
int *core_offsets;
|
156 |
+
/* signature string for printing purpose */
|
157 |
+
char *core_signature;
|
158 |
+
|
159 |
+
/*
|
160 |
+
* A function which resolves the types and fills an array
|
161 |
+
* with the dtypes for the inputs and outputs.
|
162 |
+
*/
|
163 |
+
PyUFunc_TypeResolutionFunc *type_resolver;
|
164 |
+
/*
|
165 |
+
* A function which returns an inner loop written for
|
166 |
+
* NumPy 1.6 and earlier ufuncs. This is for backwards
|
167 |
+
* compatibility, and may be NULL if inner_loop_selector
|
168 |
+
* is specified.
|
169 |
+
*/
|
170 |
+
PyUFunc_LegacyInnerLoopSelectionFunc *legacy_inner_loop_selector;
|
171 |
+
/*
|
172 |
+
* This was blocked off to be the "new" inner loop selector in 1.7,
|
173 |
+
* but this was never implemented. (This is also why the above
|
174 |
+
* selector is called the "legacy" selector.)
|
175 |
+
*/
|
176 |
+
#ifndef Py_LIMITED_API
|
177 |
+
vectorcallfunc vectorcall;
|
178 |
+
#else
|
179 |
+
void *vectorcall;
|
180 |
+
#endif
|
181 |
+
|
182 |
+
/* Was previously the `PyUFunc_MaskedInnerLoopSelectionFunc` */
|
183 |
+
void *_always_null_previously_masked_innerloop_selector;
|
184 |
+
|
185 |
+
/*
|
186 |
+
* List of flags for each operand when ufunc is called by nditer object.
|
187 |
+
* These flags will be used in addition to the default flags for each
|
188 |
+
* operand set by nditer object.
|
189 |
+
*/
|
190 |
+
npy_uint32 *op_flags;
|
191 |
+
|
192 |
+
/*
|
193 |
+
* List of global flags used when ufunc is called by nditer object.
|
194 |
+
* These flags will be used in addition to the default global flags
|
195 |
+
* set by nditer object.
|
196 |
+
*/
|
197 |
+
npy_uint32 iter_flags;
|
198 |
+
|
199 |
+
/* New in NPY_API_VERSION 0x0000000D and above */
|
200 |
+
#if NPY_FEATURE_VERSION >= NPY_1_16_API_VERSION
|
201 |
+
/*
|
202 |
+
* for each core_num_dim_ix distinct dimension names,
|
203 |
+
* the possible "frozen" size (-1 if not frozen).
|
204 |
+
*/
|
205 |
+
npy_intp *core_dim_sizes;
|
206 |
+
|
207 |
+
/*
|
208 |
+
* for each distinct core dimension, a set of UFUNC_CORE_DIM* flags
|
209 |
+
*/
|
210 |
+
npy_uint32 *core_dim_flags;
|
211 |
+
|
212 |
+
/* Identity for reduction, when identity == PyUFunc_IdentityValue */
|
213 |
+
PyObject *identity_value;
|
214 |
+
#endif /* NPY_FEATURE_VERSION >= NPY_1_16_API_VERSION */
|
215 |
+
|
216 |
+
/* New in NPY_API_VERSION 0x0000000F and above */
|
217 |
+
#if NPY_FEATURE_VERSION >= NPY_1_22_API_VERSION
|
218 |
+
/* New private fields related to dispatching */
|
219 |
+
void *_dispatch_cache;
|
220 |
+
/* A PyListObject of `(tuple of DTypes, ArrayMethod/Promoter)` */
|
221 |
+
PyObject *_loops;
|
222 |
+
#endif
|
223 |
+
} PyUFuncObject;
|
224 |
+
|
225 |
+
#include "arrayobject.h"
|
226 |
+
/* Generalized ufunc; 0x0001 reserved for possible use as CORE_ENABLED */
|
227 |
+
/* the core dimension's size will be determined by the operands. */
|
228 |
+
#define UFUNC_CORE_DIM_SIZE_INFERRED 0x0002
|
229 |
+
/* the core dimension may be absent */
|
230 |
+
#define UFUNC_CORE_DIM_CAN_IGNORE 0x0004
|
231 |
+
/* flags inferred during execution */
|
232 |
+
#define UFUNC_CORE_DIM_MISSING 0x00040000
|
233 |
+
|
234 |
+
#define UFUNC_ERR_IGNORE 0
|
235 |
+
#define UFUNC_ERR_WARN 1
|
236 |
+
#define UFUNC_ERR_RAISE 2
|
237 |
+
#define UFUNC_ERR_CALL 3
|
238 |
+
#define UFUNC_ERR_PRINT 4
|
239 |
+
#define UFUNC_ERR_LOG 5
|
240 |
+
|
241 |
+
/* Python side integer mask */
|
242 |
+
|
243 |
+
#define UFUNC_MASK_DIVIDEBYZERO 0x07
|
244 |
+
#define UFUNC_MASK_OVERFLOW 0x3f
|
245 |
+
#define UFUNC_MASK_UNDERFLOW 0x1ff
|
246 |
+
#define UFUNC_MASK_INVALID 0xfff
|
247 |
+
|
248 |
+
#define UFUNC_SHIFT_DIVIDEBYZERO 0
|
249 |
+
#define UFUNC_SHIFT_OVERFLOW 3
|
250 |
+
#define UFUNC_SHIFT_UNDERFLOW 6
|
251 |
+
#define UFUNC_SHIFT_INVALID 9
|
252 |
+
|
253 |
+
|
254 |
+
#define UFUNC_OBJ_ISOBJECT 1
|
255 |
+
#define UFUNC_OBJ_NEEDS_API 2
|
256 |
+
|
257 |
+
/* Default user error mode */
|
258 |
+
#define UFUNC_ERR_DEFAULT \
|
259 |
+
(UFUNC_ERR_WARN << UFUNC_SHIFT_DIVIDEBYZERO) + \
|
260 |
+
(UFUNC_ERR_WARN << UFUNC_SHIFT_OVERFLOW) + \
|
261 |
+
(UFUNC_ERR_WARN << UFUNC_SHIFT_INVALID)
|
262 |
+
|
263 |
+
#if NPY_ALLOW_THREADS
|
264 |
+
#define NPY_LOOP_BEGIN_THREADS do {if (!(loop->obj & UFUNC_OBJ_NEEDS_API)) _save = PyEval_SaveThread();} while (0);
|
265 |
+
#define NPY_LOOP_END_THREADS do {if (!(loop->obj & UFUNC_OBJ_NEEDS_API)) PyEval_RestoreThread(_save);} while (0);
|
266 |
+
#else
|
267 |
+
#define NPY_LOOP_BEGIN_THREADS
|
268 |
+
#define NPY_LOOP_END_THREADS
|
269 |
+
#endif
|
270 |
+
|
271 |
+
/*
|
272 |
+
* UFunc has unit of 0, and the order of operations can be reordered
|
273 |
+
* This case allows reduction with multiple axes at once.
|
274 |
+
*/
|
275 |
+
#define PyUFunc_Zero 0
|
276 |
+
/*
|
277 |
+
* UFunc has unit of 1, and the order of operations can be reordered
|
278 |
+
* This case allows reduction with multiple axes at once.
|
279 |
+
*/
|
280 |
+
#define PyUFunc_One 1
|
281 |
+
/*
|
282 |
+
* UFunc has unit of -1, and the order of operations can be reordered
|
283 |
+
* This case allows reduction with multiple axes at once. Intended for
|
284 |
+
* bitwise_and reduction.
|
285 |
+
*/
|
286 |
+
#define PyUFunc_MinusOne 2
|
287 |
+
/*
|
288 |
+
* UFunc has no unit, and the order of operations cannot be reordered.
|
289 |
+
* This case does not allow reduction with multiple axes at once.
|
290 |
+
*/
|
291 |
+
#define PyUFunc_None -1
|
292 |
+
/*
|
293 |
+
* UFunc has no unit, and the order of operations can be reordered
|
294 |
+
* This case allows reduction with multiple axes at once.
|
295 |
+
*/
|
296 |
+
#define PyUFunc_ReorderableNone -2
|
297 |
+
/*
|
298 |
+
* UFunc unit is an identity_value, and the order of operations can be reordered
|
299 |
+
* This case allows reduction with multiple axes at once.
|
300 |
+
*/
|
301 |
+
#define PyUFunc_IdentityValue -3
|
302 |
+
|
303 |
+
|
304 |
+
#define UFUNC_REDUCE 0
|
305 |
+
#define UFUNC_ACCUMULATE 1
|
306 |
+
#define UFUNC_REDUCEAT 2
|
307 |
+
#define UFUNC_OUTER 3
|
308 |
+
|
309 |
+
|
310 |
+
typedef struct {
|
311 |
+
int nin;
|
312 |
+
int nout;
|
313 |
+
PyObject *callable;
|
314 |
+
} PyUFunc_PyFuncData;
|
315 |
+
|
316 |
+
/* A linked-list of function information for
|
317 |
+
user-defined 1-d loops.
|
318 |
+
*/
|
319 |
+
typedef struct _loop1d_info {
|
320 |
+
PyUFuncGenericFunction func;
|
321 |
+
void *data;
|
322 |
+
int *arg_types;
|
323 |
+
struct _loop1d_info *next;
|
324 |
+
int nargs;
|
325 |
+
PyArray_Descr **arg_dtypes;
|
326 |
+
} PyUFunc_Loop1d;
|
327 |
+
|
328 |
+
|
329 |
+
#include "__ufunc_api.h"
|
330 |
+
|
331 |
+
#define UFUNC_PYVALS_NAME "UFUNC_PYVALS"
|
332 |
+
|
333 |
+
/*
|
334 |
+
* THESE MACROS ARE DEPRECATED.
|
335 |
+
* Use npy_set_floatstatus_* in the npymath library.
|
336 |
+
*/
|
337 |
+
#define UFUNC_FPE_DIVIDEBYZERO NPY_FPE_DIVIDEBYZERO
|
338 |
+
#define UFUNC_FPE_OVERFLOW NPY_FPE_OVERFLOW
|
339 |
+
#define UFUNC_FPE_UNDERFLOW NPY_FPE_UNDERFLOW
|
340 |
+
#define UFUNC_FPE_INVALID NPY_FPE_INVALID
|
341 |
+
|
342 |
+
#define generate_divbyzero_error() npy_set_floatstatus_divbyzero()
|
343 |
+
#define generate_overflow_error() npy_set_floatstatus_overflow()
|
344 |
+
|
345 |
+
/* Make sure it gets defined if it isn't already */
|
346 |
+
#ifndef UFUNC_NOFPE
|
347 |
+
/* Clear the floating point exception default of Borland C++ */
|
348 |
+
#if defined(__BORLANDC__)
|
349 |
+
#define UFUNC_NOFPE _control87(MCW_EM, MCW_EM);
|
350 |
+
#else
|
351 |
+
#define UFUNC_NOFPE
|
352 |
+
#endif
|
353 |
+
#endif
|
354 |
+
|
355 |
+
#ifdef __cplusplus
|
356 |
+
}
|
357 |
+
#endif
|
358 |
+
|
359 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_UFUNCOBJECT_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/include/numpy/utils.h
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ifndef NUMPY_CORE_INCLUDE_NUMPY_UTILS_H_
|
2 |
+
#define NUMPY_CORE_INCLUDE_NUMPY_UTILS_H_
|
3 |
+
|
4 |
+
#ifndef __COMP_NPY_UNUSED
|
5 |
+
#if defined(__GNUC__)
|
6 |
+
#define __COMP_NPY_UNUSED __attribute__ ((__unused__))
|
7 |
+
#elif defined(__ICC)
|
8 |
+
#define __COMP_NPY_UNUSED __attribute__ ((__unused__))
|
9 |
+
#elif defined(__clang__)
|
10 |
+
#define __COMP_NPY_UNUSED __attribute__ ((unused))
|
11 |
+
#else
|
12 |
+
#define __COMP_NPY_UNUSED
|
13 |
+
#endif
|
14 |
+
#endif
|
15 |
+
|
16 |
+
#if defined(__GNUC__) || defined(__ICC) || defined(__clang__)
|
17 |
+
#define NPY_DECL_ALIGNED(x) __attribute__ ((aligned (x)))
|
18 |
+
#elif defined(_MSC_VER)
|
19 |
+
#define NPY_DECL_ALIGNED(x) __declspec(align(x))
|
20 |
+
#else
|
21 |
+
#define NPY_DECL_ALIGNED(x)
|
22 |
+
#endif
|
23 |
+
|
24 |
+
/* Use this to tag a variable as not used. It will remove unused variable
|
25 |
+
* warning on support platforms (see __COM_NPY_UNUSED) and mangle the variable
|
26 |
+
* to avoid accidental use */
|
27 |
+
#define NPY_UNUSED(x) __NPY_UNUSED_TAGGED ## x __COMP_NPY_UNUSED
|
28 |
+
#define NPY_EXPAND(x) x
|
29 |
+
|
30 |
+
#define NPY_STRINGIFY(x) #x
|
31 |
+
#define NPY_TOSTRING(x) NPY_STRINGIFY(x)
|
32 |
+
|
33 |
+
#define NPY_CAT__(a, b) a ## b
|
34 |
+
#define NPY_CAT_(a, b) NPY_CAT__(a, b)
|
35 |
+
#define NPY_CAT(a, b) NPY_CAT_(a, b)
|
36 |
+
|
37 |
+
#endif /* NUMPY_CORE_INCLUDE_NUMPY_UTILS_H_ */
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/_locales.cpython-310.pyc
ADDED
Binary file (2.53 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test__exceptions.cpython-310.pyc
ADDED
Binary file (3.42 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_array_coercion.cpython-310.pyc
ADDED
Binary file (28.9 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_cpu_features.cpython-310.pyc
ADDED
Binary file (13.1 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_custom_dtypes.cpython-310.pyc
ADDED
Binary file (8.59 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_defchararray.cpython-310.pyc
ADDED
Binary file (26.7 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_dlpack.cpython-310.pyc
ADDED
Binary file (5.06 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_getlimits.cpython-310.pyc
ADDED
Binary file (7.31 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_indexerrors.cpython-310.pyc
ADDED
Binary file (7.38 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_item_selection.cpython-310.pyc
ADDED
Binary file (5.48 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_limited_api.cpython-310.pyc
ADDED
Binary file (1.14 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_mem_overlap.cpython-310.pyc
ADDED
Binary file (25.8 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_mem_policy.cpython-310.pyc
ADDED
Binary file (13.3 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_memmap.cpython-310.pyc
ADDED
Binary file (7.74 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_multiarray.cpython-310.pyc
ADDED
Binary file (327 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_nditer.cpython-310.pyc
ADDED
Binary file (83.4 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_nep50_promotions.cpython-310.pyc
ADDED
Binary file (6.61 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_numeric.cpython-310.pyc
ADDED
Binary file (118 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_numerictypes.cpython-310.pyc
ADDED
Binary file (21.3 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_numpy_2_0_compat.cpython-310.pyc
ADDED
Binary file (2.22 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_overrides.cpython-310.pyc
ADDED
Binary file (31.5 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_print.cpython-310.pyc
ADDED
Binary file (5.96 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_protocols.cpython-310.pyc
ADDED
Binary file (2.42 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalar_methods.cpython-310.pyc
ADDED
Binary file (7.77 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalarbuffer.cpython-310.pyc
ADDED
Binary file (5.33 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalarinherit.cpython-310.pyc
ADDED
Binary file (3.7 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalarmath.cpython-310.pyc
ADDED
Binary file (35.5 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/numpy/core/tests/__pycache__/test_scalarprint.cpython-310.pyc
ADDED
Binary file (11.6 kB). View file
|
|