ZTWHHH commited on
Commit
91deec2
·
verified ·
1 Parent(s): 3b84a42

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/__multiarray_api.c +314 -0
  2. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/__ufunc_api.c +50 -0
  3. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/_dtype_api.h +408 -0
  4. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/_numpyconfig.h +32 -0
  5. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/arrayscalars.h +186 -0
  6. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/experimental_dtype_api.h +365 -0
  7. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/halffloat.h +70 -0
  8. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h +251 -0
  9. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h +124 -0
  10. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_3kcompat.h +595 -0
  11. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_cpu.h +129 -0
  12. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_endian.h +77 -0
  13. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_interrupt.h +56 -0
  14. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_math.h +563 -0
  15. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_no_deprecated_api.h +20 -0
  16. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_os.h +42 -0
  17. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/numpyconfig.h +138 -0
  18. evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/ufuncobject.h +359 -0
  19. janus/share/terminfo/c/c100 +0 -0
  20. janus/share/terminfo/c/c100-4p +0 -0
  21. janus/share/terminfo/c/c100-rv +0 -0
  22. janus/share/terminfo/c/c104 +0 -0
  23. janus/share/terminfo/c/c108-4p +0 -0
  24. janus/share/terminfo/c/c108-8p +0 -0
  25. janus/share/terminfo/c/c108-rv +0 -0
  26. janus/share/terminfo/c/c108-rv-4p +0 -0
  27. janus/share/terminfo/c/c108-w +0 -0
  28. janus/share/terminfo/c/c321 +0 -0
  29. janus/share/terminfo/c/cbunix +0 -0
  30. janus/share/terminfo/c/cdc721 +0 -0
  31. janus/share/terminfo/c/cdc752 +0 -0
  32. janus/share/terminfo/c/cdc756 +0 -0
  33. janus/share/terminfo/c/cg7900 +0 -0
  34. janus/share/terminfo/c/cgc2 +0 -0
  35. janus/share/terminfo/c/chromatics +0 -0
  36. janus/share/terminfo/c/cit101e-n132 +0 -0
  37. janus/share/terminfo/c/citoh-6lpi +0 -0
  38. janus/share/terminfo/c/citoh-comp +0 -0
  39. janus/share/terminfo/c/citoh-prop +0 -0
  40. janus/share/terminfo/c/citoh-ps +0 -0
  41. janus/share/terminfo/c/coherent +0 -0
  42. janus/share/terminfo/c/colorscan +0 -0
  43. janus/share/terminfo/c/concept108-8p +0 -0
  44. janus/share/terminfo/c/cons25-debian +0 -0
  45. janus/share/terminfo/c/cons25-koi8r-m +0 -0
  46. janus/share/terminfo/c/cons25-m +0 -0
  47. janus/share/terminfo/c/cons25r +0 -0
  48. janus/share/terminfo/c/cons25r-m +0 -0
  49. janus/share/terminfo/c/cons25w +0 -0
  50. janus/share/terminfo/c/cons43 +0 -0
