numexpr 2.14.2__cp313-cp313-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- numexpr/__init__.py +66 -0
- numexpr/bespoke_functions.hpp +339 -0
- numexpr/complex_functions.hpp +498 -0
- numexpr/cpuinfo.py +861 -0
- numexpr/expressions.py +546 -0
- numexpr/functions.hpp +235 -0
- numexpr/interp_body.cpp +602 -0
- numexpr/interpreter.cp313-win_arm64.pyd +0 -0
- numexpr/interpreter.cpp +1585 -0
- numexpr/interpreter.hpp +137 -0
- numexpr/missing_posix_functions.hpp +102 -0
- numexpr/module.cpp +552 -0
- numexpr/module.hpp +60 -0
- numexpr/msvc_function_stubs.hpp +231 -0
- numexpr/necompiler.py +1074 -0
- numexpr/numexpr_config.hpp +71 -0
- numexpr/numexpr_object.cpp +408 -0
- numexpr/numexpr_object.hpp +34 -0
- numexpr/opcodes.hpp +214 -0
- numexpr/str-two-way.hpp +435 -0
- numexpr/tests/__init__.py +14 -0
- numexpr/tests/conftest.py +21 -0
- numexpr/tests/test_numexpr.py +1603 -0
- numexpr/utils.py +311 -0
- numexpr/version.py +5 -0
- numexpr/win32/pthread.c +218 -0
- numexpr/win32/pthread.h +119 -0
- numexpr/win32/stdint.h +235 -0
- numexpr-2.14.2.dist-info/METADATA +233 -0
- numexpr-2.14.2.dist-info/RECORD +34 -0
- numexpr-2.14.2.dist-info/WHEEL +5 -0
- numexpr-2.14.2.dist-info/licenses/LICENSE.txt +21 -0
- numexpr-2.14.2.dist-info/licenses/LICENSES/cpuinfo.txt +31 -0
- numexpr-2.14.2.dist-info/top_level.txt +1 -0
numexpr/functions.hpp
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// -*- c-mode -*-
|
|
2
|
+
/*********************************************************************
|
|
3
|
+
Numexpr - Fast numerical array expression evaluator for NumPy.
|
|
4
|
+
|
|
5
|
+
License: MIT
|
|
6
|
+
Author: See AUTHORS.txt
|
|
7
|
+
|
|
8
|
+
See LICENSE.txt for details about copyright and rights to use.
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
|
|
11
|
+
/* These #if blocks make it easier to query this file, without having
|
|
12
|
+
to define every row function before #including it. */
|
|
13
|
+
#ifndef FUNC_FF
|
|
14
|
+
#define ELIDE_FUNC_FF
|
|
15
|
+
#define FUNC_FF(...)
|
|
16
|
+
#endif
|
|
17
|
+
FUNC_FF(FUNC_SQRT_FF, "sqrt_ff", sqrtf, sqrtf2, vsSqrt)
|
|
18
|
+
FUNC_FF(FUNC_SIN_FF, "sin_ff", sinf, sinf2, vsSin)
|
|
19
|
+
FUNC_FF(FUNC_COS_FF, "cos_ff", cosf, cosf2, vsCos)
|
|
20
|
+
FUNC_FF(FUNC_TAN_FF, "tan_ff", tanf, tanf2, vsTan)
|
|
21
|
+
FUNC_FF(FUNC_ARCSIN_FF, "arcsin_ff", asinf, asinf2, vsAsin)
|
|
22
|
+
FUNC_FF(FUNC_ARCCOS_FF, "arccos_ff", acosf, acosf2, vsAcos)
|
|
23
|
+
FUNC_FF(FUNC_ARCTAN_FF, "arctan_ff", atanf, atanf2, vsAtan)
|
|
24
|
+
FUNC_FF(FUNC_SINH_FF, "sinh_ff", sinhf, sinhf2, vsSinh)
|
|
25
|
+
FUNC_FF(FUNC_COSH_FF, "cosh_ff", coshf, coshf2, vsCosh)
|
|
26
|
+
FUNC_FF(FUNC_TANH_FF, "tanh_ff", tanhf, tanhf2, vsTanh)
|
|
27
|
+
FUNC_FF(FUNC_ARCSINH_FF, "arcsinh_ff", asinhf, asinhf2, vsAsinh)
|
|
28
|
+
FUNC_FF(FUNC_ARCCOSH_FF, "arccosh_ff", acoshf, acoshf2, vsAcosh)
|
|
29
|
+
FUNC_FF(FUNC_ARCTANH_FF, "arctanh_ff", atanhf, atanhf2, vsAtanh)
|
|
30
|
+
FUNC_FF(FUNC_LOG_FF, "log_ff", logf, logf2, vsLn)
|
|
31
|
+
FUNC_FF(FUNC_LOG1P_FF, "log1p_ff", log1pf, log1pf2, vsLog1p)
|
|
32
|
+
FUNC_FF(FUNC_LOG10_FF, "log10_ff", log10f, log10f2, vsLog10)
|
|
33
|
+
FUNC_FF(FUNC_LOG2_FF, "log2_ff", log2f, log2f2, vsLog2)
|
|
34
|
+
FUNC_FF(FUNC_EXP_FF, "exp_ff", expf, expf2, vsExp)
|
|
35
|
+
FUNC_FF(FUNC_EXPM1_FF, "expm1_ff", expm1f, expm1f2, vsExpm1)
|
|
36
|
+
FUNC_FF(FUNC_ABS_FF, "absolute_ff", fabsf, fabsf2, vsAbs)
|
|
37
|
+
FUNC_FF(FUNC_CONJ_FF, "conjugate_ff",fconjf, fconjf2, vsConj)
|
|
38
|
+
FUNC_FF(FUNC_CEIL_FF, "ceil_ff", ceilf, ceilf2, vsCeil)
|
|
39
|
+
FUNC_FF(FUNC_FLOOR_FF, "floor_ff", floorf, floorf2, vsFloor)
|
|
40
|
+
FUNC_FF(FUNC_TRUNC_FF, "trunc_ff", truncf, truncf2, vsTrunc)
|
|
41
|
+
FUNC_FF(FUNC_SIGN_FF, "sign_ff", signf, signf2, vsSign)
|
|
42
|
+
//rint rounds to nearest even integer, matching NumPy (round doesn't)
|
|
43
|
+
FUNC_FF(FUNC_ROUND_FF, "round_ff", rintf, rintf2, vsRint)
|
|
44
|
+
FUNC_FF(FUNC_FF_LAST, NULL, NULL, NULL, NULL)
|
|
45
|
+
#ifdef ELIDE_FUNC_FF
|
|
46
|
+
#undef ELIDE_FUNC_FF
|
|
47
|
+
#undef FUNC_FF
|
|
48
|
+
#endif
|
|
49
|
+
|
|
50
|
+
#ifndef FUNC_FFF
|
|
51
|
+
#define ELIDE_FUNC_FFF
|
|
52
|
+
#define FUNC_FFF(...)
|
|
53
|
+
#endif
|
|
54
|
+
FUNC_FFF(FUNC_FMOD_FFF, "fmod_fff", fmodf, fmodf2, vsfmod)
|
|
55
|
+
FUNC_FFF(FUNC_ARCTAN2_FFF, "arctan2_fff", atan2f, atan2f2, vsAtan2)
|
|
56
|
+
FUNC_FFF(FUNC_HYPOT_FFF, "hypot_fff", hypotf, hypotf2, vsHypot)
|
|
57
|
+
FUNC_FFF(FUNC_NEXTAFTER_FFF, "nextafter_fff", nextafterf, nextafterf2, vsNextAfter)
|
|
58
|
+
FUNC_FFF(FUNC_COPYSIGN_FFF, "copysign_fff", copysignf, copysignf2, vsCopySign)
|
|
59
|
+
FUNC_FFF(FUNC_MAXIMUM_FFF, "maximum_fff", fmaxf_, fmaxf2, vsFmax_)
|
|
60
|
+
FUNC_FFF(FUNC_MINIMUM_FFF, "minimum_fff", fminf_, fminf2, vsFmin_)
|
|
61
|
+
FUNC_FFF(FUNC_FFF_LAST, NULL, NULL, NULL, NULL)
|
|
62
|
+
#ifdef ELIDE_FUNC_FFF
|
|
63
|
+
#undef ELIDE_FUNC_FFF
|
|
64
|
+
#undef FUNC_FFF
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
#ifndef FUNC_DD
|
|
68
|
+
#define ELIDE_FUNC_DD
|
|
69
|
+
#define FUNC_DD(...)
|
|
70
|
+
#endif
|
|
71
|
+
FUNC_DD(FUNC_SQRT_DD, "sqrt_dd", sqrt, vdSqrt)
|
|
72
|
+
FUNC_DD(FUNC_SIN_DD, "sin_dd", sin, vdSin)
|
|
73
|
+
FUNC_DD(FUNC_COS_DD, "cos_dd", cos, vdCos)
|
|
74
|
+
FUNC_DD(FUNC_TAN_DD, "tan_dd", tan, vdTan)
|
|
75
|
+
FUNC_DD(FUNC_ARCSIN_DD, "arcsin_dd", asin, vdAsin)
|
|
76
|
+
FUNC_DD(FUNC_ARCCOS_DD, "arccos_dd", acos, vdAcos)
|
|
77
|
+
FUNC_DD(FUNC_ARCTAN_DD, "arctan_dd", atan, vdAtan)
|
|
78
|
+
FUNC_DD(FUNC_SINH_DD, "sinh_dd", sinh, vdSinh)
|
|
79
|
+
FUNC_DD(FUNC_COSH_DD, "cosh_dd", cosh, vdCosh)
|
|
80
|
+
FUNC_DD(FUNC_TANH_DD, "tanh_dd", tanh, vdTanh)
|
|
81
|
+
FUNC_DD(FUNC_ARCSINH_DD, "arcsinh_dd", asinh, vdAsinh)
|
|
82
|
+
FUNC_DD(FUNC_ARCCOSH_DD, "arccosh_dd", acosh, vdAcosh)
|
|
83
|
+
FUNC_DD(FUNC_ARCTANH_DD, "arctanh_dd", atanh, vdAtanh)
|
|
84
|
+
FUNC_DD(FUNC_LOG_DD, "log_dd", log, vdLn)
|
|
85
|
+
FUNC_DD(FUNC_LOG1P_DD, "log1p_dd", log1p, vdLog1p)
|
|
86
|
+
FUNC_DD(FUNC_LOG10_DD, "log10_dd", log10, vdLog10)
|
|
87
|
+
FUNC_DD(FUNC_LOG2_DD, "log2_dd", log2, vdLog2)
|
|
88
|
+
FUNC_DD(FUNC_EXP_DD, "exp_dd", exp, vdExp)
|
|
89
|
+
FUNC_DD(FUNC_EXPM1_DD, "expm1_dd", expm1, vdExpm1)
|
|
90
|
+
FUNC_DD(FUNC_ABS_DD, "absolute_dd", fabs, vdAbs)
|
|
91
|
+
FUNC_DD(FUNC_CONJ_DD, "conjugate_dd",fconj, vdConj)
|
|
92
|
+
FUNC_DD(FUNC_CEIL_DD, "ceil_dd", ceil, vdCeil)
|
|
93
|
+
FUNC_DD(FUNC_FLOOR_DD, "floor_dd", floor, vdFloor)
|
|
94
|
+
FUNC_DD(FUNC_TRUNC_DD, "trunc_dd", trunc, vdTrunc)
|
|
95
|
+
FUNC_DD(FUNC_SIGN_DD, "sign_dd", sign, vdSign)
|
|
96
|
+
//rint rounds to nearest even integer, matching NumPy (round doesn't)
|
|
97
|
+
FUNC_DD(FUNC_ROUND_DD, "round_dd", rint, vdRint)
|
|
98
|
+
FUNC_DD(FUNC_DD_LAST, NULL, NULL, NULL)
|
|
99
|
+
#ifdef ELIDE_FUNC_DD
|
|
100
|
+
#undef ELIDE_FUNC_DD
|
|
101
|
+
#undef FUNC_DD
|
|
102
|
+
#endif
|
|
103
|
+
|
|
104
|
+
// double -> boolean functions
|
|
105
|
+
#ifndef FUNC_BD
|
|
106
|
+
#define ELIDE_FUNC_BD
|
|
107
|
+
#define FUNC_BD(...)
|
|
108
|
+
#endif
|
|
109
|
+
FUNC_BD(FUNC_ISNAN_BD, "isnan_bd", isnand, vdIsnan)
|
|
110
|
+
FUNC_BD(FUNC_ISFINITE_BD, "isfinite_bd", isfinited, vdIsfinite)
|
|
111
|
+
FUNC_BD(FUNC_ISINF_BD, "isinf_bd", isinfd, vdIsinf)
|
|
112
|
+
FUNC_BD(FUNC_SIGNBIT_BD, "signbit_bd", signbit, vdSignBit)
|
|
113
|
+
FUNC_BD(FUNC_BD_LAST, NULL, NULL, NULL)
|
|
114
|
+
#ifdef ELIDE_FUNC_BD
|
|
115
|
+
#undef ELIDE_FUNC_BD
|
|
116
|
+
#undef FUNC_BD
|
|
117
|
+
#endif
|
|
118
|
+
|
|
119
|
+
// float -> boolean functions (C99 defines the same function for all types)
|
|
120
|
+
#ifndef FUNC_BF
|
|
121
|
+
#define ELIDE_FUNC_BF
|
|
122
|
+
#define FUNC_BF(...)
|
|
123
|
+
#endif // use wrappers as there is name collision with isnanf in std
|
|
124
|
+
FUNC_BF(FUNC_ISNAN_BF, "isnan_bf", isnanf_, isnanf2, vsIsnan)
|
|
125
|
+
FUNC_BF(FUNC_ISFINITE_BF, "isfinite_bf", isfinitef_, isfinitef2, vsIsfinite)
|
|
126
|
+
FUNC_BF(FUNC_ISINF_BF, "isinf_bf", isinff_, isinff2, vsIsinf)
|
|
127
|
+
FUNC_BF(FUNC_SIGNBIT_BF, "signbit_bf", signbitf, signbitf2, vsSignBit)
|
|
128
|
+
FUNC_BF(FUNC_BF_LAST, NULL, NULL, NULL, NULL)
|
|
129
|
+
#ifdef ELIDE_FUNC_BF
|
|
130
|
+
#undef ELIDE_FUNC_BF
|
|
131
|
+
#undef FUNC_BF
|
|
132
|
+
#endif
|
|
133
|
+
|
|
134
|
+
#ifndef FUNC_DDD
|
|
135
|
+
#define ELIDE_FUNC_DDD
|
|
136
|
+
#define FUNC_DDD(...)
|
|
137
|
+
#endif
|
|
138
|
+
FUNC_DDD(FUNC_FMOD_DDD, "fmod_ddd", fmod, vdfmod)
|
|
139
|
+
FUNC_DDD(FUNC_ARCTAN2_DDD, "arctan2_ddd", atan2, vdAtan2)
|
|
140
|
+
FUNC_DDD(FUNC_HYPOT_DDD, "hypot_ddd", hypot, vdHypot)
|
|
141
|
+
FUNC_DDD(FUNC_NEXTAFTER_DDD, "nextafter_ddd", nextafter, vdNextAfter)
|
|
142
|
+
FUNC_DDD(FUNC_COPYSIGN_DDD, "copysign_ddd", copysign, vdCopySign)
|
|
143
|
+
FUNC_DDD(FUNC_MAXIMUM_DDD, "maximum_ddd", fmaxd, vdFmax_)
|
|
144
|
+
FUNC_DDD(FUNC_MINIMUM_DDD, "minimum_ddd", fmind, vdFmin_)
|
|
145
|
+
FUNC_DDD(FUNC_DDD_LAST, NULL, NULL, NULL)
|
|
146
|
+
#ifdef ELIDE_FUNC_DDD
|
|
147
|
+
#undef ELIDE_FUNC_DDD
|
|
148
|
+
#undef FUNC_DDD
|
|
149
|
+
#endif
|
|
150
|
+
|
|
151
|
+
#ifndef FUNC_CC
|
|
152
|
+
#define ELIDE_FUNC_CC
|
|
153
|
+
#define FUNC_CC(...)
|
|
154
|
+
#endif
|
|
155
|
+
FUNC_CC(FUNC_SQRT_CC, "sqrt_cc", nc_sqrt, vzSqrt)
|
|
156
|
+
FUNC_CC(FUNC_SIN_CC, "sin_cc", nc_sin, vzSin)
|
|
157
|
+
FUNC_CC(FUNC_COS_CC, "cos_cc", nc_cos, vzCos)
|
|
158
|
+
FUNC_CC(FUNC_TAN_CC, "tan_cc", nc_tan, vzTan)
|
|
159
|
+
FUNC_CC(FUNC_ARCSIN_CC, "arcsin_cc", nc_asin, vzAsin)
|
|
160
|
+
FUNC_CC(FUNC_ARCCOS_CC, "arccos_cc", nc_acos, vzAcos)
|
|
161
|
+
FUNC_CC(FUNC_ARCTAN_CC, "arctan_cc", nc_atan, vzAtan)
|
|
162
|
+
FUNC_CC(FUNC_SINH_CC, "sinh_cc", nc_sinh, vzSinh)
|
|
163
|
+
FUNC_CC(FUNC_COSH_CC, "cosh_cc", nc_cosh, vzCosh)
|
|
164
|
+
FUNC_CC(FUNC_TANH_CC, "tanh_cc", nc_tanh, vzTanh)
|
|
165
|
+
FUNC_CC(FUNC_ARCSINH_CC, "arcsinh_cc", nc_asinh, vzAsinh)
|
|
166
|
+
FUNC_CC(FUNC_ARCCOSH_CC, "arccosh_cc", nc_acosh, vzAcosh)
|
|
167
|
+
FUNC_CC(FUNC_ARCTANH_CC, "arctanh_cc", nc_atanh, vzAtanh)
|
|
168
|
+
FUNC_CC(FUNC_LOG_CC, "log_cc", nc_log, vzLn)
|
|
169
|
+
FUNC_CC(FUNC_LOG1P_CC, "log1p_cc", nc_log1p, vzLog1p)
|
|
170
|
+
FUNC_CC(FUNC_LOG10_CC, "log10_cc", nc_log10, vzLog10)
|
|
171
|
+
FUNC_CC(FUNC_LOG2_CC, "log2_cc", nc_log2, vzLog2)
|
|
172
|
+
FUNC_CC(FUNC_EXP_CC, "exp_cc", nc_exp, vzExp)
|
|
173
|
+
FUNC_CC(FUNC_EXPM1_CC, "expm1_cc", nc_expm1, vzExpm1)
|
|
174
|
+
FUNC_CC(FUNC_ABS_CC, "absolute_cc", nc_abs, vzAbs_)
|
|
175
|
+
FUNC_CC(FUNC_CONJ_CC, "conjugate_cc",nc_conj, vzConj)
|
|
176
|
+
FUNC_CC(FUNC_SIGN_CC, "sign_cc", nc_sign, vzSign)
|
|
177
|
+
// rint rounds to nearest even integer, matches NumPy behaviour (round doesn't)
|
|
178
|
+
FUNC_CC(FUNC_ROUND_CC, "round_cc", nc_rint, vzRint)
|
|
179
|
+
FUNC_CC(FUNC_CC_LAST, NULL, NULL, NULL)
|
|
180
|
+
#ifdef ELIDE_FUNC_CC
|
|
181
|
+
#undef ELIDE_FUNC_CC
|
|
182
|
+
#undef FUNC_CC
|
|
183
|
+
#endif
|
|
184
|
+
|
|
185
|
+
#ifndef FUNC_CCC
|
|
186
|
+
#define ELIDE_FUNC_CCC
|
|
187
|
+
#define FUNC_CCC(...)
|
|
188
|
+
#endif
|
|
189
|
+
FUNC_CCC(FUNC_POW_CCC, "pow_ccc", nc_pow)
|
|
190
|
+
FUNC_CCC(FUNC_CCC_LAST, NULL, NULL)
|
|
191
|
+
#ifdef ELIDE_FUNC_CCC
|
|
192
|
+
#undef ELIDE_FUNC_CCC
|
|
193
|
+
#undef FUNC_CCC
|
|
194
|
+
#endif
|
|
195
|
+
|
|
196
|
+
// complex -> boolean functions
|
|
197
|
+
#ifndef FUNC_BC
|
|
198
|
+
#define ELIDE_FUNC_BC
|
|
199
|
+
#define FUNC_BC(...)
|
|
200
|
+
#endif // use wrappers as there is name collision with isnanf in std
|
|
201
|
+
FUNC_BC(FUNC_ISNAN_BC, "isnan_bc", nc_isnan, vzIsnan)
|
|
202
|
+
FUNC_BC(FUNC_ISFINITE_BC, "isfinite_bc", nc_isfinite, vzIsfinite)
|
|
203
|
+
FUNC_BC(FUNC_ISINF_BC, "isinf_bc", nc_isinf, vzIsinf)
|
|
204
|
+
FUNC_BC(FUNC_BC_LAST, NULL, NULL, NULL)
|
|
205
|
+
#ifdef ELIDE_FUNC_BC
|
|
206
|
+
#undef ELIDE_FUNC_BC
|
|
207
|
+
#undef FUNC_BC
|
|
208
|
+
#endif
|
|
209
|
+
|
|
210
|
+
// int -> int functions
|
|
211
|
+
#ifndef FUNC_II
|
|
212
|
+
#define ELIDE_FUNC_II
|
|
213
|
+
#define FUNC_II(...)
|
|
214
|
+
#endif
|
|
215
|
+
FUNC_II(FUNC_SIGN_II, "sign_ii", signi, viSign)
|
|
216
|
+
FUNC_II(FUNC_ROUND_II, "round_ii", rinti, viRint)
|
|
217
|
+
FUNC_II(FUNC_ABS_II, "absolute_ii", fabsi, viFabs)
|
|
218
|
+
FUNC_II(FUNC_II_LAST, NULL, NULL, NULL)
|
|
219
|
+
#ifdef ELIDE_FUNC_II
|
|
220
|
+
#undef ELIDE_FUNC_II
|
|
221
|
+
#undef FUNC_II
|
|
222
|
+
#endif
|
|
223
|
+
|
|
224
|
+
#ifndef FUNC_LL
|
|
225
|
+
#define ELIDE_FUNC_LL
|
|
226
|
+
#define FUNC_LL(...)
|
|
227
|
+
#endif
|
|
228
|
+
FUNC_LL(FUNC_SIGN_LL, "sign_ll", signl, vlSign)
|
|
229
|
+
FUNC_LL(FUNC_ROUND_LL, "round_ll", rintl, vlRint)
|
|
230
|
+
FUNC_LL(FUNC_ABS_LL, "absolute_ll", fabsl, vlFabs)
|
|
231
|
+
FUNC_LL(FUNC_LL_LAST, NULL, NULL, NULL)
|
|
232
|
+
#ifdef ELIDE_FUNC_LL
|
|
233
|
+
#undef ELIDE_FUNC_LL
|
|
234
|
+
#undef FUNC_LL
|
|
235
|
+
#endif
|