diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2023-05-13 11:02:49 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 11:02:49 -0600 |
commit | 5187067d7ad176ee3614beab2b99a524dd719aa8 (patch) | |
tree | 907997d0c294f550193322aaa73237c1a7bcfaa6 /numpy/core/src/umath/loops_minmax.dispatch.c.src | |
parent | b786189222ac5bf2f4efbb04399261f7f760bc18 (diff) | |
parent | 81caed6e3c34c4bf4b22b4f6167e816ba2a3f73c (diff) | |
download | numpy-5187067d7ad176ee3614beab2b99a524dd719aa8.tar.gz |
Merge branch 'main' into deprecate-find-common-type
Diffstat (limited to 'numpy/core/src/umath/loops_minmax.dispatch.c.src')
-rw-r--r-- | numpy/core/src/umath/loops_minmax.dispatch.c.src | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/numpy/core/src/umath/loops_minmax.dispatch.c.src b/numpy/core/src/umath/loops_minmax.dispatch.c.src index 237c8e933..9d8667d38 100644 --- a/numpy/core/src/umath/loops_minmax.dispatch.c.src +++ b/numpy/core/src/umath/loops_minmax.dispatch.c.src @@ -451,6 +451,24 @@ clear_fp: #endif } + +NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@_indexed) +(PyArrayMethod_Context *NPY_UNUSED(context), char *const *args, npy_intp const *dimensions, npy_intp const *steps, NpyAuxData *NPY_UNUSED(func)) +{ + char *ip1 = args[0]; + char *indx = args[1]; + char *value = args[2]; + npy_intp is1 = steps[0], isindex = steps[1], isb = steps[2]; + npy_intp n = dimensions[0]; + npy_intp i; + @type@ *indexed; + for(i = 0; i < n; i++, indx += isindex, value += isb) { + indexed = (@type@ *)(ip1 + is1 * *(npy_intp *)indx); + *indexed = SCALAR_OP(*indexed, *(@type@ *)value); + } + return 0; +} + #undef SCALAR_OP #endif // !fp_only || (is_fp && fp_only) |