evalkit_eagle/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
+ };
evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/__ufunc_api.c ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* These pointers will be stored in the C-object for use in other
3
+ extension modules
4
+ */
5
+
6
+ void *PyUFunc_API[] = {
7
+ (void *) &PyUFunc_Type,
8
+ (void *) PyUFunc_FromFuncAndData,
9
+ (void *) PyUFunc_RegisterLoopForType,
10
+ (void *) PyUFunc_GenericFunction,
11
+ (void *) PyUFunc_f_f_As_d_d,
12
+ (void *) PyUFunc_d_d,
13
+ (void *) PyUFunc_f_f,
14
+ (void *) PyUFunc_g_g,
15
+ (void *) PyUFunc_F_F_As_D_D,
16
+ (void *) PyUFunc_F_F,
17
+ (void *) PyUFunc_D_D,
18
+ (void *) PyUFunc_G_G,
19
+ (void *) PyUFunc_O_O,
20
+ (void *) PyUFunc_ff_f_As_dd_d,
21
+ (void *) PyUFunc_ff_f,
22
+ (void *) PyUFunc_dd_d,
23
+ (void *) PyUFunc_gg_g,
24
+ (void *) PyUFunc_FF_F_As_DD_D,
25
+ (void *) PyUFunc_DD_D,
26
+ (void *) PyUFunc_FF_F,
27
+ (void *) PyUFunc_GG_G,
28
+ (void *) PyUFunc_OO_O,
29
+ (void *) PyUFunc_O_O_method,
30
+ (void *) PyUFunc_OO_O_method,
31
+ (void *) PyUFunc_On_Om,
32
+ (void *) PyUFunc_GetPyValues,
33
+ (void *) PyUFunc_checkfperr,
34
+ (void *) PyUFunc_clearfperr,
35
+ (void *) PyUFunc_getfperr,
36
+ (void *) PyUFunc_handlefperr,
37
+ (void *) PyUFunc_ReplaceLoopBySignature,
38
+ (void *) PyUFunc_FromFuncAndDataAndSignature,
39
+ (void *) PyUFunc_SetUsesArraysAsData,
40
+ (void *) PyUFunc_e_e,
41
+ (void *) PyUFunc_e_e_As_f_f,
42
+ (void *) PyUFunc_e_e_As_d_d,
43
+ (void *) PyUFunc_ee_e,
44
+ (void *) PyUFunc_ee_e_As_ff_f,
45
+ (void *) PyUFunc_ee_e_As_dd_d,
46
+ (void *) PyUFunc_DefaultTypeResolver,
47
+ (void *) PyUFunc_ValidateCasting,
48
+ (void *) PyUFunc_RegisterLoopForDescr,
49
+ (void *) PyUFunc_FromFuncAndDataAndSignatureAndIdentity
50
+ };
evalkit_eagle/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_ */
evalkit_eagle/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
evalkit_eagle/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_ */
evalkit_eagle/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_ */
evalkit_eagle/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_ */
evalkit_eagle/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_ */
evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef NPY_DEPRECATED_INCLUDES
2
+ #error "Should never include npy_*_*_deprecated_api directly."
3
+ #endif
4
+
5
+ #ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_1_7_DEPRECATED_API_H_
6
+ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_1_7_DEPRECATED_API_H_
7
+
8
+ /* Emit a warning if the user did not specifically request the old API */
9
+ #ifndef NPY_NO_DEPRECATED_API
10
+ #if defined(_WIN32)
11
+ #define _WARN___STR2__(x) #x
12
+ #define _WARN___STR1__(x) _WARN___STR2__(x)
13
+ #define _WARN___LOC__ __FILE__ "(" _WARN___STR1__(__LINE__) ") : Warning Msg: "
14
+ #pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it with " \
15
+ "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION")
16
+ #else
17
+ #warning "Using deprecated NumPy API, disable it with " \
18
+ "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
19
+ #endif
20
+ #endif
21
+
22
+ /*
23
+ * This header exists to collect all dangerous/deprecated NumPy API
24
+ * as of NumPy 1.7.
25
+ *
26
+ * This is an attempt to remove bad API, the proliferation of macros,
27
+ * and namespace pollution currently produced by the NumPy headers.
28
+ */
29
+
30
+ /* These array flags are deprecated as of NumPy 1.7 */
31
+ #define NPY_CONTIGUOUS NPY_ARRAY_C_CONTIGUOUS
32
+ #define NPY_FORTRAN NPY_ARRAY_F_CONTIGUOUS
33
+
34
+ /*
35
+ * The consistent NPY_ARRAY_* names which don't pollute the NPY_*
36
+ * namespace were added in NumPy 1.7.
37
+ *
38
+ * These versions of the carray flags are deprecated, but
39
+ * probably should only be removed after two releases instead of one.
40
+ */
41
+ #define NPY_C_CONTIGUOUS NPY_ARRAY_C_CONTIGUOUS
42
+ #define NPY_F_CONTIGUOUS NPY_ARRAY_F_CONTIGUOUS
43
+ #define NPY_OWNDATA NPY_ARRAY_OWNDATA
44
+ #define NPY_FORCECAST NPY_ARRAY_FORCECAST
45
+ #define NPY_ENSURECOPY NPY_ARRAY_ENSURECOPY
46
+ #define NPY_ENSUREARRAY NPY_ARRAY_ENSUREARRAY
47
+ #define NPY_ELEMENTSTRIDES NPY_ARRAY_ELEMENTSTRIDES
48
+ #define NPY_ALIGNED NPY_ARRAY_ALIGNED
49
+ #define NPY_NOTSWAPPED NPY_ARRAY_NOTSWAPPED
50
+ #define NPY_WRITEABLE NPY_ARRAY_WRITEABLE
51
+ #define NPY_BEHAVED NPY_ARRAY_BEHAVED
52
+ #define NPY_BEHAVED_NS NPY_ARRAY_BEHAVED_NS
53
+ #define NPY_CARRAY NPY_ARRAY_CARRAY
54
+ #define NPY_CARRAY_RO NPY_ARRAY_CARRAY_RO
55
+ #define NPY_FARRAY NPY_ARRAY_FARRAY
56
+ #define NPY_FARRAY_RO NPY_ARRAY_FARRAY_RO
57
+ #define NPY_DEFAULT NPY_ARRAY_DEFAULT
58
+ #define NPY_IN_ARRAY NPY_ARRAY_IN_ARRAY
59
+ #define NPY_OUT_ARRAY NPY_ARRAY_OUT_ARRAY
60
+ #define NPY_INOUT_ARRAY NPY_ARRAY_INOUT_ARRAY
61
+ #define NPY_IN_FARRAY NPY_ARRAY_IN_FARRAY
62
+ #define NPY_OUT_FARRAY NPY_ARRAY_OUT_FARRAY
63
+ #define NPY_INOUT_FARRAY NPY_ARRAY_INOUT_FARRAY
64
+ #define NPY_UPDATE_ALL NPY_ARRAY_UPDATE_ALL
65
+
66
+ /* This way of accessing the default type is deprecated as of NumPy 1.7 */
67
+ #define PyArray_DEFAULT NPY_DEFAULT_TYPE
68
+
69
+ /* These DATETIME bits aren't used internally */
70
+ #define PyDataType_GetDatetimeMetaData(descr) \
71
+ ((descr->metadata == NULL) ? NULL : \
72
+ ((PyArray_DatetimeMetaData *)(PyCapsule_GetPointer( \
73
+ PyDict_GetItemString( \
74
+ descr->metadata, NPY_METADATA_DTSTR), NULL))))
75
+
76
+ /*
77
+ * Deprecated as of NumPy 1.7, this kind of shortcut doesn't
78
+ * belong in the public API.
79
+ */
80
+ #define NPY_AO PyArrayObject
81
+
82
+ /*
83
+ * Deprecated as of NumPy 1.7, an all-lowercase macro doesn't
84
+ * belong in the public API.
85
+ */
86
+ #define fortran fortran_
87
+
88
+ /*
89
+ * Deprecated as of NumPy 1.7, as it is a namespace-polluting
90
+ * macro.
91
+ */
92
+ #define FORTRAN_IF PyArray_FORTRAN_IF
93
+
94
+ /* Deprecated as of NumPy 1.7, datetime64 uses c_metadata instead */
95
+ #define NPY_METADATA_DTSTR "__timeunit__"
96
+
97
+ /*
98
+ * Deprecated as of NumPy 1.7.
99
+ * The reasoning:
100
+ * - These are for datetime, but there's no datetime "namespace".
101
+ * - They just turn NPY_STR_<x> into "<x>", which is just
102
+ * making something simple be indirected.
103
+ */
104
+ #define NPY_STR_Y "Y"
105
+ #define NPY_STR_M "M"
106
+ #define NPY_STR_W "W"
107
+ #define NPY_STR_D "D"
108
+ #define NPY_STR_h "h"
109
+ #define NPY_STR_m "m"
110
+ #define NPY_STR_s "s"
111
+ #define NPY_STR_ms "ms"
112
+ #define NPY_STR_us "us"
113
+ #define NPY_STR_ns "ns"
114
+ #define NPY_STR_ps "ps"
115
+ #define NPY_STR_fs "fs"
116
+ #define NPY_STR_as "as"
117
+
118
+ /*
119
+ * The macros in old_defines.h are Deprecated as of NumPy 1.7 and will be
120
+ * removed in the next major release.
121
+ */
122
+ #include "old_defines.h"
123
+
124
+ #endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_1_7_DEPRECATED_API_H_ */
evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_3kcompat.h ADDED
@@ -0,0 +1,595 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This is a convenience header file providing compatibility utilities
3
+ * for supporting different minor versions of Python 3.
4
+ * It was originally used to support the transition from Python 2,
5
+ * hence the "3k" naming.
6
+ *
7
+ * If you want to use this for your own projects, it's recommended to make a
8
+ * copy of it. Although the stuff below is unlikely to change, we don't provide
9
+ * strong backwards compatibility guarantees at the moment.
10
+ */
11
+
12
+ #ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_3KCOMPAT_H_
13
+ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_3KCOMPAT_H_
14
+
15
+ #include <Python.h>
16
+ #include <stdio.h>
17
+
18
+ #ifndef NPY_PY3K
19
+ #define NPY_PY3K 1
20
+ #endif
21
+
22
+ #include "numpy/npy_common.h"
23
+ #include "numpy/ndarrayobject.h"
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ /*
30
+ * PyInt -> PyLong
31
+ */
32
+
33
+
34
+ /*
35
+ * This is a renamed copy of the Python non-limited API function _PyLong_AsInt. It is
36
+ * included here because it is missing from the PyPy API. It completes the PyLong_As*
37
+ * group of functions and can be useful in replacing PyInt_Check.
38
+ */
39
+ static inline int
40
+ Npy__PyLong_AsInt(PyObject *obj)
41
+ {
42
+ int overflow;
43
+ long result = PyLong_AsLongAndOverflow(obj, &overflow);
44
+
45
+ /* INT_MAX and INT_MIN are defined in Python.h */
46
+ if (overflow || result > INT_MAX || result < INT_MIN) {
47
+ /* XXX: could be cute and give a different
48
+ message for overflow == -1 */
49
+ PyErr_SetString(PyExc_OverflowError,
50
+ "Python int too large to convert to C int");
51
+ return -1;
52
+ }
53
+ return (int)result;
54
+ }
55
+
56
+
57
+ #if defined(NPY_PY3K)
58
+ /* Return True only if the long fits in a C long */
59
+ static inline int PyInt_Check(PyObject *op) {
60
+ int overflow = 0;
61
+ if (!PyLong_Check(op)) {
62
+ return 0;
63
+ }
64
+ PyLong_AsLongAndOverflow(op, &overflow);
65
+ return (overflow == 0);
66
+ }
67
+
68
+
69
+ #define PyInt_FromLong PyLong_FromLong
70
+ #define PyInt_AsLong PyLong_AsLong
71
+ #define PyInt_AS_LONG PyLong_AsLong
72
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
73
+ #define PyNumber_Int PyNumber_Long
74
+
75
+ /* NOTE:
76
+ *
77
+ * Since the PyLong type is very different from the fixed-range PyInt,
78
+ * we don't define PyInt_Type -> PyLong_Type.
79
+ */
80
+ #endif /* NPY_PY3K */
81
+
82
+ /* Py3 changes PySlice_GetIndicesEx' first argument's type to PyObject* */
83
+ #ifdef NPY_PY3K
84
+ # define NpySlice_GetIndicesEx PySlice_GetIndicesEx
85
+ #else
86
+ # define NpySlice_GetIndicesEx(op, nop, start, end, step, slicelength) \
87
+ PySlice_GetIndicesEx((PySliceObject *)op, nop, start, end, step, slicelength)
88
+ #endif
89
+
90
+ #if PY_VERSION_HEX < 0x030900a4
91
+ /* Introduced in https://github.com/python/cpython/commit/d2ec81a8c99796b51fb8c49b77a7fe369863226f */
92
+ #define Py_SET_TYPE(obj, type) ((Py_TYPE(obj) = (type)), (void)0)
93
+ /* Introduced in https://github.com/python/cpython/commit/b10dc3e7a11fcdb97e285882eba6da92594f90f9 */
94
+ #define Py_SET_SIZE(obj, size) ((Py_SIZE(obj) = (size)), (void)0)
95
+ /* Introduced in https://github.com/python/cpython/commit/c86a11221df7e37da389f9c6ce6e47ea22dc44ff */
96
+ #define Py_SET_REFCNT(obj, refcnt) ((Py_REFCNT(obj) = (refcnt)), (void)0)
97
+ #endif
98
+
99
+
100
+ #define Npy_EnterRecursiveCall(x) Py_EnterRecursiveCall(x)
101
+
102
+ /*
103
+ * PyString -> PyBytes
104
+ */
105
+
106
+ #if defined(NPY_PY3K)
107
+
108
+ #define PyString_Type PyBytes_Type
109
+ #define PyString_Check PyBytes_Check
110
+ #define PyStringObject PyBytesObject
111
+ #define PyString_FromString PyBytes_FromString
112
+ #define PyString_FromStringAndSize PyBytes_FromStringAndSize
113
+ #define PyString_AS_STRING PyBytes_AS_STRING
114
+ #define PyString_AsStringAndSize PyBytes_AsStringAndSize
115
+ #define PyString_FromFormat PyBytes_FromFormat
116
+ #define PyString_Concat PyBytes_Concat
117
+ #define PyString_ConcatAndDel PyBytes_ConcatAndDel
118
+ #define PyString_AsString PyBytes_AsString
119
+ #define PyString_GET_SIZE PyBytes_GET_SIZE
120
+ #define PyString_Size PyBytes_Size
121
+
122
+ #define PyUString_Type PyUnicode_Type
123
+ #define PyUString_Check PyUnicode_Check
124
+ #define PyUStringObject PyUnicodeObject
125
+ #define PyUString_FromString PyUnicode_FromString
126
+ #define PyUString_FromStringAndSize PyUnicode_FromStringAndSize
127
+ #define PyUString_FromFormat PyUnicode_FromFormat
128
+ #define PyUString_Concat PyUnicode_Concat2
129
+ #define PyUString_ConcatAndDel PyUnicode_ConcatAndDel
130
+ #define PyUString_GET_SIZE PyUnicode_GET_SIZE
131
+ #define PyUString_Size PyUnicode_Size
132
+ #define PyUString_InternFromString PyUnicode_InternFromString
133
+ #define PyUString_Format PyUnicode_Format
134
+
135
+ #define PyBaseString_Check(obj) (PyUnicode_Check(obj))
136
+
137
+ #else
138
+
139
+ #define PyBytes_Type PyString_Type
140
+ #define PyBytes_Check PyString_Check
141
+ #define PyBytesObject PyStringObject
142
+ #define PyBytes_FromString PyString_FromString
143
+ #define PyBytes_FromStringAndSize PyString_FromStringAndSize
144
+ #define PyBytes_AS_STRING PyString_AS_STRING
145
+ #define PyBytes_AsStringAndSize PyString_AsStringAndSize
146
+ #define PyBytes_FromFormat PyString_FromFormat
147
+ #define PyBytes_Concat PyString_Concat
148
+ #define PyBytes_ConcatAndDel PyString_ConcatAndDel
149
+ #define PyBytes_AsString PyString_AsString
150
+ #define PyBytes_GET_SIZE PyString_GET_SIZE
151
+ #define PyBytes_Size PyString_Size
152
+
153
+ #define PyUString_Type PyString_Type
154
+ #define PyUString_Check PyString_Check
155
+ #define PyUStringObject PyStringObject
156
+ #define PyUString_FromString PyString_FromString
157
+ #define PyUString_FromStringAndSize PyString_FromStringAndSize
158
+ #define PyUString_FromFormat PyString_FromFormat
159
+ #define PyUString_Concat PyString_Concat
160
+ #define PyUString_ConcatAndDel PyString_ConcatAndDel
161
+ #define PyUString_GET_SIZE PyString_GET_SIZE
162
+ #define PyUString_Size PyString_Size
163
+ #define PyUString_InternFromString PyString_InternFromString
164
+ #define PyUString_Format PyString_Format
165
+
166
+ #define PyBaseString_Check(obj) (PyBytes_Check(obj) || PyUnicode_Check(obj))
167
+
168
+ #endif /* NPY_PY3K */
169
+
170
+ /*
171
+ * Macros to protect CRT calls against instant termination when passed an
172
+ * invalid parameter (https://bugs.python.org/issue23524).
173
+ */
174
+ #if defined _MSC_VER && _MSC_VER >= 1900
175
+
176
+ #include <stdlib.h>
177
+
178
+ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler;
179
+ #define NPY_BEGIN_SUPPRESS_IPH { _invalid_parameter_handler _Py_old_handler = \
180
+ _set_thread_local_invalid_parameter_handler(_Py_silent_invalid_parameter_handler);
181
+ #define NPY_END_SUPPRESS_IPH _set_thread_local_invalid_parameter_handler(_Py_old_handler); }
182
+
183
+ #else
184
+
185
+ #define NPY_BEGIN_SUPPRESS_IPH
186
+ #define NPY_END_SUPPRESS_IPH
187
+
188
+ #endif /* _MSC_VER >= 1900 */
189
+
190
+
191
+ static inline void
192
+ PyUnicode_ConcatAndDel(PyObject **left, PyObject *right)
193
+ {
194
+ Py_SETREF(*left, PyUnicode_Concat(*left, right));
195
+ Py_DECREF(right);
196
+ }
197
+
198
+ static inline void
199
+ PyUnicode_Concat2(PyObject **left, PyObject *right)
200
+ {
201
+ Py_SETREF(*left, PyUnicode_Concat(*left, right));
202
+ }
203
+
204
+ /*
205
+ * PyFile_* compatibility
206
+ */
207
+
208
+ /*
209
+ * Get a FILE* handle to the file represented by the Python object
210
+ */
211
+ static inline FILE*
212
+ npy_PyFile_Dup2(PyObject *file, char *mode, npy_off_t *orig_pos)
213
+ {
214
+ int fd, fd2, unbuf;
215
+ Py_ssize_t fd2_tmp;
216
+ PyObject *ret, *os, *io, *io_raw;
217
+ npy_off_t pos;
218
+ FILE *handle;
219
+
220
+ /* For Python 2 PyFileObject, use PyFile_AsFile */
221
+ #if !defined(NPY_PY3K)
222
+ if (PyFile_Check(file)) {
223
+ return PyFile_AsFile(file);
224
+ }
225
+ #endif
226
+
227
+ /* Flush first to ensure things end up in the file in the correct order */
228
+ ret = PyObject_CallMethod(file, "flush", "");
229
+ if (ret == NULL) {
230
+ return NULL;
231
+ }
232
+ Py_DECREF(ret);
233
+ fd = PyObject_AsFileDescriptor(file);
234
+ if (fd == -1) {
235
+ return NULL;
236
+ }
237
+
238
+ /*
239
+ * The handle needs to be dup'd because we have to call fclose
240
+ * at the end
241
+ */
242
+ os = PyImport_ImportModule("os");
243
+ if (os == NULL) {
244
+ return NULL;
245
+ }
246
+ ret = PyObject_CallMethod(os, "dup", "i", fd);
247
+ Py_DECREF(os);
248
+ if (ret == NULL) {
249
+ return NULL;
250
+ }
251
+ fd2_tmp = PyNumber_AsSsize_t(ret, PyExc_IOError);
252
+ Py_DECREF(ret);
253
+ if (fd2_tmp == -1 && PyErr_Occurred()) {
254
+ return NULL;
255
+ }
256
+ if (fd2_tmp < INT_MIN || fd2_tmp > INT_MAX) {
257
+ PyErr_SetString(PyExc_IOError,
258
+ "Getting an 'int' from os.dup() failed");
259
+ return NULL;
260
+ }
261
+ fd2 = (int)fd2_tmp;
262
+
263
+ /* Convert to FILE* handle */
264
+ #ifdef _WIN32
265
+ NPY_BEGIN_SUPPRESS_IPH
266
+ handle = _fdopen(fd2, mode);
267
+ NPY_END_SUPPRESS_IPH
268
+ #else
269
+ handle = fdopen(fd2, mode);
270
+ #endif
271
+ if (handle == NULL) {
272
+ PyErr_SetString(PyExc_IOError,
273
+ "Getting a FILE* from a Python file object via "
274
+ "_fdopen failed. If you built NumPy, you probably "
275
+ "linked with the wrong debug/release runtime");
276
+ return NULL;
277
+ }
278
+
279
+ /* Record the original raw file handle position */
280
+ *orig_pos = npy_ftell(handle);
281
+ if (*orig_pos == -1) {
282
+ /* The io module is needed to determine if buffering is used */
283
+ io = PyImport_ImportModule("io");
284
+ if (io == NULL) {
285
+ fclose(handle);
286
+ return NULL;
287
+ }
288
+ /* File object instances of RawIOBase are unbuffered */
289
+ io_raw = PyObject_GetAttrString(io, "RawIOBase");
290
+ Py_DECREF(io);
291
+ if (io_raw == NULL) {
292
+ fclose(handle);
293
+ return NULL;
294
+ }
295
+ unbuf = PyObject_IsInstance(file, io_raw);
296
+ Py_DECREF(io_raw);
297
+ if (unbuf == 1) {
298
+ /* Succeed if the IO is unbuffered */
299
+ return handle;
300
+ }
301
+ else {
302
+ PyErr_SetString(PyExc_IOError, "obtaining file position failed");
303
+ fclose(handle);
304
+ return NULL;
305
+ }
306
+ }
307
+
308
+ /* Seek raw handle to the Python-side position */
309
+ ret = PyObject_CallMethod(file, "tell", "");
310
+ if (ret == NULL) {
311
+ fclose(handle);
312
+ return NULL;
313
+ }
314
+ pos = PyLong_AsLongLong(ret);
315
+ Py_DECREF(ret);
316
+ if (PyErr_Occurred()) {
317
+ fclose(handle);
318
+ return NULL;
319
+ }
320
+ if (npy_fseek(handle, pos, SEEK_SET) == -1) {
321
+ PyErr_SetString(PyExc_IOError, "seeking file failed");
322
+ fclose(handle);
323
+ return NULL;
324
+ }
325
+ return handle;
326
+ }
327
+
328
+ /*
329
+ * Close the dup-ed file handle, and seek the Python one to the current position
330
+ */
331
+ static inline int
332
+ npy_PyFile_DupClose2(PyObject *file, FILE* handle, npy_off_t orig_pos)
333
+ {
334
+ int fd, unbuf;
335
+ PyObject *ret, *io, *io_raw;
336
+ npy_off_t position;
337
+
338
+ /* For Python 2 PyFileObject, do nothing */
339
+ #if !defined(NPY_PY3K)
340
+ if (PyFile_Check(file)) {
341
+ return 0;
342
+ }
343
+ #endif
344
+
345
+ position = npy_ftell(handle);
346
+
347
+ /* Close the FILE* handle */
348
+ fclose(handle);
349
+
350
+ /*
351
+ * Restore original file handle position, in order to not confuse
352
+ * Python-side data structures
353
+ */
354
+ fd = PyObject_AsFileDescriptor(file);
355
+ if (fd == -1) {
356
+ return -1;
357
+ }
358
+
359
+ if (npy_lseek(fd, orig_pos, SEEK_SET) == -1) {
360
+
361
+ /* The io module is needed to determine if buffering is used */
362
+ io = PyImport_ImportModule("io");
363
+ if (io == NULL) {
364
+ return -1;
365
+ }
366
+ /* File object instances of RawIOBase are unbuffered */
367
+ io_raw = PyObject_GetAttrString(io, "RawIOBase");
368
+ Py_DECREF(io);
369
+ if (io_raw == NULL) {
370
+ return -1;
371
+ }
372
+ unbuf = PyObject_IsInstance(file, io_raw);
373
+ Py_DECREF(io_raw);
374
+ if (unbuf == 1) {
375
+ /* Succeed if the IO is unbuffered */
376
+ return 0;
377
+ }
378
+ else {
379
+ PyErr_SetString(PyExc_IOError, "seeking file failed");
380
+ return -1;
381
+ }
382
+ }
383
+
384
+ if (position == -1) {
385
+ PyErr_SetString(PyExc_IOError, "obtaining file position failed");
386
+ return -1;
387
+ }
388
+
389
+ /* Seek Python-side handle to the FILE* handle position */
390
+ ret = PyObject_CallMethod(file, "seek", NPY_OFF_T_PYFMT "i", position, 0);
391
+ if (ret == NULL) {
392
+ return -1;
393
+ }
394
+ Py_DECREF(ret);
395
+ return 0;
396
+ }
397
+
398
+ static inline int
399
+ npy_PyFile_Check(PyObject *file)
400
+ {
401
+ int fd;
402
+ /* For Python 2, check if it is a PyFileObject */
403
+ #if !defined(NPY_PY3K)
404
+ if (PyFile_Check(file)) {
405
+ return 1;
406
+ }
407
+ #endif
408
+ fd = PyObject_AsFileDescriptor(file);
409
+ if (fd == -1) {
410
+ PyErr_Clear();
411
+ return 0;
412
+ }
413
+ return 1;
414
+ }
415
+
416
+ static inline PyObject*
417
+ npy_PyFile_OpenFile(PyObject *filename, const char *mode)
418
+ {
419
+ PyObject *open;
420
+ open = PyDict_GetItemString(PyEval_GetBuiltins(), "open");
421
+ if (open == NULL) {
422
+ return NULL;
423
+ }
424
+ return PyObject_CallFunction(open, "Os", filename, mode);
425
+ }
426
+
427
+ static inline int
428
+ npy_PyFile_CloseFile(PyObject *file)
429
+ {
430
+ PyObject *ret;
431
+
432
+ ret = PyObject_CallMethod(file, "close", NULL);
433
+ if (ret == NULL) {
434
+ return -1;
435
+ }
436
+ Py_DECREF(ret);
437
+ return 0;
438
+ }
439
+
440
+
441
+ /* This is a copy of _PyErr_ChainExceptions
442
+ */
443
+ static inline void
444
+ npy_PyErr_ChainExceptions(PyObject *exc, PyObject *val, PyObject *tb)
445
+ {
446
+ if (exc == NULL)
447
+ return;
448
+
449
+ if (PyErr_Occurred()) {
450
+ /* only py3 supports this anyway */
451
+ #ifdef NPY_PY3K
452
+ PyObject *exc2, *val2, *tb2;
453
+ PyErr_Fetch(&exc2, &val2, &tb2);
454
+ PyErr_NormalizeException(&exc, &val, &tb);
455
+ if (tb != NULL) {
456
+ PyException_SetTraceback(val, tb);
457
+ Py_DECREF(tb);
458
+ }
459
+ Py_DECREF(exc);
460
+ PyErr_NormalizeException(&exc2, &val2, &tb2);
461
+ PyException_SetContext(val2, val);
462
+ PyErr_Restore(exc2, val2, tb2);
463
+ #endif
464
+ }
465
+ else {
466
+ PyErr_Restore(exc, val, tb);
467
+ }
468
+ }
469
+
470
+
471
+ /* This is a copy of _PyErr_ChainExceptions, with:
472
+ * - a minimal implementation for python 2
473
+ * - __cause__ used instead of __context__
474
+ */
475
+ static inline void
476
+ npy_PyErr_ChainExceptionsCause(PyObject *exc, PyObject *val, PyObject *tb)
477
+ {
478
+ if (exc == NULL)
479
+ return;
480
+
481
+ if (PyErr_Occurred()) {
482
+ /* only py3 supports this anyway */
483
+ #ifdef NPY_PY3K
484
+ PyObject *exc2, *val2, *tb2;
485
+ PyErr_Fetch(&exc2, &val2, &tb2);
486
+ PyErr_NormalizeException(&exc, &val, &tb);
487
+ if (tb != NULL) {
488
+ PyException_SetTraceback(val, tb);
489
+ Py_DECREF(tb);
490
+ }
491
+ Py_DECREF(exc);
492
+ PyErr_NormalizeException(&exc2, &val2, &tb2);
493
+ PyException_SetCause(val2, val);
494
+ PyErr_Restore(exc2, val2, tb2);
495
+ #endif
496
+ }
497
+ else {
498
+ PyErr_Restore(exc, val, tb);
499
+ }
500
+ }
501
+
502
+ /*
503
+ * PyObject_Cmp
504
+ */
505
+ #if defined(NPY_PY3K)
506
+ static inline int
507
+ PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp)
508
+ {
509
+ int v;
510
+ v = PyObject_RichCompareBool(i1, i2, Py_LT);
511
+ if (v == 1) {
512
+ *cmp = -1;
513
+ return 1;
514
+ }
515
+ else if (v == -1) {
516
+ return -1;
517
+ }
518
+
519
+ v = PyObject_RichCompareBool(i1, i2, Py_GT);
520
+ if (v == 1) {
521
+ *cmp = 1;
522
+ return 1;
523
+ }
524
+ else if (v == -1) {
525
+ return -1;
526
+ }
527
+
528
+ v = PyObject_RichCompareBool(i1, i2, Py_EQ);
529
+ if (v == 1) {
530
+ *cmp = 0;
531
+ return 1;
532
+ }
533
+ else {
534
+ *cmp = 0;
535
+ return -1;
536
+ }
537
+ }
538
+ #endif
539
+
540
+ /*
541
+ * PyCObject functions adapted to PyCapsules.
542
+ *
543
+ * The main job here is to get rid of the improved error handling
544
+ * of PyCapsules. It's a shame...
545
+ */
546
+ static inline PyObject *
547
+ NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *))
548
+ {
549
+ PyObject *ret = PyCapsule_New(ptr, NULL, dtor);
550
+ if (ret == NULL) {
551
+ PyErr_Clear();
552
+ }
553
+ return ret;
554
+ }
555
+
556
+ static inline PyObject *
557
+ NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *))
558
+ {
559
+ PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor);
560
+ if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) {
561
+ PyErr_Clear();
562
+ Py_DECREF(ret);
563
+ ret = NULL;
564
+ }
565
+ return ret;
566
+ }
567
+
568
+ static inline void *
569
+ NpyCapsule_AsVoidPtr(PyObject *obj)
570
+ {
571
+ void *ret = PyCapsule_GetPointer(obj, NULL);
572
+ if (ret == NULL) {
573
+ PyErr_Clear();
574
+ }
575
+ return ret;
576
+ }
577
+
578
+ static inline void *
579
+ NpyCapsule_GetDesc(PyObject *obj)
580
+ {
581
+ return PyCapsule_GetContext(obj);
582
+ }
583
+
584
+ static inline int
585
+ NpyCapsule_Check(PyObject *ptr)
586
+ {
587
+ return PyCapsule_CheckExact(ptr);
588
+ }
589
+
590
+ #ifdef __cplusplus
591
+ }
592
+ #endif
593
+
594
+
595
+ #endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_3KCOMPAT_H_ */
evalkit_eagle/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_ */
evalkit_eagle/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_ */
evalkit_eagle/lib/python3.10/site-packages/numpy/core/include/numpy/npy_interrupt.h ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This API is only provided because it is part of publicly exported
3
+ * headers. Its use is considered DEPRECATED, and it will be removed
4
+ * eventually.
5
+ * (This includes the _PyArray_SigintHandler and _PyArray_GetSigintBuf
6
+ * functions which are however, public API, and not headers.)
7
+ *
8
+ * Instead of using these non-threadsafe macros consider periodically
9
+ * querying `PyErr_CheckSignals()` or `PyOS_InterruptOccurred()` will work.
10
+ * Both of these require holding the GIL, although cpython could add a
11
+ * version of `PyOS_InterruptOccurred()` which does not. Such a version
12
+ * actually exists as private API in Python 3.10, and backported to 3.9 and 3.8,
13
+ * see also https://bugs.python.org/issue41037 and
14
+ * https://github.com/python/cpython/pull/20599).
15
+ */
16
+
17
+ #ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_INTERRUPT_H_
18
+ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_INTERRUPT_H_
19
+
20
+ #ifndef NPY_NO_SIGNAL
21
+
22
+ #include <setjmp.h>
23
+ #include <signal.h>
24
+
25
+ #ifndef sigsetjmp
26
+
27
+ #define NPY_SIGSETJMP(arg1, arg2) setjmp(arg1)
28
+ #define NPY_SIGLONGJMP(arg1, arg2) longjmp(arg1, arg2)
29
+ #define NPY_SIGJMP_BUF jmp_buf
30
+
31
+ #else
32
+
33
+ #define NPY_SIGSETJMP(arg1, arg2) sigsetjmp(arg1, arg2)
34
+ #define NPY_SIGLONGJMP(arg1, arg2) siglongjmp(arg1, arg2)
35
+ #define NPY_SIGJMP_BUF sigjmp_buf
36
+
37
+ #endif
38
+
39
+ # define NPY_SIGINT_ON { \
40
+ PyOS_sighandler_t _npy_sig_save; \
41
+ _npy_sig_save = PyOS_setsig(SIGINT, _PyArray_SigintHandler); \
42
+ if (NPY_SIGSETJMP(*((NPY_SIGJMP_BUF *)_PyArray_GetSigintBuf()), \
43
+ 1) == 0) { \
44
+
45
+ # define NPY_SIGINT_OFF } \
46
+ PyOS_setsig(SIGINT, _npy_sig_save); \
47
+ }
48
+
49
+ #else /* NPY_NO_SIGNAL */
50
+
51
+ #define NPY_SIGINT_ON
52
+ #define NPY_SIGINT_OFF
53
+
54
+ #endif /* HAVE_SIGSETJMP */
55
+
56
+ #endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_INTERRUPT_H_ */
evalkit_eagle/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_ */
evalkit_eagle/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 */
evalkit_eagle/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_ */
evalkit_eagle/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_ */
evalkit_eagle/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_ */
janus/share/terminfo/c/c100 ADDED
Binary file (832 Bytes). View file
 
