Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions scipy/signal/_splinemodule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "numpy/arrayobject.h"
#include <complex>
#include <cmath>
#include <algorithm>
#include "_splinemodule.h"


Expand Down Expand Up @@ -61,7 +62,7 @@ static PyObject *FIRsepsym2d(PyObject *NPY_UNUSED(dummy), PyObject *args) {
return NULL;

thetype = PyArray_ObjectType(image, NPY_FLOAT);
thetype = PyArray_MIN(thetype, NPY_CDOUBLE);
thetype = std::min(thetype, static_cast<int>(NPY_CDOUBLE));
a_image = (PyArrayObject *)PyArray_FromObject(image, thetype, 2, 2);
if (a_image == NULL)
goto fail;
Expand Down Expand Up @@ -180,7 +181,7 @@ static PyObject *IIRsymorder1_ic(PyObject *NPY_UNUSED(dummy), PyObject *args) {
return NULL;

thetype = PyArray_ObjectType(sig, NPY_FLOAT);
thetype = PyArray_MIN(thetype, NPY_CDOUBLE);
thetype = std::min(thetype, static_cast<int>(NPY_CDOUBLE));
a_sig = (PyArrayObject *)PyArray_FromObject(sig, thetype, 1, 2);

if (a_sig == NULL) {
Expand Down Expand Up @@ -316,7 +317,7 @@ static PyObject *IIRsymorder2_ic_fwd(PyObject *NPY_UNUSED(dummy), PyObject *args
return NULL;

thetype = PyArray_ObjectType(sig, NPY_FLOAT);
thetype = PyArray_MIN(thetype, NPY_DOUBLE);
thetype = std::min(thetype, static_cast<int>(NPY_DOUBLE));
a_sig = (PyArrayObject *)PyArray_FromObject(sig, thetype, 1, 2);

if (a_sig == NULL) {
Expand Down Expand Up @@ -432,7 +433,7 @@ static PyObject *IIRsymorder2_ic_bwd(PyObject *NPY_UNUSED(dummy), PyObject *args
return NULL;

thetype = PyArray_ObjectType(sig, NPY_FLOAT);
thetype = PyArray_MIN(thetype, NPY_DOUBLE);
thetype = std::min(thetype, static_cast<int>(NPY_DOUBLE));
a_sig = (PyArrayObject *)PyArray_FromObject(sig, thetype, 1, 2);

if (a_sig == NULL) {
Expand Down
1 change: 0 additions & 1 deletion scipy/signal/_splinemodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
PyErr_SetString(PyExc_ValueError, message); \
goto fail; \
} while (0)
#define PyArray_MIN(a, b) (((a) < (b)) ? (a) : (b))


/**
Expand Down