From 79e93202034f4d2bcbbab3424f2299f306a813a2 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Mon, 19 Mar 2018 00:31:28 -0700 Subject: MAINT: Remove the unused scalarmath getters for fmod and sqrt --- numpy/core/src/umath/scalarmath.c.src | 49 ----------------------------------- 1 file changed, 49 deletions(-) diff --git a/numpy/core/src/umath/scalarmath.c.src b/numpy/core/src/umath/scalarmath.c.src index 7b424cc74..6e1fb1ee8 100644 --- a/numpy/core/src/umath/scalarmath.c.src +++ b/numpy/core/src/umath/scalarmath.c.src @@ -274,9 +274,6 @@ static void * #type = npy_float, npy_double, npy_longdouble# * #c = f, , l# */ -static @type@ (*_basic_@name@_sqrt)(@type@); -static @type@ (*_basic_@name@_fmod)(@type@, @type@); - #define @name@_ctype_add(a, b, outp) *(outp) = (a) + (b) #define @name@_ctype_subtract(a, b, outp) *(outp) = (a) - (b) #define @name@_ctype_multiply(a, b, outp) *(outp) = (a) * (b) @@ -306,9 +303,6 @@ static void /**end repeat**/ -static npy_half (*_basic_half_sqrt)(npy_half); -static npy_half (*_basic_half_fmod)(npy_half, npy_half); - #define half_ctype_add(a, b, outp) *(outp) = \ npy_float_to_half(npy_half_to_float(a) + npy_half_to_float(b)) #define half_ctype_subtract(a, b, outp) *(outp) = \ @@ -1693,49 +1687,6 @@ get_functions(PyObject * mm) _basic_clongdouble_pow = funcdata[j + 5]; Py_DECREF(obj); - /* Get the sqrt functions */ - obj = PyObject_GetAttrString(mm, "sqrt"); - if (obj == NULL) { - goto fail; - } - funcdata = ((PyUFuncObject *)obj)->data; - signatures = ((PyUFuncObject *)obj)->types; - /* - * sqrt ufunc is specialized for double and float loops in - * generate_umath.py, the first to go into FLOAT/DOUBLE_sqrt - * they have the same signature as the scalar variants so we need to skip - * over them - * also skip float16 copy placed before - */ - i = 6; - j = 3; - while (signatures[i] != NPY_FLOAT) { - i += 2; j++; - } - _basic_half_sqrt = funcdata[j - 1]; - _basic_float_sqrt = funcdata[j]; - _basic_double_sqrt = funcdata[j + 1]; - _basic_longdouble_sqrt = funcdata[j + 2]; - Py_DECREF(obj); - - /* Get the fmod functions */ - obj = PyObject_GetAttrString(mm, "fmod"); - if (obj == NULL) { - goto fail; - } - funcdata = ((PyUFuncObject *)obj)->data; - signatures = ((PyUFuncObject *)obj)->types; - i = 0; - j = 0; - while (signatures[i] != NPY_FLOAT) { - i += 3; - j++; - } - _basic_half_fmod = funcdata[j - 1]; - _basic_float_fmod = funcdata[j]; - _basic_double_fmod = funcdata[j + 1]; - _basic_longdouble_fmod = funcdata[j + 2]; - Py_DECREF(obj); return ret = 0; fail: -- cgit v1.2.3