janus/share/terminfo/c/c100-4p ADDED
Binary file (832 Bytes). View file
 
janus/share/terminfo/c/c100-rv ADDED
Binary file (838 Bytes). View file
 
janus/share/terminfo/c/c104 ADDED
Binary file (832 Bytes). View file
 
janus/share/terminfo/c/c108-4p ADDED
Binary file (933 Bytes). View file
 
janus/share/terminfo/c/c108-8p ADDED
Binary file (950 Bytes). View file
 
janus/share/terminfo/c/c108-rv ADDED
Binary file (940 Bytes). View file
 
janus/share/terminfo/c/c108-rv-4p ADDED
Binary file (950 Bytes). View file
 
janus/share/terminfo/c/c108-w ADDED
Binary file (970 Bytes). View file
 
janus/share/terminfo/c/c321 ADDED
Binary file (551 Bytes). View file
 
janus/share/terminfo/c/cbunix ADDED
Binary file (431 Bytes). View file
 
janus/share/terminfo/c/cdc721 ADDED
Binary file (294 Bytes). View file
 
janus/share/terminfo/c/cdc752 ADDED
Binary file (395 Bytes). View file
 
janus/share/terminfo/c/cdc756 ADDED
Binary file (570 Bytes). View file
 
janus/share/terminfo/c/cg7900 ADDED
Binary file (523 Bytes). View file
 
janus/share/terminfo/c/cgc2 ADDED
Binary file (338 Bytes). View file
 
janus/share/terminfo/c/chromatics ADDED
Binary file (523 Bytes). View file
 
janus/share/terminfo/c/cit101e-n132 ADDED
Binary file (869 Bytes). View file
 
janus/share/terminfo/c/citoh-6lpi ADDED
Binary file (444 Bytes). View file
 
janus/share/terminfo/c/citoh-comp ADDED
Binary file (462 Bytes). View file
 
janus/share/terminfo/c/citoh-prop ADDED
Binary file (462 Bytes). View file
 
janus/share/terminfo/c/citoh-ps ADDED
Binary file (462 Bytes). View file
 
janus/share/terminfo/c/coherent ADDED
Binary file (456 Bytes). View file
 
janus/share/terminfo/c/colorscan ADDED
Binary file (440 Bytes). View file
 
janus/share/terminfo/c/concept108-8p ADDED
Binary file (950 Bytes). View file
 
janus/share/terminfo/c/cons25-debian ADDED
Binary file (1.52 kB). View file
 
janus/share/terminfo/c/cons25-koi8r-m ADDED
Binary file (1.52 kB). View file
 
janus/share/terminfo/c/cons25-m ADDED
Binary file (1.48 kB). View file
 
janus/share/terminfo/c/cons25r ADDED
Binary file (1.51 kB). View file
 
janus/share/terminfo/c/cons25r-m ADDED
Binary file (1.52 kB). View file
 
janus/share/terminfo/c/cons25w ADDED
Binary file (1.46 kB). View file
 
janus/share/terminfo/c/cons43 ADDED
Binary file (1.5 kB). View file