*/
Py_DECREF(value);
value = type;
#if PY_VERSION_HEX < 0x02050000
if (PyInstance_Check(type)) {
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
Py_INCREF(type);
}
else {
type = 0;
PyErr_SetString(PyExc_TypeError,
"raise: exception must be an old-style class or instance");
goto raise_error;
}
#else
type = (PyObject*) Py_TYPE(type);
Py_INCREF(type);
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto raise_error;
}
#endif
}
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
Py_XDECREF(type);
Py_XDECREF(tb);
return;
}
#else /* Python 3+ */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
if (tb == Py_None) {
tb = 0;
} else if (tb && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto bad;
}
if (value == Py_None)
value = 0;
if (PyExceptionInstance_Check(type)) {
if (value) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto bad;
}
value = type;
type = (PyObject*) Py_TYPE(value);
} else if (!PyExceptionClass_Check(type)) {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto bad;
}
if (cause) {
PyObject *fixed_cause;
if (PyExceptionClass_Check(cause)) {
fixed_cause = PyObject_CallObject(cause, NULL);
if (fixed_cause == NULL)
goto bad;
}
else if (PyExceptionInstance_Check(cause)) {
fixed_cause = cause;
Py_INCREF(fixed_cause);
}
else {
PyErr_SetString(PyExc_TypeError,
"exception causes must derive from "
"BaseException");
goto bad;
}
if (!value) {
value = PyObject_CallObject(type, NULL);
}
PyException_SetCause(value, fixed_cause);
}
PyErr_SetObject(type, value);
if (tb) {
PyThreadState *tstate = PyThreadState_GET();
PyObject* tmp_tb = tstate->curexc_traceback;
if (tb != tmp_tb) {
Py_INCREF(tb);
tstate->curexc_traceback = tb;
Py_XDECREF(tmp_tb);
}
}
bad:
return;
}
#endif
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %"PY_FORMAT_SIZE_T"d value%s to unpack",
index, (index == 1) ? "" : "s");
}
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected);
}
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
if (t == Py_None) {
__Pyx_RaiseNoneNotIterableError();
} else if (PyTuple_GET_SIZE(t) < index) {
__Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
} else {
__Pyx_RaiseTooManyValuesError(index);
}
}
#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
#if PY_VERSION_HEX >= 0x02060000
if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
#endif
if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pf_5numpy_7ndarray___getbuffer__(obj, view, flags);
else {
PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
return -1;
}
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
PyObject* obj = view->obj;
if (obj) {
#if PY_VERSION_HEX >= 0x02060000
if (PyObject_CheckBuffer(obj)) {PyBuffer_Release(view); return;}
#endif
if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray_1__releasebuffer__(obj, view);
Py_DECREF(obj);
view->obj = NULL;
}
}
#endif
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
PyObject *py_import = 0;
PyObject *empty_list = 0;
PyObject *module = 0;
PyObject *global_dict = 0;
PyObject *empty_dict = 0;
PyObject *list;
py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
if (!py_import)
goto bad;
if (from_list)
list = from_list;
else {
empty_list = PyList_New(0);
if (!empty_list)
goto bad;
list = empty_list;
}
global_dict = PyModule_GetDict(__pyx_m);
if (!global_dict)
goto bad;
empty_dict = PyDict_New();
if (!empty_dict)
goto bad;
#if PY_VERSION_HEX >= 0x02050000
{
PyObject *py_level = PyInt_FromLong(level);
if (!py_level)
goto bad;
module = PyObject_CallFunctionObjArgs(py_import,
name, global_dict, empty_dict, list, py_level, NULL);
Py_DECREF(py_level);
}
#else
if (level>0) {
PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
goto bad;
}
module = PyObject_CallFunctionObjArgs(py_import,
name, global_dict, empty_dict, list, NULL);
#endif
bad:
Py_XDECREF(empty_list);
Py_XDECREF(py_import);
Py_XDECREF(empty_dict);
return module;
}
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
return ::std::complex< float >(x, y);
}
#else
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
return x + y*(__pyx_t_float_complex)_Complex_I;
}
#endif
#else
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
__pyx_t_float_complex z;
z.real = x;
z.imag = y;
return z;
}
#endif
#if CYTHON_CCOMPLEX
#else
static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
return (a.real == b.real) && (a.imag == b.imag);
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
__pyx_t_float_complex z;
z.real = a.real + b.real;
z.imag = a.imag + b.imag;
return z;
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
__pyx_t_float_complex z;
z.real = a.real - b.real;
z.imag = a.imag - b.imag;
return z;
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
__pyx_t_float_complex z;
z.real = a.real * b.real - a.imag * b.imag;
z.imag = a.real * b.imag + a.imag * b.real;
return z;
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
__pyx_t_float_complex z;
float denom = b.real * b.real + b.imag * b.imag;
z.real = (a.real * b.real + a.imag * b.imag) / denom;
z.imag = (a.imag * b.real - a.real * b.imag) / denom;
return z;
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
__pyx_t_float_complex z;
z.real = -a.real;
z.imag = -a.imag;
return z;
}
static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
return (a.real == 0) && (a.imag == 0);
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
__pyx_t_float_complex z;
z.real = a.real;
z.imag = -a.imag;
return z;
}
#if 1
static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
#if !defined(HAVE_HYPOT) || defined(_MSC_VER)
return sqrtf(z.real*z.real + z.imag*z.imag);
#else
return hypotf(z.real, z.imag);
#endif
}
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
__pyx_t_float_complex z;
float r, lnr, theta, z_r, z_theta;
if (b.imag == 0 && b.real == (int)b.real) {
if (b.real < 0) {
float denom = a.real * a.real + a.imag * a.imag;
a.real = a.real / denom;
a.imag = -a.imag / denom;
b.real = -b.real;
}
switch ((int)b.real) {
case 0:
z.real = 1;
z.imag = 0;
return z;
case 1:
return a;
case 2:
z = __Pyx_c_prodf(a, a);
return __Pyx_c_prodf(a, a);
case 3:
z = __Pyx_c_prodf(a, a);
return __Pyx_c_prodf(z, a);
case 4:
z = __Pyx_c_prodf(a, a);
return __Pyx_c_prodf(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
}
r = a.real;
theta = 0;
} else {
r = __Pyx_c_absf(a);
theta = atan2f(a.imag, a.real);
}
lnr = logf(r);
z_r = expf(lnr * b.real - theta * b.imag);
z_theta = theta * b.real + lnr * b.imag;
z.real = z_r * cosf(z_theta);
z.imag = z_r * sinf(z_theta);
return z;
}
#endif
#endif
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
return ::std::complex< double >(x, y);
}
#else
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
return x + y*(__pyx_t_double_complex)_Complex_I;
}
#endif
#else
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
__pyx_t_double_complex z;
z.real = x;
z.imag = y;
return z;
}
#endif
#if CYTHON_CCOMPLEX
#else
static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
return (a.real == b.real) && (a.imag == b.imag);
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
__pyx_t_double_complex z;
z.real = a.real + b.real;
z.imag = a.imag + b.imag;
return z;
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
__pyx_t_double_complex z;
z.real = a.real - b.real;
z.imag = a.imag - b.imag;
return z;
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
__pyx_t_double_complex z;
z.real = a.real * b.real - a.imag * b.imag;
z.imag = a.real * b.imag + a.imag * b.real;
return z;
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
__pyx_t_double_complex z;
double denom = b.real * b.real + b.imag * b.imag;
z.real = (a.real * b.real + a.imag * b.imag) / denom;
z.imag = (a.imag * b.real - a.real * b.imag) / denom;
return z;
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
__pyx_t_double_complex z;
z.real = -a.real;
z.imag = -a.imag;
return z;
}
static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
return (a.real == 0) && (a.imag == 0);
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
__pyx_t_double_complex z;
z.real = a.real;
z.imag = -a.imag;
return z;
}
#if 1
static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
#if !defined(HAVE_HYPOT) || defined(_MSC_VER)
return sqrt(z.real*z.real + z.imag*z.imag);
#else
return hypot(z.real, z.imag);
#endif
}
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
__pyx_t_double_complex z;
double r, lnr, theta, z_r, z_theta;
if (b.imag == 0 && b.real == (int)b.real) {
if (b.real < 0) {
double denom = a.real * a.real + a.imag * a.imag;
a.real = a.real / denom;
a.imag = -a.imag / denom;
b.real = -b.real;
}
switch ((int)b.real) {
case 0:
z.real = 1;
z.imag = 0;
return z;
case 1:
return a;
case 2:
z = __Pyx_c_prod(a, a);
return __Pyx_c_prod(a, a);
case 3:
z = __Pyx_c_prod(a, a);
return __Pyx_c_prod(z, a);
case 4:
z = __Pyx_c_prod(a, a);
return __Pyx_c_prod(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
}
r = a.real;
theta = 0;
} else {
r = __Pyx_c_abs(a);
theta = atan2(a.imag, a.real);
}
lnr = log(r);
z_r = exp(lnr * b.real - theta * b.imag);
z_theta = theta * b.real + lnr * b.imag;
z.real = z_r * cos(z_theta);
z.imag = z_r * sin(z_theta);
return z;
}
#endif
#endif
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(unsigned char) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(unsigned char)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to unsigned char" :
"value too large to convert to unsigned char");
}
return (unsigned char)-1;
}
return (unsigned char)val;
}
return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(unsigned short) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(unsigned short)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to unsigned short" :
"value too large to convert to unsigned short");
}
return (unsigned short)-1;
}
return (unsigned short)val;
}
return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(unsigned int) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(unsigned int)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to unsigned int" :
"value too large to convert to unsigned int");
}
return (unsigned int)-1;
}
return (unsigned int)val;
}
return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
const char neg_one = (char)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(char) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(char)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to char" :
"value too large to convert to char");
}
return (char)-1;
}
return (char)val;
}
return (char)__Pyx_PyInt_AsLong(x);
}
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
const short neg_one = (short)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(short) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(short)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to short" :
"value too large to convert to short");
}
return (short)-1;
}
return (short)val;
}
return (short)__Pyx_PyInt_AsLong(x);
}
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
const int neg_one = (int)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(int) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(int)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to int" :
"value too large to convert to int");
}
return (int)-1;
}
return (int)val;
}
return (int)__Pyx_PyInt_AsLong(x);
}
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
const signed char neg_one = (signed char)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(signed char) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(signed char)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to signed char" :
"value too large to convert to signed char");
}
return (signed char)-1;
}
return (signed char)val;
}
return (signed char)__Pyx_PyInt_AsSignedLong(x);
}
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
const signed short neg_one = (signed short)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(signed short) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(signed short)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to signed short" :
"value too large to convert to signed short");
}
return (signed short)-1;
}
return (signed short)val;
}
return (signed short)__Pyx_PyInt_AsSignedLong(x);
}
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
const signed int neg_one = (signed int)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(signed int) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(signed int)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to signed int" :
"value too large to convert to signed int");
}
return (signed int)-1;
}
return (signed int)val;
}
return (signed int)__Pyx_PyInt_AsSignedLong(x);
}
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
const int neg_one = (int)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
if (sizeof(int) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(int)val)) {
if (!unlikely(val == -1 && PyErr_Occurred())) {
PyErr_SetString(PyExc_OverflowError,
(is_unsigned && unlikely(val < 0)) ?
"can't convert negative value to int" :
"value too large to convert to int");
}
return (int)-1;
}
return (int)val;
}
return (int)__Pyx_PyInt_AsLong(x);
}
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to unsigned long");
return (unsigned long)-1;
}
return (unsigned long)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to unsigned long");
return (unsigned long)-1;
}
return (unsigned long)PyLong_AsUnsignedLong(x);
} else {
return (unsigned long)PyLong_AsLong(x);
}
} else {
unsigned long val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (unsigned long)-1;
val = __Pyx_PyInt_AsUnsignedLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to unsigned PY_LONG_LONG");
return (unsigned PY_LONG_LONG)-1;
}
return (unsigned PY_LONG_LONG)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to unsigned PY_LONG_LONG");
return (unsigned PY_LONG_LONG)-1;
}
return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
} else {
return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
}
} else {
unsigned PY_LONG_LONG val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (unsigned PY_LONG_LONG)-1;
val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
const long neg_one = (long)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to long");
return (long)-1;
}
return (long)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to long");
return (long)-1;
}
return (long)PyLong_AsUnsignedLong(x);
} else {
return (long)PyLong_AsLong(x);
}
} else {
long val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (long)-1;
val = __Pyx_PyInt_AsLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to PY_LONG_LONG");
return (PY_LONG_LONG)-1;
}
return (PY_LONG_LONG)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to PY_LONG_LONG");
return (PY_LONG_LONG)-1;
}
return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
} else {
return (PY_LONG_LONG)PyLong_AsLongLong(x);
}
} else {
PY_LONG_LONG val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (PY_LONG_LONG)-1;
val = __Pyx_PyInt_AsLongLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
const signed long neg_one = (signed long)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to signed long");
return (signed long)-1;
}
return (signed long)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to signed long");
return (signed long)-1;
}
return (signed long)PyLong_AsUnsignedLong(x);
} else {
return (signed long)PyLong_AsLong(x);
}
} else {
signed long val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (signed long)-1;
val = __Pyx_PyInt_AsSignedLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to signed PY_LONG_LONG");
return (signed PY_LONG_LONG)-1;
}
return (signed PY_LONG_LONG)val;
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
if (unlikely(Py_SIZE(x) < 0)) {
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to signed PY_LONG_LONG");
return (signed PY_LONG_LONG)-1;
}
return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
} else {
return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
}
} else {
signed PY_LONG_LONG val;
PyObject *tmp = __Pyx_PyNumber_Int(x);
if (!tmp) return (signed PY_LONG_LONG)-1;
val = __Pyx_PyInt_AsSignedLongLong(tmp);
Py_DECREF(tmp);
return val;
}
}
static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
char message[200];
PyOS_snprintf(message, sizeof(message),
"compiletime version %s of module '%.100s' "
"does not match runtime version %s",
ctversion, __Pyx_MODULE_NAME, rtversion);
#if PY_VERSION_HEX < 0x02050000
return PyErr_Warn(NULL, message);
#else
return PyErr_WarnEx(NULL, message, 1);
#endif
}
return 0;
}
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
size_t size, int strict)
{
PyObject *py_module = 0;
PyObject *result = 0;
PyObject *py_name = 0;
char warning[200];
py_module = __Pyx_ImportModule(module_name);
if (!py_module)
goto bad;
py_name = __Pyx_PyIdentifier_FromString(class_name);
if (!py_name)
goto bad;
result = PyObject_GetAttr(py_module, py_name);
Py_DECREF(py_name);
py_name = 0;
Py_DECREF(py_module);
py_module = 0;
if (!result)
goto bad;
if (!PyType_Check(result)) {
PyErr_Format(PyExc_TypeError,
"%s.%s is not a type object",
module_name, class_name);
goto bad;
}
if (!strict && ((PyTypeObject *)result)->tp_basicsize > (Py_ssize_t)size) {
PyOS_snprintf(warning, sizeof(warning),
"%s.%s size changed, may indicate binary incompatibility",
module_name, class_name);
#if PY_VERSION_HEX < 0x02050000
if (PyErr_Warn(NULL, warning) < 0) goto bad;
#else
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
#endif
}
else if (((PyTypeObject *)result)->tp_basicsize != (Py_ssize_t)size) {
PyErr_Format(PyExc_ValueError,
"%s.%s has the wrong size, try recompiling",
module_name, class_name);
goto bad;
}
return (PyTypeObject *)result;
bad:
Py_XDECREF(py_module);
Py_XDECREF(result);
return NULL;
}
#endif
#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
PyObject *py_name = 0;
PyObject *py_module = 0;
py_name = __Pyx_PyIdentifier_FromString(name);
if (!py_name)
goto bad;
py_module = PyImport_Import(py_name);
Py_DECREF(py_name);
return py_module;
bad:
Py_XDECREF(py_name);
return 0;
}
#endif
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
int __pyx_lineno, const char *__pyx_filename) {
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
PyObject *py_globals = 0;
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
#if PY_MAJOR_VERSION < 3
py_srcfile = PyString_FromString(__pyx_filename);
#else
py_srcfile = PyUnicode_FromString(__pyx_filename);
#endif
if (!py_srcfile) goto bad;
if (__pyx_clineno) {
#if PY_MAJOR_VERSION < 3
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
#else
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
#endif
}
else {
#if PY_MAJOR_VERSION < 3
py_funcname = PyString_FromString(funcname);
#else
py_funcname = PyUnicode_FromString(funcname);
#endif
}
if (!py_funcname) goto bad;
py_globals = PyModule_GetDict(__pyx_m);
if (!py_globals) goto bad;
py_code = __Pyx_PyCode_New(
0, /*int argcount,*/
0, /*int kwonlyargcount,*/
0, /*int nlocals,*/
0, /*int stacksize,*/
0, /*int flags,*/
__pyx_empty_bytes, /*PyObject *code,*/
__pyx_empty_tuple, /*PyObject *consts,*/
__pyx_empty_tuple, /*PyObject *names,*/
__pyx_empty_tuple, /*PyObject *varnames,*/
__pyx_empty_tuple, /*PyObject *freevars,*/
__pyx_empty_tuple, /*PyObject *cellvars,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
__pyx_lineno, /*int firstlineno,*/
__pyx_empty_bytes /*PyObject *lnotab*/
);
if (!py_code) goto bad;
py_frame = PyFrame_New(
PyThreadState_GET(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
py_globals, /*PyObject *globals,*/
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
py_frame->f_lineno = __pyx_lineno;
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
} else if (t->intern) {
*t->p = PyString_InternFromString(t->s);
} else {
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
}
#else /* Python 3+ has unicode identifiers */
if (t->is_unicode | t->is_str) {
if (t->intern) {
*t->p = PyUnicode_InternFromString(t->s);
} else if (t->encoding) {
*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
} else {
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
}
} else {
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
}
#endif
if (!*t->p)
return -1;
++t;
}
return 0;
}
/* Type Conversion Functions */
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
int is_true = x == Py_True;
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
PyNumberMethods *m;
const char *name = NULL;
PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
if (PyInt_Check(x) || PyLong_Check(x))
#else
if (PyLong_Check(x))
#endif
return Py_INCREF(x), x;
m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
}
else if (m && m->nb_long) {
name = "long";
res = PyNumber_Long(x);
}
#else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
#endif
if (res) {
#if PY_VERSION_HEX < 0x03000000
if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
if (!PyLong_Check(res)) {
#endif
PyErr_Format(PyExc_TypeError,
"__%s__ returned non-%s (type %.200s)",
name, name, Py_TYPE(res)->tp_name);
Py_DECREF(res);
return NULL;
}
}
else if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError,
"an integer is required");
}
return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
Py_ssize_t ival;
PyObject* x = PyNumber_Index(b);
if (!x) return -1;
ival = PyInt_AsSsize_t(x);
Py_DECREF(x);
return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
if (ival <= LONG_MAX)
return PyInt_FromLong((long)ival);
else {
unsigned char *bytes = (unsigned char *) &ival;
int one = 1; int little = (int)*(unsigned char*)&one;
return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
}
#else
return PyInt_FromSize_t(ival);
#endif
}
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
return (size_t)-1;
} else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to size_t");
return (size_t)-1;
}
return (size_t)val;
}
#endif /* Py_PYTHON_H */
pyfai-0.3.5/src/splitBBox.html 0000644 0016116 0006511 00001602055 11656557527 015420 0 ustar kieffer soft
Generated by Cython 0.15.1+ on Wed Nov 9 08:54:07 2011
Raw output: splitBBox.c
1: #!/usr/bin/env python
/* "splitBBox.pyx":1
* #!/usr/bin/env python # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* # -*- coding: utf8 -*-
* #
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2: # -*- coding: utf8 -*-
3: #
4: # Project: Azimuthal integration
5: # https://forge.epn-campus.eu/projects/azimuthal
6: #
7: # File: "$Id$"
8: #
9: # Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
10: #
11: # Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
12: #
13: # This program is free software: you can redistribute it and/or modify
14: # it under the terms of the GNU General Public License as published by
15: # the Free Software Foundation, either version 3 of the License, or
16: # (at your option) any later version.
17: #
18: # This program is distributed in the hope that it will be useful,
19: # but WITHOUT ANY WARRANTY; without even the implied warranty of
20: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21: # GNU General Public License for more details.
22: #
23: # You should have received a copy of the GNU General Public License
24: # along with this program. If not, see <http://www.gnu.org/licenses/>.
25: #
26:
27:
28: import cython
29: cimport numpy
30: import numpy
/* "splitBBox.pyx":30
* import cython
* cimport numpy
* import numpy # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* cdef extern from "math.h":
*/
__pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__numpy, __pyx_t_1) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31:
32: cdef extern from "math.h":
33: double floor(float)nogil
34:
35:
36: ctypedef numpy.int64_t DTYPE_int64_t
/* "splitBBox.pyx":36
*
*
* ctypedef numpy.int64_t DTYPE_int64_t # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* ctypedef numpy.float64_t DTYPE_float64_t
* ctypedef numpy.float32_t DTYPE_float32_t
*/
typedef __pyx_t_5numpy_int64_t __pyx_t_9splitBBox_DTYPE_int64_t;
37: ctypedef numpy.float64_t DTYPE_float64_t
/* "splitBBox.pyx":37
*
* ctypedef numpy.int64_t DTYPE_int64_t
* ctypedef numpy.float64_t DTYPE_float64_t # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* ctypedef numpy.float32_t DTYPE_float32_t
*
*/
typedef __pyx_t_5numpy_float64_t __pyx_t_9splitBBox_DTYPE_float64_t;
38: ctypedef numpy.float32_t DTYPE_float32_t
39:
40:
41: @cython.cdivision(True)
42: cdef float getBinNr(float x0, float pos0_min, float dpos) nogil:
/* "splitBBox.pyx":42
*
* @cython.cdivision(True)
* cdef float getBinNr(float x0, float pos0_min, float dpos) nogil: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* """
* calculate the bin number for any point
*/
static float __pyx_f_9splitBBox_getBinNr(float __pyx_v_x0, float __pyx_v_pos0_min, float __pyx_v_dpos) {
float __pyx_r;
43: """
44: calculate the bin number for any point
45: param x0: current position
46: param pos0_min: position minimum
47: param dpos: bin width
48: """
49: return (x0 - pos0_min) / dpos
/* "splitBBox.pyx":49
* param dpos: bin width
* """
* return (x0 - pos0_min) / dpos # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
*
*/
__pyx_r = ((__pyx_v_x0 - __pyx_v_pos0_min) / __pyx_v_dpos);
goto __pyx_L0;
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}
50:
51:
52: @cython.cdivision(True)
53: @cython.boundscheck(False)
54: @cython.wraparound(False)
55: def histoBBox1d(numpy.ndarray weights not None,
/* "splitBBox.pyx":55
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def histoBBox1d(numpy.ndarray weights not None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
*/
static PyObject *__pyx_pf_9splitBBox_histoBBox1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9splitBBox_histoBBox1d[] = "\n Calculates histogram of pos0 (tth) weighted by weights\n \n Splitting is done on the pixel's bounding box like fit2D\n \n @param weights: array with intensities\n @param pos0: 1D array with pos0: tth or q_vect\n @param delta_pos0: 1D array with delta pos0: max center-corner distance\n @param pos1: 1D array with pos1: chi\n @param delta_pos1: 1D array with max pos1: max center-corner distance, unused ! \n @param bins: number of output bins\n @param pos0Range: minimum and maximum of the 2th range\n @param pos1Range: minimum and maximum of the chi range\n @param dummy: value for bins without pixels \n @return 2theta, I, weighted histogram, unweighted histogram\n ";
static PyMethodDef __pyx_mdef_9splitBBox_histoBBox1d = {__Pyx_NAMESTR("histoBBox1d"), (PyCFunction)__pyx_pf_9splitBBox_histoBBox1d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9splitBBox_histoBBox1d)};
static PyObject *__pyx_pf_9splitBBox_histoBBox1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *__pyx_v_weights = 0;
PyArrayObject *__pyx_v_pos0 = 0;
PyArrayObject *__pyx_v_delta_pos0 = 0;
PyObject *__pyx_v_pos1 = 0;
PyObject *__pyx_v_delta_pos1 = 0;
long __pyx_v_bins;
PyObject *__pyx_v_pos0Range = 0;
PyObject *__pyx_v_pos1Range = 0;
float __pyx_v_dummy;
long __pyx_v_size;
PyArrayObject *__pyx_v_cdata = 0;
PyArrayObject *__pyx_v_cpos0_inf = 0;
PyArrayObject *__pyx_v_cpos0_sup = 0;
PyArrayObject *__pyx_v_cpos1_inf = 0;
PyArrayObject *__pyx_v_cpos1_sup = 0;
PyArrayObject *__pyx_v_outData = 0;
PyArrayObject *__pyx_v_outCount = 0;
PyArrayObject *__pyx_v_outMerge = 0;
PyArrayObject *__pyx_v_outPos = 0;
float __pyx_v_deltaR;
float __pyx_v_deltaL;
float __pyx_v_deltaA;
float __pyx_v_pos0_min;
float __pyx_v_pos0_max;
float __pyx_v_pos0_maxin;
float __pyx_v_pos1_min;
float __pyx_v_pos1_max;
float __pyx_v_pos1_maxin;
float __pyx_v_min0;
float __pyx_v_max0;
float __pyx_v_fbin0_min;
float __pyx_v_fbin0_max;
int __pyx_v_checkpos1;
float __pyx_v_dpos;
CYTHON_UNUSED long __pyx_v_bin;
long __pyx_v_i;
long __pyx_v_idx;
long __pyx_v_bin0_max;
long __pyx_v_bin0_min;
double __pyx_v_epsilon;
double __pyx_v_data;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
__Pyx_Buffer __pyx_pybuffer_outMerge;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_inf;
__Pyx_Buffer __pyx_pybuffer_cpos0_inf;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outPos;
__Pyx_Buffer __pyx_pybuffer_outPos;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_sup;
__Pyx_Buffer __pyx_pybuffer_cpos0_sup;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_sup;
__Pyx_Buffer __pyx_pybuffer_cpos1_sup;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
__Pyx_Buffer __pyx_pybuffer_outCount;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cdata;
__Pyx_Buffer __pyx_pybuffer_cdata;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
__Pyx_Buffer __pyx_pybuffer_outData;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_inf;
__Pyx_Buffer __pyx_pybuffer_cpos1_inf;
PyObject *__pyx_r = NULL;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__weights,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__dummy,0};
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("histoBBox1d");
__pyx_self = __pyx_self;
{
PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
/* "splitBBox.pyx":55
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def histoBBox1d(numpy.ndarray weights not None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
*/
__pyx_k_tuple_24 = PyTuple_New(41); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_24);
__Pyx_INCREF(((PyObject *)__pyx_n_s__weights));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_n_s__weights));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__weights));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 1, ((PyObject *)__pyx_n_s__pos0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__delta_pos0));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 2, ((PyObject *)__pyx_n_s__delta_pos0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_pos0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 3, ((PyObject *)__pyx_n_s__pos1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__delta_pos1));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 4, ((PyObject *)__pyx_n_s__delta_pos1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_pos1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bins));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 5, ((PyObject *)__pyx_n_s__bins));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0Range));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 6, ((PyObject *)__pyx_n_s__pos0Range));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0Range));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1Range));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 7, ((PyObject *)__pyx_n_s__pos1Range));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1Range));
__Pyx_INCREF(((PyObject *)__pyx_n_s__dummy));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 8, ((PyObject *)__pyx_n_s__dummy));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__dummy));
__Pyx_INCREF(((PyObject *)__pyx_n_s__size));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 9, ((PyObject *)__pyx_n_s__size));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__size));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cdata));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 10, ((PyObject *)__pyx_n_s__cdata));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdata));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_inf));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 11, ((PyObject *)__pyx_n_s__cpos0_inf));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_inf));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_sup));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 12, ((PyObject *)__pyx_n_s__cpos0_sup));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_sup));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_inf));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 13, ((PyObject *)__pyx_n_s__cpos1_inf));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_inf));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_sup));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 14, ((PyObject *)__pyx_n_s__cpos1_sup));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_sup));
__Pyx_INCREF(((PyObject *)__pyx_n_s__outData));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 15, ((PyObject *)__pyx_n_s__outData));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__outData));
__Pyx_INCREF(((PyObject *)__pyx_n_s__outCount));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 16, ((PyObject *)__pyx_n_s__outCount));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__outCount));
__Pyx_INCREF(((PyObject *)__pyx_n_s__outMerge));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 17, ((PyObject *)__pyx_n_s__outMerge));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__outMerge));
__Pyx_INCREF(((PyObject *)__pyx_n_s__outPos));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 18, ((PyObject *)__pyx_n_s__outPos));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__outPos));
__Pyx_INCREF(((PyObject *)__pyx_n_s__deltaR));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 19, ((PyObject *)__pyx_n_s__deltaR));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaR));
__Pyx_INCREF(((PyObject *)__pyx_n_s__deltaL));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 20, ((PyObject *)__pyx_n_s__deltaL));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaL));
__Pyx_INCREF(((PyObject *)__pyx_n_s__deltaA));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 21, ((PyObject *)__pyx_n_s__deltaA));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaA));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_min));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 22, ((PyObject *)__pyx_n_s__pos0_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_max));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 23, ((PyObject *)__pyx_n_s__pos0_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_maxin));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 24, ((PyObject *)__pyx_n_s__pos0_maxin));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_maxin));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_min));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 25, ((PyObject *)__pyx_n_s__pos1_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_max));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 26, ((PyObject *)__pyx_n_s__pos1_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_maxin));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 27, ((PyObject *)__pyx_n_s__pos1_maxin));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_maxin));
__Pyx_INCREF(((PyObject *)__pyx_n_s__min0));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 28, ((PyObject *)__pyx_n_s__min0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__min0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__max0));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 29, ((PyObject *)__pyx_n_s__max0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__max0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__fbin0_min));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 30, ((PyObject *)__pyx_n_s__fbin0_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__fbin0_max));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 31, ((PyObject *)__pyx_n_s__fbin0_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__checkpos1));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 32, ((PyObject *)__pyx_n_s__checkpos1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__checkpos1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__dpos));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 33, ((PyObject *)__pyx_n_s__dpos));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__dpos));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bin));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 34, ((PyObject *)__pyx_n_s__bin));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin));
__Pyx_INCREF(((PyObject *)__pyx_n_s__i));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 35, ((PyObject *)__pyx_n_s__i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__idx));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 36, ((PyObject *)__pyx_n_s__idx));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_max));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 37, ((PyObject *)__pyx_n_s__bin0_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_min));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 38, ((PyObject *)__pyx_n_s__bin0_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__epsilon));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 39, ((PyObject *)__pyx_n_s__epsilon));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__epsilon));
__Pyx_INCREF(((PyObject *)__pyx_n_s__data));
PyTuple_SET_ITEM(__pyx_k_tuple_24, 40, ((PyObject *)__pyx_n_s__data));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__data));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
/* "splitBBox.pyx":55
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def histoBBox1d(numpy.ndarray weights not None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9splitBBox_histoBBox1d, NULL, __pyx_n_s__splitBBox); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__histoBBox1d, __pyx_t_1) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_k_codeobj_25 = (PyObject*)__Pyx_PyCode_New(9, 0, 41, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__histoBBox1d, 55, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56: numpy.ndarray pos0 not None,
57: numpy.ndarray delta_pos0 not None,
58: pos1=None,
/* "splitBBox.pyx":58
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
* pos1=None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* delta_pos1=None,
* long bins=100,
*/
values[3] = ((PyObject *)Py_None);
59: delta_pos1=None,
/* "splitBBox.pyx":59
* numpy.ndarray delta_pos0 not None,
* pos1=None,
* delta_pos1=None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* long bins=100,
* pos0Range=None,
*/
values[4] = ((PyObject *)Py_None);
60: long bins=100,
61: pos0Range=None,
/* "splitBBox.pyx":61
* delta_pos1=None,
* long bins=100,
* pos0Range=None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1Range=None,
* float dummy=0.0
*/
values[6] = ((PyObject *)Py_None);
62: pos1Range=None,
/* "splitBBox.pyx":62
* long bins=100,
* pos0Range=None,
* pos1Range=None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* float dummy=0.0
* ):
*/
values[7] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights);
if (likely(values[0])) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0);
if (likely(values[1])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0);
if (likely(values[2])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1);
if (value) { values[4] = value; kw_args--; }
}
case 5:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
if (value) { values[5] = value; kw_args--; }
}
case 6:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
if (value) { values[6] = value; kw_args--; }
}
case 7:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
if (value) { values[7] = value; kw_args--; }
}
case 8:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
if (value) { values[8] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histoBBox1d") <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_v_weights = ((PyArrayObject *)values[0]);
__pyx_v_pos0 = ((PyArrayObject *)values[1]);
__pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
__pyx_v_pos1 = values[3];
__pyx_v_delta_pos1 = values[4];
if (values[5]) {
__pyx_v_bins = __Pyx_PyInt_AsLong(values[5]); if (unlikely((__pyx_v_bins == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_bins = ((long)100);
}
__pyx_v_pos0Range = values[6];
__pyx_v_pos1Range = values[7];
if (values[8]) {
__pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
63: float dummy=0.0
/* "splitBBox.pyx":63
* pos0Range=None,
* pos1Range=None,
* float dummy=0.0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* ):
* """
*/
__pyx_v_dummy = ((float)0.0);
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_weights = ((PyArrayObject *)values[0]);
__pyx_v_pos0 = ((PyArrayObject *)values[1]);
__pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
__pyx_v_pos1 = values[3];
__pyx_v_delta_pos1 = values[4];
if (values[5]) {
__pyx_v_bins = __Pyx_PyInt_AsLong(values[5]); if (unlikely((__pyx_v_bins == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_bins = ((long)100);
}
__pyx_v_pos0Range = values[6];
__pyx_v_pos1Range = values[7];
if (values[8]) {
__pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_dummy = ((float)0.0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("splitBBox.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_pybuffer_cdata.pybuffer.buf = NULL;
__pyx_pybuffer_cdata.refcount = 0;
__pyx_pybuffernd_cdata.data = NULL;
__pyx_pybuffernd_cdata.rcbuffer = &__pyx_pybuffer_cdata;
__pyx_pybuffer_cpos0_inf.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0_inf.refcount = 0;
__pyx_pybuffernd_cpos0_inf.data = NULL;
__pyx_pybuffernd_cpos0_inf.rcbuffer = &__pyx_pybuffer_cpos0_inf;
__pyx_pybuffer_cpos0_sup.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0_sup.refcount = 0;
__pyx_pybuffernd_cpos0_sup.data = NULL;
__pyx_pybuffernd_cpos0_sup.rcbuffer = &__pyx_pybuffer_cpos0_sup;
__pyx_pybuffer_cpos1_inf.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1_inf.refcount = 0;
__pyx_pybuffernd_cpos1_inf.data = NULL;
__pyx_pybuffernd_cpos1_inf.rcbuffer = &__pyx_pybuffer_cpos1_inf;
__pyx_pybuffer_cpos1_sup.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1_sup.refcount = 0;
__pyx_pybuffernd_cpos1_sup.data = NULL;
__pyx_pybuffernd_cpos1_sup.rcbuffer = &__pyx_pybuffer_cpos1_sup;
__pyx_pybuffer_outData.pybuffer.buf = NULL;
__pyx_pybuffer_outData.refcount = 0;
__pyx_pybuffernd_outData.data = NULL;
__pyx_pybuffernd_outData.rcbuffer = &__pyx_pybuffer_outData;
__pyx_pybuffer_outCount.pybuffer.buf = NULL;
__pyx_pybuffer_outCount.refcount = 0;
__pyx_pybuffernd_outCount.data = NULL;
__pyx_pybuffernd_outCount.rcbuffer = &__pyx_pybuffer_outCount;
__pyx_pybuffer_outMerge.pybuffer.buf = NULL;
__pyx_pybuffer_outMerge.refcount = 0;
__pyx_pybuffernd_outMerge.data = NULL;
__pyx_pybuffernd_outMerge.rcbuffer = &__pyx_pybuffer_outMerge;
__pyx_pybuffer_outPos.pybuffer.buf = NULL;
__pyx_pybuffer_outPos.refcount = 0;
__pyx_pybuffernd_outPos.data = NULL;
__pyx_pybuffernd_outPos.rcbuffer = &__pyx_pybuffer_outPos;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 0, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos0), __pyx_ptype_5numpy_ndarray, 0, "pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_delta_pos0), __pyx_ptype_5numpy_ndarray, 0, "delta_pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64: ):
65: """
66: Calculates histogram of pos0 (tth) weighted by weights
67:
68: Splitting is done on the pixel's bounding box like fit2D
69:
70: @param weights: array with intensities
71: @param pos0: 1D array with pos0: tth or q_vect
72: @param delta_pos0: 1D array with delta pos0: max center-corner distance
73: @param pos1: 1D array with pos1: chi
74: @param delta_pos1: 1D array with max pos1: max center-corner distance, unused !
75: @param bins: number of output bins
76: @param pos0Range: minimum and maximum of the 2th range
77: @param pos1Range: minimum and maximum of the chi range
78: @param dummy: value for bins without pixels
79: @return 2theta, I, weighted histogram, unweighted histogram
80: """
81: cdef long size = weights.size
/* "splitBBox.pyx":81
* @return 2theta, I, weighted histogram, unweighted histogram
* """
* cdef long size = weights.size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert pos0.size == size
* assert delta_pos0.size == size
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_size = __pyx_t_2;
82: assert pos0.size == size
/* "splitBBox.pyx":82
* """
* cdef long size = weights.size
* assert pos0.size == size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert delta_pos0.size == size
* assert bins > 1
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
83: assert delta_pos0.size == size
/* "splitBBox.pyx":83
* cdef long size = weights.size
* assert pos0.size == size
* assert delta_pos0.size == size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert bins > 1
*
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
84: assert bins > 1
/* "splitBBox.pyx":84
* assert pos0.size == size
* assert delta_pos0.size == size
* assert bins > 1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!(__pyx_v_bins > 1))) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
85:
86: cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
/* "splitBBox.pyx":86
* assert bins > 1
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cdata = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cdata.diminfo[0].strides = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdata.diminfo[0].shape = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_6 = 0;
__pyx_v_cdata = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":86
* assert bins > 1
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
*/
__pyx_k_tuple_1 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_1);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float64));
PyTuple_SET_ITEM(__pyx_k_tuple_1, 0, ((PyObject *)__pyx_n_s__float64));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float64));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1));
87: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
/* "splitBBox.pyx":87
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
*/
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0_inf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0_inf.diminfo[0].strides = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_inf.diminfo[0].shape = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_7 = 0;
__pyx_v_cpos0_inf = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":87
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
*/
__pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_2);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
88: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
/* "splitBBox.pyx":88
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup
*/
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0_sup = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0_sup.diminfo[0].strides = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_sup.diminfo[0].shape = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_8 = 0;
__pyx_v_cpos0_sup = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":88
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup
*/
__pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_3);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, ((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
89: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
90: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup
91:
92: cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")
/* "splitBBox.pyx":92
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
*/
__pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_10 = ((PyArrayObject *)__pyx_t_9);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_outData = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outData.diminfo[0].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outData.diminfo[0].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_10 = 0;
__pyx_v_outData = ((PyArrayObject *)__pyx_t_9);
__pyx_t_9 = 0;
93: cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
/* "splitBBox.pyx":93
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32")
*/
__pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
__pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_9));
if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_outCount = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outCount.diminfo[0].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outCount.diminfo[0].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_11 = 0;
__pyx_v_outCount = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
94: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
/* "splitBBox.pyx":94
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32")
* cdef float deltaR, deltaL, deltaA
*/
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_outMerge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outMerge.diminfo[0].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMerge.diminfo[0].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_12 = 0;
__pyx_v_outMerge = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
95: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32")
/* "splitBBox.pyx":95
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef float deltaR, deltaL, deltaA
* cdef float pos0_min, pos0_max, pos0_maxin, pos1_min, pos1_max, pos1_maxin, min0, max0, fbin0_min, fbin0_max
*/
__pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_13 = ((PyArrayObject *)__pyx_t_9);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_outPos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outPos.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outPos.diminfo[0].strides = __pyx_pybuffernd_outPos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outPos.diminfo[0].shape = __pyx_pybuffernd_outPos.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_13 = 0;
__pyx_v_outPos = ((PyArrayObject *)__pyx_t_9);
__pyx_t_9 = 0;
96: cdef float deltaR, deltaL, deltaA
97: cdef float pos0_min, pos0_max, pos0_maxin, pos1_min, pos1_max, pos1_maxin, min0, max0, fbin0_min, fbin0_max
98: cdef int checkpos1 = 0
/* "splitBBox.pyx":98
* cdef float deltaR, deltaL, deltaA
* cdef float pos0_min, pos0_max, pos0_maxin, pos1_min, pos1_max, pos1_maxin, min0, max0, fbin0_min, fbin0_max
* cdef int checkpos1 = 0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* if pos0Range is not None and len(pos0Range) > 1:
*/
__pyx_v_checkpos1 = 0;
99:
100: if pos0Range is not None and len(pos0Range) > 1:
/* "splitBBox.pyx":100
* cdef int checkpos1 = 0
*
* if pos0Range is not None and len(pos0Range) > 1: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0_min = min(pos0Range)
* if pos0_min <
0.0:
*/
__pyx_t_5 = (__pyx_v_pos0Range != Py_None);
if (__pyx_t_5) {
__pyx_t_14 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_15 = (__pyx_t_14 > 1);
__pyx_t_16 = __pyx_t_15;
} else {
__pyx_t_16 = __pyx_t_5;
}
if (__pyx_t_16) {
101: pos0_min = min(pos0Range)
/* "splitBBox.pyx":101
*
* if pos0Range is not None and len(pos0Range) > 1:
* pos0_min = min(pos0Range) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if pos0_min <
0.0:
* pos0_min = 0.0
*/
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_pos0Range);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_pos0Range);
__Pyx_GIVEREF(__pyx_v_pos0Range);
__pyx_t_3 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos0_min = __pyx_t_17;
102: if pos0_min < 0.0:
/* "splitBBox.pyx":102
* if pos0Range is not None and len(pos0Range) > 1:
* pos0_min = min(pos0Range)
* if pos0_min <
0.0: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0_min = 0.0
* pos0_maxin = max(pos0Range)
*/
__pyx_t_16 = (__pyx_v_pos0_min <
0.0);
if (__pyx_t_16) {
103: pos0_min = 0.0
/* "splitBBox.pyx":103
* pos0_min = min(pos0Range)
* if pos0_min <
0.0:
* pos0_min = 0.0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0_maxin = max(pos0Range)
* else:
*/
__pyx_v_pos0_min = 0.0;
goto __pyx_L7;
}
__pyx_L7:;
104: pos0_maxin = max(pos0Range)
/* "splitBBox.pyx":104
* if pos0_min <
0.0:
* pos0_min = 0.0
* pos0_maxin = max(pos0Range) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* else:
* pos0_min = cpos0_inf.min()
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_pos0Range);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos0Range);
__Pyx_GIVEREF(__pyx_v_pos0Range);
__pyx_t_9 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_pos0_maxin = __pyx_t_17;
goto __pyx_L6;
}
/*else*/ {
105: else:
106: pos0_min = cpos0_inf.min()
/* "splitBBox.pyx":106
* pos0_maxin = max(pos0Range)
* else:
* pos0_min = cpos0_inf.min() # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0_maxin = cpos0_sup.max()
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*/
__pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_inf), __pyx_n_s__min); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos0_min = __pyx_t_17;
107: pos0_maxin = cpos0_sup.max()
/* "splitBBox.pyx":107
* else:
* pos0_min = cpos0_inf.min()
* pos0_maxin = cpos0_sup.max() # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
*/
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_sup), __pyx_n_s__max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_pos0_maxin = __pyx_t_17;
}
__pyx_L6:;
108: pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
/* "splitBBox.pyx":108
* pos0_min = cpos0_inf.min()
* pos0_maxin = cpos0_sup.max()
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* if pos1Range is not None and len(pos1Range) > 1:
*/
__pyx_t_9 = PyFloat_FromDouble(__pyx_v_pos0_maxin); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__finfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__eps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyNumber_Add(__pyx_int_1, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Multiply(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos0_max = __pyx_t_17;
109:
110: if pos1Range is not None and len(pos1Range) > 1:
/* "splitBBox.pyx":110
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
* if pos1Range is not None and len(pos1Range) > 1: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert pos1.size == size
* assert delta_pos1.size == size
*/
__pyx_t_16 = (__pyx_v_pos1Range != Py_None);
if (__pyx_t_16) {
__pyx_t_14 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_5 = (__pyx_t_14 > 1);
__pyx_t_15 = __pyx_t_5;
} else {
__pyx_t_15 = __pyx_t_16;
}
if (__pyx_t_15) {
111: assert pos1.size == size
/* "splitBBox.pyx":111
*
* if pos1Range is not None and len(pos1Range) > 1:
* assert pos1.size == size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert delta_pos1.size == size
* checkpos1 = 1
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_3 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_15 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_15)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
112: assert delta_pos1.size == size
/* "splitBBox.pyx":112
* if pos1Range is not None and len(pos1Range) > 1:
* assert pos1.size == size
* assert delta_pos1.size == size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* checkpos1 = 1
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_9 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_15 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_15)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
113: checkpos1 = 1
/* "splitBBox.pyx":113
* assert pos1.size == size
* assert delta_pos1.size == size
* checkpos1 = 1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
*/
__pyx_v_checkpos1 = 1;
114: cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
/* "splitBBox.pyx":114
* assert delta_pos1.size == size
* checkpos1 = 1
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
* pos1_min = min(pos1Range)
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_18 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
if (unlikely(__pyx_t_19 <
0)) {
PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer, (PyObject*)__pyx_v_cpos1_inf, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
__Pyx_RaiseBufferFallbackError();
} else {
PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
}
}
__pyx_pybuffernd_cpos1_inf.diminfo[0].strides = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_inf.diminfo[0].shape = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.shape[0];
if (unlikely(__pyx_t_19 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_18 = 0;
__pyx_v_cpos1_inf = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":114
* assert delta_pos1.size == size
* checkpos1 = 1
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
* pos1_min = min(pos1Range)
*/
__pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_4);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
115: cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
/* "splitBBox.pyx":115
* checkpos1 = 1
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range)
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_23 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
if (unlikely(__pyx_t_19 <
0)) {
PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer, (PyObject*)__pyx_v_cpos1_sup, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
__Pyx_RaiseBufferFallbackError();
} else {
PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
}
}
__pyx_pybuffernd_cpos1_sup.diminfo[0].strides = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_sup.diminfo[0].shape = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.shape[0];
if (unlikely(__pyx_t_19 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_23 = 0;
__pyx_v_cpos1_sup = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":115
* checkpos1 = 1
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range)
*/
__pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_5);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
116: pos1_min = min(pos1Range)
/* "splitBBox.pyx":116
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
* pos1_min = min(pos1Range) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1_maxin = max(pos1Range)
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_pos1Range);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos1Range);
__Pyx_GIVEREF(__pyx_v_pos1Range);
__pyx_t_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos1_min = __pyx_t_17;
117: pos1_maxin = max(pos1Range)
/* "splitBBox.pyx":117
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_pos1Range);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos1Range);
__Pyx_GIVEREF(__pyx_v_pos1Range);
__pyx_t_3 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos1_maxin = __pyx_t_17;
118: pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
/* "splitBBox.pyx":118
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range)
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* cdef float dpos = (pos0_max - pos0_min) / (<
float > (bins))
*/
__pyx_t_3 = PyFloat_FromDouble(__pyx_v_pos1_maxin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__finfo); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__eps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyNumber_Add(__pyx_int_1, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos1_max = __pyx_t_17;
goto __pyx_L8;
}
__pyx_L8:;
119:
120: cdef float dpos = (pos0_max - pos0_min) / (< float > (bins))
/* "splitBBox.pyx":120
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
* cdef float dpos = (pos0_max - pos0_min) / (<
float > (bins)) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef long bin = 0
* cdef long i, idx
*/
__pyx_v_dpos = ((__pyx_v_pos0_max - __pyx_v_pos0_min) / ((float)__pyx_v_bins));
121: cdef long bin = 0
/* "splitBBox.pyx":121
*
* cdef float dpos = (pos0_max - pos0_min) / (<
float > (bins))
* cdef long bin = 0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef long i, idx
* cdef long bin0_max, bin0_min
*/
__pyx_v_bin = 0;
122: cdef long i, idx
123: cdef long bin0_max, bin0_min
124: cdef double epsilon = 1e-10
/* "splitBBox.pyx":124
* cdef long i, idx
* cdef long bin0_max, bin0_min
* cdef double epsilon = 1e-10 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* with nogil:
*/
__pyx_v_epsilon = 1e-10;
125:
126: with nogil:
/* "splitBBox.pyx":126
* cdef double epsilon = 1e-10
*
* with nogil: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(bins):
* outPos[i] = pos0_min + (0.5 +<
float > i) * dpos
*/
{
#ifdef WITH_THREAD
PyThreadState *_save = NULL;
#endif
Py_UNBLOCK_THREADS
/*try:*/ {
/* "splitBBox.pyx":126
* cdef double epsilon = 1e-10
*
* with nogil: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(bins):
* outPos[i] = pos0_min + (0.5 +<
float > i) * dpos
*/
/*finally:*/ {
Py_BLOCK_THREADS
}
}
127: for i in range(bins):
/* "splitBBox.pyx":127
*
* with nogil:
* for i in range(bins): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outPos[i] = pos0_min + (0.5 +<
float > i) * dpos
*
*/
__pyx_t_2 = __pyx_v_bins;
for (__pyx_t_24 = 0; __pyx_t_24 <
__pyx_t_2; __pyx_t_24+=1) {
__pyx_v_i = __pyx_t_24;
128: outPos[i] = pos0_min + (0.5 +< float > i) * dpos
/* "splitBBox.pyx":128
* with nogil:
* for i in range(bins):
* outPos[i] = pos0_min + (0.5 +<
float > i) * dpos # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* for idx in range(size):
*/
__pyx_t_25 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outPos.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_outPos.diminfo[0].strides) = (__pyx_v_pos0_min + ((0.5 + ((float)__pyx_v_i)) * __pyx_v_dpos));
}
129:
130: for idx in range(size):
/* "splitBBox.pyx":130
* outPos[i] = pos0_min + (0.5 +<
float > i) * dpos
*
* for idx in range(size): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* data = <
double > cdata[idx]
* min0 = cpos0_inf[idx]
*/
__pyx_t_2 = __pyx_v_size;
for (__pyx_t_24 = 0; __pyx_t_24 <
__pyx_t_2; __pyx_t_24+=1) {
__pyx_v_idx = __pyx_t_24;
131: data = < double > cdata[idx]
/* "splitBBox.pyx":131
*
* for idx in range(size):
* data = <
double > cdata[idx] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx]
*/
__pyx_t_26 = __pyx_v_idx;
__pyx_v_data = ((double)(*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_cdata.diminfo[0].strides)));
132: min0 = cpos0_inf[idx]
/* "splitBBox.pyx":132
* for idx in range(size):
* data = <
double > cdata[idx]
* min0 = cpos0_inf[idx] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* max0 = cpos0_sup[idx]
* if checkpos1:
*/
__pyx_t_27 = __pyx_v_idx;
__pyx_v_min0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_cpos0_inf.diminfo[0].strides));
133: max0 = cpos0_sup[idx]
/* "splitBBox.pyx":133
* data = <
double > cdata[idx]
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if checkpos1:
* if (cpos1_inf[idx] <
pos1_min) or (cpos1_sup[idx] > pos1_max):
*/
__pyx_t_28 = __pyx_v_idx;
__pyx_v_max0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_cpos0_sup.diminfo[0].strides));
134: if checkpos1:
/* "splitBBox.pyx":134
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx]
* if checkpos1: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if (cpos1_inf[idx] <
pos1_min) or (cpos1_sup[idx] > pos1_max):
* continue
*/
if (__pyx_v_checkpos1) {
135: if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max):
/* "splitBBox.pyx":135
* max0 = cpos0_sup[idx]
* if checkpos1:
* if (cpos1_inf[idx] <
pos1_min) or (cpos1_sup[idx] > pos1_max): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* continue
*
*/
__pyx_t_29 = __pyx_v_idx;
__pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_cpos1_inf.diminfo[0].strides)) <
__pyx_v_pos1_min);
if (!__pyx_t_15) {
__pyx_t_30 = __pyx_v_idx;
__pyx_t_16 = ((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_cpos1_sup.diminfo[0].strides)) > __pyx_v_pos1_max);
__pyx_t_5 = __pyx_t_16;
} else {
__pyx_t_5 = __pyx_t_15;
}
if (__pyx_t_5) {
136: continue
/* "splitBBox.pyx":136
* if checkpos1:
* if (cpos1_inf[idx] <
pos1_min) or (cpos1_sup[idx] > pos1_max):
* continue # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* fbin0_min = getBinNr(min0, pos0_min, dpos)
*/
goto __pyx_L14_continue;
goto __pyx_L17;
}
__pyx_L17:;
goto __pyx_L16;
}
__pyx_L16:;
137:
138: fbin0_min = getBinNr(min0, pos0_min, dpos)
/* "splitBBox.pyx":138
* continue
*
* fbin0_min = getBinNr(min0, pos0_min, dpos) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* fbin0_max = getBinNr(max0, pos0_min, dpos)
* bin0_min = <
long > floor(fbin0_min)
*/
__pyx_v_fbin0_min = __pyx_f_9splitBBox_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_dpos);
139: fbin0_max = getBinNr(max0, pos0_min, dpos)
/* "splitBBox.pyx":139
*
* fbin0_min = getBinNr(min0, pos0_min, dpos)
* fbin0_max = getBinNr(max0, pos0_min, dpos) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* bin0_min = <
long > floor(fbin0_min)
* bin0_max = <
long > floor(fbin0_max)
*/
__pyx_v_fbin0_max = __pyx_f_9splitBBox_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_dpos);
140: bin0_min = < long > floor(fbin0_min)
/* "splitBBox.pyx":140
* fbin0_min = getBinNr(min0, pos0_min, dpos)
* fbin0_max = getBinNr(max0, pos0_min, dpos)
* bin0_min = <
long > floor(fbin0_min) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* bin0_max = <
long > floor(fbin0_max)
*
*/
__pyx_v_bin0_min = ((long)floor(__pyx_v_fbin0_min));
141: bin0_max = < long > floor(fbin0_max)
/* "splitBBox.pyx":141
* fbin0_max = getBinNr(max0, pos0_min, dpos)
* bin0_min = <
long > floor(fbin0_min)
* bin0_max = <
long > floor(fbin0_max) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* if bin0_min == bin0_max:
*/
__pyx_v_bin0_max = ((long)floor(__pyx_v_fbin0_max));
142:
143: if bin0_min == bin0_max:
/* "splitBBox.pyx":143
* bin0_max = <
long > floor(fbin0_max)
*
* if bin0_min == bin0_max: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* #All pixel is within a single bin
* outCount[bin0_min] += <
double > 1.0
*/
__pyx_t_5 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
if (__pyx_t_5) {
144: #All pixel is within a single bin
145: outCount[bin0_min] += < double > 1.0
/* "splitBBox.pyx":145
* if bin0_min == bin0_max:
* #All pixel is within a single bin
* outCount[bin0_min] += <
double > 1.0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min] += <
double > data
*
*/
__pyx_t_31 = __pyx_v_bin0_min;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_outCount.diminfo[0].strides) += ((double)1.0);
146: outData[bin0_min] += < double > data
/* "splitBBox.pyx":146
* #All pixel is within a single bin
* outCount[bin0_min] += <
double > 1.0
* outData[bin0_min] += <
double > data # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* else: #we have pixel spliting.
*/
__pyx_t_32 = __pyx_v_bin0_min;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_outData.diminfo[0].strides) += ((double)__pyx_v_data);
goto __pyx_L18;
}
/*else*/ {
147:
148: else: #we have pixel spliting.
149: deltaA = 1.0 / (fbin0_max - fbin0_min)
/* "splitBBox.pyx":149
*
* else: #we have pixel spliting.
* deltaA = 1.0 / (fbin0_max - fbin0_min) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* deltaL = <
float > (bin0_min + 1) - fbin0_min
*/
__pyx_v_deltaA = (1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min));
150:
151: deltaL = < float > (bin0_min + 1) - fbin0_min
/* "splitBBox.pyx":151
* deltaA = 1.0 / (fbin0_max - fbin0_min)
*
* deltaL = <
float > (bin0_min + 1) - fbin0_min # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltaR = fbin0_max - (<
float > bin0_max)
*
*/
__pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);
152: deltaR = fbin0_max - (< float > bin0_max)
/* "splitBBox.pyx":152
*
* deltaL = <
float > (bin0_min + 1) - fbin0_min
* deltaR = fbin0_max - (<
float > bin0_max) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* outCount[bin0_min] += <
double > deltaA * deltaL
*/
__pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));
153:
154: outCount[bin0_min] += < double > deltaA * deltaL
/* "splitBBox.pyx":154
* deltaR = fbin0_max - (<
float > bin0_max)
*
* outCount[bin0_min] += <
double > deltaA * deltaL # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min] += <
double > data * deltaA * deltaL
*
*/
__pyx_t_33 = __pyx_v_bin0_min;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_outCount.diminfo[0].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaL);
155: outData[bin0_min] += < double > data * deltaA * deltaL
/* "splitBBox.pyx":155
*
* outCount[bin0_min] += <
double > deltaA * deltaL
* outData[bin0_min] += <
double > data * deltaA * deltaL # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* outCount[bin0_max] += <
double > deltaA * deltaR
*/
__pyx_t_34 = __pyx_v_bin0_min;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_outData.diminfo[0].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL);
156:
157: outCount[bin0_max] += < double > deltaA * deltaR
/* "splitBBox.pyx":157
* outData[bin0_min] += <
double > data * deltaA * deltaL
*
* outCount[bin0_max] += <
double > deltaA * deltaR # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_max] += <
double > data * deltaA * deltaR
*
*/
__pyx_t_35 = __pyx_v_bin0_max;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_outCount.diminfo[0].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaR);
158: outData[bin0_max] += < double > data * deltaA * deltaR
/* "splitBBox.pyx":158
*
* outCount[bin0_max] += <
double > deltaA * deltaR
* outData[bin0_max] += <
double > data * deltaA * deltaR # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* if bin0_min + 1 <
bin0_max:
*/
__pyx_t_36 = __pyx_v_bin0_max;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_outData.diminfo[0].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR);
159:
160: if bin0_min + 1 < bin0_max:
/* "splitBBox.pyx":160
* outData[bin0_max] += <
double > data * deltaA * deltaR
*
* if bin0_min + 1 <
bin0_max: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(bin0_min + 1, bin0_max):
* outCount[i] += <
double > deltaA
*/
__pyx_t_5 = ((__pyx_v_bin0_min + 1) <
__pyx_v_bin0_max);
if (__pyx_t_5) {
161: for i in range(bin0_min + 1, bin0_max):
/* "splitBBox.pyx":161
*
* if bin0_min + 1 <
bin0_max:
* for i in range(bin0_min + 1, bin0_max): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outCount[i] += <
double > deltaA
* outData[i] += data * <
double > deltaA
*/
__pyx_t_37 = __pyx_v_bin0_max;
for (__pyx_t_38 = (__pyx_v_bin0_min + 1); __pyx_t_38 <
__pyx_t_37; __pyx_t_38+=1) {
__pyx_v_i = __pyx_t_38;
162: outCount[i] += < double > deltaA
/* "splitBBox.pyx":162
* if bin0_min + 1 <
bin0_max:
* for i in range(bin0_min + 1, bin0_max):
* outCount[i] += <
double > deltaA # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[i] += data * <
double > deltaA
*
*/
__pyx_t_39 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_outCount.diminfo[0].strides) += ((double)__pyx_v_deltaA);
163: outData[i] += data * < double > deltaA
/* "splitBBox.pyx":163
* for i in range(bin0_min + 1, bin0_max):
* outCount[i] += <
double > deltaA
* outData[i] += data * <
double > deltaA # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* for i in range(bins):
*/
__pyx_t_40 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_outData.diminfo[0].strides) += (__pyx_v_data * ((double)__pyx_v_deltaA));
}
goto __pyx_L19;
}
__pyx_L19:;
}
__pyx_L18:;
__pyx_L14_continue:;
}
164:
165: for i in range(bins):
/* "splitBBox.pyx":165
* outData[i] += data * <
double > deltaA
*
* for i in range(bins): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if outCount[i] > epsilon:
* outMerge[i] = <
float > (outData[i] / outCount[i])
*/
__pyx_t_2 = __pyx_v_bins;
for (__pyx_t_24 = 0; __pyx_t_24 <
__pyx_t_2; __pyx_t_24+=1) {
__pyx_v_i = __pyx_t_24;
166: if outCount[i] > epsilon:
/* "splitBBox.pyx":166
*
* for i in range(bins):
* if outCount[i] > epsilon: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outMerge[i] = <
float > (outData[i] / outCount[i])
* else:
*/
__pyx_t_37 = __pyx_v_i;
__pyx_t_5 = ((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_outCount.diminfo[0].strides)) > __pyx_v_epsilon);
if (__pyx_t_5) {
167: outMerge[i] = < float > (outData[i] / outCount[i])
/* "splitBBox.pyx":167
* for i in range(bins):
* if outCount[i] > epsilon:
* outMerge[i] = <
float > (outData[i] / outCount[i]) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* else:
* outMerge[i] = dummy
*/
__pyx_t_38 = __pyx_v_i;
__pyx_t_41 = __pyx_v_i;
__pyx_t_42 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_outMerge.diminfo[0].strides) = ((float)((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_outData.diminfo[0].strides)) / (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_outCount.diminfo[0].strides))));
goto __pyx_L24;
}
/*else*/ {
168: else:
169: outMerge[i] = dummy
/* "splitBBox.pyx":169
* outMerge[i] = <
float > (outData[i] / outCount[i])
* else:
* outMerge[i] = dummy # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* return outPos, outMerge, outData, outCount
*/
__pyx_t_43 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_outMerge.diminfo[0].strides) = __pyx_v_dummy;
}
__pyx_L24:;
}
}
170:
171: return outPos, outMerge, outData, outCount
/* "splitBBox.pyx":171
* outMerge[i] = dummy
*
* return outPos, outMerge, outData, outCount # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_outPos));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_outPos));
__Pyx_GIVEREF(((PyObject *)__pyx_v_outPos));
__Pyx_INCREF(((PyObject *)__pyx_v_outMerge));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_outMerge));
__Pyx_GIVEREF(((PyObject *)__pyx_v_outMerge));
__Pyx_INCREF(((PyObject *)__pyx_v_outData));
PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_outData));
__Pyx_GIVEREF(((PyObject *)__pyx_v_outData));
__Pyx_INCREF(((PyObject *)__pyx_v_outCount));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_outCount));
__Pyx_GIVEREF(((PyObject *)__pyx_v_outCount));
__pyx_r = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_9);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("splitBBox.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_cdata);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0_inf);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0_sup);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1_inf);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1_sup);
__Pyx_XDECREF((PyObject *)__pyx_v_outData);
__Pyx_XDECREF((PyObject *)__pyx_v_outCount);
__Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
__Pyx_XDECREF((PyObject *)__pyx_v_outPos);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
172:
173:
174:
175:
176: @cython.cdivision(True)
177: @cython.boundscheck(False)
178: @cython.wraparound(False)
179: def histoBBox2d(numpy.ndarray weights not None,
/* "splitBBox.pyx":179
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def histoBBox2d(numpy.ndarray weights not None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
*/
static PyObject *__pyx_pf_9splitBBox_1histoBBox2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9splitBBox_1histoBBox2d[] = "\n Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights\n \n Splitting is done on the pixel's bounding box like fit2D\n \n\n @param weights: array with intensities\n @param pos0: 1D array with pos0: tth or q_vect\n @param delta_pos0: 1D array with delta pos0: max center-corner distance\n @param pos1: 1D array with pos1: chi\n @param delta_pos1: 1D array with max pos1: max center-corner distance, unused ! \n @param bins: number of output bins (tth=100, chi=36 by default)\n @param pos0Range: minimum and maximum of the 2th range\n @param pos1Range: minimum and maximum of the chi range\n @param dummy: value for bins without pixels \n @return 2theta, I, weighted histogram, unweighted histogram\n @return I, edges0, edges1, weighted histogram(2D), unweighted histogram (2D)\n ";
static PyMethodDef __pyx_mdef_9splitBBox_1histoBBox2d = {__Pyx_NAMESTR("histoBBox2d"), (PyCFunction)__pyx_pf_9splitBBox_1histoBBox2d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9splitBBox_1histoBBox2d)};
static PyObject *__pyx_pf_9splitBBox_1histoBBox2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *__pyx_v_weights = 0;
PyArrayObject *__pyx_v_pos0 = 0;
PyArrayObject *__pyx_v_delta_pos0 = 0;
PyArrayObject *__pyx_v_pos1 = 0;
PyArrayObject *__pyx_v_delta_pos1 = 0;
PyObject *__pyx_v_bins = 0;
PyObject *__pyx_v_pos0Range = 0;
PyObject *__pyx_v_pos1Range = 0;
float __pyx_v_dummy;
long __pyx_v_bins0;
long __pyx_v_bins1;
long __pyx_v_i;
long __pyx_v_j;
long __pyx_v_idx;
long __pyx_v_size;
PyArrayObject *__pyx_v_cdata = 0;
PyArrayObject *__pyx_v_cpos0 = 0;
PyArrayObject *__pyx_v_cdelta_pos0 = 0;
PyArrayObject *__pyx_v_cpos0_inf = 0;
PyArrayObject *__pyx_v_cpos0_sup = 0;
PyArrayObject *__pyx_v_cpos1 = 0;
PyArrayObject *__pyx_v_cdelta_pos1 = 0;
PyArrayObject *__pyx_v_cpos1_inf = 0;
PyArrayObject *__pyx_v_cpos1_sup = 0;
PyArrayObject *__pyx_v_outData = 0;
PyArrayObject *__pyx_v_outCount = 0;
PyArrayObject *__pyx_v_outMerge = 0;
PyArrayObject *__pyx_v_edges0 = 0;
PyArrayObject *__pyx_v_edges1 = 0;
float __pyx_v_min0;
float __pyx_v_max0;
float __pyx_v_min1;
float __pyx_v_max1;
float __pyx_v_deltaR;
float __pyx_v_deltaL;
float __pyx_v_deltaU;
float __pyx_v_deltaD;
float __pyx_v_deltaA;
float __pyx_v_tmp;
float __pyx_v_pos0_min;
float __pyx_v_pos0_max;
float __pyx_v_pos1_min;
float __pyx_v_pos1_max;
float __pyx_v_pos0_maxin;
float __pyx_v_pos1_maxin;
float __pyx_v_fbin0_min;
float __pyx_v_fbin0_max;
float __pyx_v_fbin1_min;
float __pyx_v_fbin1_max;
long __pyx_v_bin0_max;
long __pyx_v_bin0_min;
long __pyx_v_bin1_max;
long __pyx_v_bin1_min;
double __pyx_v_epsilon;
double __pyx_v_data;
float __pyx_v_dpos0;
float __pyx_v_dpos1;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
__Pyx_Buffer __pyx_pybuffer_outMerge;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_inf;
__Pyx_Buffer __pyx_pybuffer_cpos0_inf;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cdelta_pos1;
__Pyx_Buffer __pyx_pybuffer_cdelta_pos1;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cdelta_pos0;
__Pyx_Buffer __pyx_pybuffer_cdelta_pos0;
__Pyx_LocalBuf_ND __pyx_pybuffernd_edges0;
__Pyx_Buffer __pyx_pybuffer_edges0;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_sup;
__Pyx_Buffer __pyx_pybuffer_cpos0_sup;
__Pyx_LocalBuf_ND __pyx_pybuffernd_edges1;
__Pyx_Buffer __pyx_pybuffer_edges1;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_sup;
__Pyx_Buffer __pyx_pybuffer_cpos1_sup;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
__Pyx_Buffer __pyx_pybuffer_outCount;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cdata;
__Pyx_Buffer __pyx_pybuffer_cdata;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1;
__Pyx_Buffer __pyx_pybuffer_cpos1;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0;
__Pyx_Buffer __pyx_pybuffer_cpos0;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
__Pyx_Buffer __pyx_pybuffer_outData;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_inf;
__Pyx_Buffer __pyx_pybuffer_cpos1_inf;
PyObject *__pyx_r = NULL;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__weights,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__dummy,0};
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("histoBBox2d");
__pyx_self = __pyx_self;
{
PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
/* "splitBBox.pyx":179
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def histoBBox2d(numpy.ndarray weights not None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
*/
__pyx_k_tuple_27 = PyTuple_New(57); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_27);
__Pyx_INCREF(((PyObject *)__pyx_n_s__weights));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_n_s__weights));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__weights));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 1, ((PyObject *)__pyx_n_s__pos0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__delta_pos0));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 2, ((PyObject *)__pyx_n_s__delta_pos0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_pos0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 3, ((PyObject *)__pyx_n_s__pos1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__delta_pos1));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 4, ((PyObject *)__pyx_n_s__delta_pos1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__delta_pos1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bins));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 5, ((PyObject *)__pyx_n_s__bins));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0Range));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 6, ((PyObject *)__pyx_n_s__pos0Range));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0Range));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1Range));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 7, ((PyObject *)__pyx_n_s__pos1Range));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1Range));
__Pyx_INCREF(((PyObject *)__pyx_n_s__dummy));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 8, ((PyObject *)__pyx_n_s__dummy));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__dummy));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bins0));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 9, ((PyObject *)__pyx_n_s__bins0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bins1));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 10, ((PyObject *)__pyx_n_s__bins1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bins1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__i));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 11, ((PyObject *)__pyx_n_s__i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__j));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 12, ((PyObject *)__pyx_n_s__j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__idx));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 13, ((PyObject *)__pyx_n_s__idx));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__idx));
__Pyx_INCREF(((PyObject *)__pyx_n_s__size));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 14, ((PyObject *)__pyx_n_s__size));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__size));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cdata));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 15, ((PyObject *)__pyx_n_s__cdata));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdata));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 16, ((PyObject *)__pyx_n_s__cpos0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cdelta_pos0));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 17, ((PyObject *)__pyx_n_s__cdelta_pos0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdelta_pos0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_inf));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 18, ((PyObject *)__pyx_n_s__cpos0_inf));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_inf));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos0_sup));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 19, ((PyObject *)__pyx_n_s__cpos0_sup));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos0_sup));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 20, ((PyObject *)__pyx_n_s__cpos1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cdelta_pos1));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 21, ((PyObject *)__pyx_n_s__cdelta_pos1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cdelta_pos1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_inf));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 22, ((PyObject *)__pyx_n_s__cpos1_inf));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_inf));
__Pyx_INCREF(((PyObject *)__pyx_n_s__cpos1_sup));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 23, ((PyObject *)__pyx_n_s__cpos1_sup));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpos1_sup));
__Pyx_INCREF(((PyObject *)__pyx_n_s__outData));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 24, ((PyObject *)__pyx_n_s__outData));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__outData));
__Pyx_INCREF(((PyObject *)__pyx_n_s__outCount));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 25, ((PyObject *)__pyx_n_s__outCount));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__outCount));
__Pyx_INCREF(((PyObject *)__pyx_n_s__outMerge));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 26, ((PyObject *)__pyx_n_s__outMerge));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__outMerge));
__Pyx_INCREF(((PyObject *)__pyx_n_s__edges0));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 27, ((PyObject *)__pyx_n_s__edges0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__edges0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__edges1));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 28, ((PyObject *)__pyx_n_s__edges1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__edges1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__min0));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 29, ((PyObject *)__pyx_n_s__min0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__min0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__max0));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 30, ((PyObject *)__pyx_n_s__max0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__max0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__min1));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 31, ((PyObject *)__pyx_n_s__min1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__min1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__max1));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 32, ((PyObject *)__pyx_n_s__max1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__max1));
__Pyx_INCREF(((PyObject *)__pyx_n_s__deltaR));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 33, ((PyObject *)__pyx_n_s__deltaR));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaR));
__Pyx_INCREF(((PyObject *)__pyx_n_s__deltaL));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 34, ((PyObject *)__pyx_n_s__deltaL));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaL));
__Pyx_INCREF(((PyObject *)__pyx_n_s__deltaU));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 35, ((PyObject *)__pyx_n_s__deltaU));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaU));
__Pyx_INCREF(((PyObject *)__pyx_n_s__deltaD));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 36, ((PyObject *)__pyx_n_s__deltaD));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaD));
__Pyx_INCREF(((PyObject *)__pyx_n_s__deltaA));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 37, ((PyObject *)__pyx_n_s__deltaA));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltaA));
__Pyx_INCREF(((PyObject *)__pyx_n_s__tmp));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 38, ((PyObject *)__pyx_n_s__tmp));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__tmp));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_min));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 39, ((PyObject *)__pyx_n_s__pos0_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_max));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 40, ((PyObject *)__pyx_n_s__pos0_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_min));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 41, ((PyObject *)__pyx_n_s__pos1_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_max));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 42, ((PyObject *)__pyx_n_s__pos1_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos0_maxin));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 43, ((PyObject *)__pyx_n_s__pos0_maxin));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos0_maxin));
__Pyx_INCREF(((PyObject *)__pyx_n_s__pos1_maxin));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 44, ((PyObject *)__pyx_n_s__pos1_maxin));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__pos1_maxin));
__Pyx_INCREF(((PyObject *)__pyx_n_s__fbin0_min));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 45, ((PyObject *)__pyx_n_s__fbin0_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__fbin0_max));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 46, ((PyObject *)__pyx_n_s__fbin0_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin0_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__fbin1_min));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 47, ((PyObject *)__pyx_n_s__fbin1_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin1_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__fbin1_max));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 48, ((PyObject *)__pyx_n_s__fbin1_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__fbin1_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_max));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 49, ((PyObject *)__pyx_n_s__bin0_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bin0_min));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 50, ((PyObject *)__pyx_n_s__bin0_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin0_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bin1_max));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 51, ((PyObject *)__pyx_n_s__bin1_max));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin1_max));
__Pyx_INCREF(((PyObject *)__pyx_n_s__bin1_min));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 52, ((PyObject *)__pyx_n_s__bin1_min));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bin1_min));
__Pyx_INCREF(((PyObject *)__pyx_n_s__epsilon));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 53, ((PyObject *)__pyx_n_s__epsilon));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__epsilon));
__Pyx_INCREF(((PyObject *)__pyx_n_s__data));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 54, ((PyObject *)__pyx_n_s__data));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__data));
__Pyx_INCREF(((PyObject *)__pyx_n_s__dpos0));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 55, ((PyObject *)__pyx_n_s__dpos0));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__dpos0));
__Pyx_INCREF(((PyObject *)__pyx_n_s__dpos1));
PyTuple_SET_ITEM(__pyx_k_tuple_27, 56, ((PyObject *)__pyx_n_s__dpos1));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__dpos1));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));
/* "splitBBox.pyx":179
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def histoBBox2d(numpy.ndarray weights not None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9splitBBox_1histoBBox2d, NULL, __pyx_n_s__splitBBox); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__histoBBox2d, __pyx_t_1) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
180: numpy.ndarray pos0 not None,
181: numpy.ndarray delta_pos0 not None,
182: numpy.ndarray pos1 not None,
183: numpy.ndarray delta_pos1 not None,
184: bins=(100, 36),
/* "splitBBox.pyx":184
* numpy.ndarray pos1 not None,
* numpy.ndarray delta_pos1 not None,
* bins=(100, 36), # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0Range=None,
* pos1Range=None,
*/
values[5] = ((PyObject *)__pyx_k_tuple_6);
/* "splitBBox.pyx":184
* numpy.ndarray pos1 not None,
* numpy.ndarray delta_pos1 not None,
* bins=(100, 36), # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0Range=None,
* pos1Range=None,
*/
__pyx_k_tuple_6 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_6);
__Pyx_INCREF(__pyx_int_100);
PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, __pyx_int_100);
__Pyx_GIVEREF(__pyx_int_100);
__Pyx_INCREF(__pyx_int_36);
PyTuple_SET_ITEM(__pyx_k_tuple_6, 1, __pyx_int_36);
__Pyx_GIVEREF(__pyx_int_36);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
185: pos0Range=None,
/* "splitBBox.pyx":185
* numpy.ndarray delta_pos1 not None,
* bins=(100, 36),
* pos0Range=None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1Range=None,
* float dummy=0.0):
*/
values[6] = ((PyObject *)Py_None);
186: pos1Range=None,
/* "splitBBox.pyx":186
* bins=(100, 36),
* pos0Range=None,
* pos1Range=None, # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* float dummy=0.0):
* """
*/
values[7] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights);
if (likely(values[0])) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0);
if (likely(values[1])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0);
if (likely(values[2])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
if (likely(values[3])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1);
if (likely(values[4])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 5:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
if (value) { values[5] = value; kw_args--; }
}
case 6:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
if (value) { values[6] = value; kw_args--; }
}
case 7:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
if (value) { values[7] = value; kw_args--; }
}
case 8:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
if (value) { values[8] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histoBBox2d") <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_v_weights = ((PyArrayObject *)values[0]);
__pyx_v_pos0 = ((PyArrayObject *)values[1]);
__pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
__pyx_v_pos1 = ((PyArrayObject *)values[3]);
__pyx_v_delta_pos1 = ((PyArrayObject *)values[4]);
__pyx_v_bins = values[5];
__pyx_v_pos0Range = values[6];
__pyx_v_pos1Range = values[7];
if (values[8]) {
__pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
187: float dummy=0.0):
/* "splitBBox.pyx":187
* pos0Range=None,
* pos1Range=None,
* float dummy=0.0): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* """
* Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights
*/
__pyx_v_dummy = ((float)0.0);
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_weights = ((PyArrayObject *)values[0]);
__pyx_v_pos0 = ((PyArrayObject *)values[1]);
__pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
__pyx_v_pos1 = ((PyArrayObject *)values[3]);
__pyx_v_delta_pos1 = ((PyArrayObject *)values[4]);
__pyx_v_bins = values[5];
__pyx_v_pos0Range = values[6];
__pyx_v_pos1Range = values[7];
if (values[8]) {
__pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_dummy = ((float)0.0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("splitBBox.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_pybuffer_cdata.pybuffer.buf = NULL;
__pyx_pybuffer_cdata.refcount = 0;
__pyx_pybuffernd_cdata.data = NULL;
__pyx_pybuffernd_cdata.rcbuffer = &__pyx_pybuffer_cdata;
__pyx_pybuffer_cpos0.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0.refcount = 0;
__pyx_pybuffernd_cpos0.data = NULL;
__pyx_pybuffernd_cpos0.rcbuffer = &__pyx_pybuffer_cpos0;
__pyx_pybuffer_cdelta_pos0.pybuffer.buf = NULL;
__pyx_pybuffer_cdelta_pos0.refcount = 0;
__pyx_pybuffernd_cdelta_pos0.data = NULL;
__pyx_pybuffernd_cdelta_pos0.rcbuffer = &__pyx_pybuffer_cdelta_pos0;
__pyx_pybuffer_cpos0_inf.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0_inf.refcount = 0;
__pyx_pybuffernd_cpos0_inf.data = NULL;
__pyx_pybuffernd_cpos0_inf.rcbuffer = &__pyx_pybuffer_cpos0_inf;
__pyx_pybuffer_cpos0_sup.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0_sup.refcount = 0;
__pyx_pybuffernd_cpos0_sup.data = NULL;
__pyx_pybuffernd_cpos0_sup.rcbuffer = &__pyx_pybuffer_cpos0_sup;
__pyx_pybuffer_cpos1.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1.refcount = 0;
__pyx_pybuffernd_cpos1.data = NULL;
__pyx_pybuffernd_cpos1.rcbuffer = &__pyx_pybuffer_cpos1;
__pyx_pybuffer_cdelta_pos1.pybuffer.buf = NULL;
__pyx_pybuffer_cdelta_pos1.refcount = 0;
__pyx_pybuffernd_cdelta_pos1.data = NULL;
__pyx_pybuffernd_cdelta_pos1.rcbuffer = &__pyx_pybuffer_cdelta_pos1;
__pyx_pybuffer_cpos1_inf.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1_inf.refcount = 0;
__pyx_pybuffernd_cpos1_inf.data = NULL;
__pyx_pybuffernd_cpos1_inf.rcbuffer = &__pyx_pybuffer_cpos1_inf;
__pyx_pybuffer_cpos1_sup.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1_sup.refcount = 0;
__pyx_pybuffernd_cpos1_sup.data = NULL;
__pyx_pybuffernd_cpos1_sup.rcbuffer = &__pyx_pybuffer_cpos1_sup;
__pyx_pybuffer_outData.pybuffer.buf = NULL;
__pyx_pybuffer_outData.refcount = 0;
__pyx_pybuffernd_outData.data = NULL;
__pyx_pybuffernd_outData.rcbuffer = &__pyx_pybuffer_outData;
__pyx_pybuffer_outCount.pybuffer.buf = NULL;
__pyx_pybuffer_outCount.refcount = 0;
__pyx_pybuffernd_outCount.data = NULL;
__pyx_pybuffernd_outCount.rcbuffer = &__pyx_pybuffer_outCount;
__pyx_pybuffer_outMerge.pybuffer.buf = NULL;
__pyx_pybuffer_outMerge.refcount = 0;
__pyx_pybuffernd_outMerge.data = NULL;
__pyx_pybuffernd_outMerge.rcbuffer = &__pyx_pybuffer_outMerge;
__pyx_pybuffer_edges0.pybuffer.buf = NULL;
__pyx_pybuffer_edges0.refcount = 0;
__pyx_pybuffernd_edges0.data = NULL;
__pyx_pybuffernd_edges0.rcbuffer = &__pyx_pybuffer_edges0;
__pyx_pybuffer_edges1.pybuffer.buf = NULL;
__pyx_pybuffer_edges1.refcount = 0;
__pyx_pybuffernd_edges1.data = NULL;
__pyx_pybuffernd_edges1.rcbuffer = &__pyx_pybuffer_edges1;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 0, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos0), __pyx_ptype_5numpy_ndarray, 0, "pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_delta_pos0), __pyx_ptype_5numpy_ndarray, 0, "delta_pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos1), __pyx_ptype_5numpy_ndarray, 0, "pos1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_delta_pos1), __pyx_ptype_5numpy_ndarray, 0, "delta_pos1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
188: """
189: Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights
190:
191: Splitting is done on the pixel's bounding box like fit2D
192:
193:
194: @param weights: array with intensities
195: @param pos0: 1D array with pos0: tth or q_vect
196: @param delta_pos0: 1D array with delta pos0: max center-corner distance
197: @param pos1: 1D array with pos1: chi
198: @param delta_pos1: 1D array with max pos1: max center-corner distance, unused !
199: @param bins: number of output bins (tth=100, chi=36 by default)
200: @param pos0Range: minimum and maximum of the 2th range
201: @param pos1Range: minimum and maximum of the chi range
202: @param dummy: value for bins without pixels
203: @return 2theta, I, weighted histogram, unweighted histogram
204: @return I, edges0, edges1, weighted histogram(2D), unweighted histogram (2D)
205: """
206:
207: cdef long bins0, bins1, i, j, idx
208: cdef long size = weights.size
/* "splitBBox.pyx":208
*
* cdef long bins0, bins1, i, j, idx
* cdef long size = weights.size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert pos0.size == size
* assert pos1.size == size
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_size = __pyx_t_2;
209: assert pos0.size == size
/* "splitBBox.pyx":209
* cdef long bins0, bins1, i, j, idx
* cdef long size = weights.size
* assert pos0.size == size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert pos1.size == size
* assert delta_pos0.size == size
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
210: assert pos1.size == size
/* "splitBBox.pyx":210
* cdef long size = weights.size
* assert pos0.size == size
* assert pos1.size == size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert delta_pos0.size == size
* assert delta_pos1.size == size
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos1), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
211: assert delta_pos0.size == size
/* "splitBBox.pyx":211
* assert pos0.size == size
* assert pos1.size == size
* assert delta_pos0.size == size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert delta_pos1.size == size
* try:
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
212: assert delta_pos1.size == size
/* "splitBBox.pyx":212
* assert pos1.size == size
* assert delta_pos0.size == size
* assert delta_pos1.size == size # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* try:
* bins0, bins1 = tuple(bins)
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos1), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
213: try:
/* "splitBBox.pyx":213
* assert delta_pos0.size == size
* assert delta_pos1.size == size
* try: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* bins0, bins1 = tuple(bins)
* except:
*/
{
__Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
/*try:*/ {
214: bins0, bins1 = tuple(bins)
/* "splitBBox.pyx":214
* assert delta_pos1.size == size
* try:
* bins0, bins1 = tuple(bins) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* except:
* bins0 = bins1 = <
long > bins
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_bins);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bins);
__Pyx_GIVEREF(__pyx_v_bins);
__pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (likely(PyTuple_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
}
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__Pyx_UnpackTupleError(__pyx_t_3, 2);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
}
__pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_4); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_bins0 = __pyx_t_2;
__pyx_v_bins1 = __pyx_t_9;
}
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L13_try_end;
__pyx_L6_error:;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
215: except:
/* "splitBBox.pyx":215
* try:
* bins0, bins1 = tuple(bins)
* except: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* bins0 = bins1 = <
long > bins
* if bins0 <
= 0:
*/
/*except:*/ {
__Pyx_AddTraceback("splitBBox.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_1) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_1);
216: bins0 = bins1 = < long > bins
/* "splitBBox.pyx":216
* bins0, bins1 = tuple(bins)
* except:
* bins0 = bins1 = <
long > bins # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if bins0 <
= 0:
* bins0 = 1
*/
__pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_v_bins); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
__pyx_v_bins0 = ((long)__pyx_t_9);
__pyx_v_bins1 = ((long)__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L7_exception_handled;
}
__pyx_L8_except_error:;
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
goto __pyx_L1_error;
__pyx_L7_exception_handled:;
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
__pyx_L13_try_end:;
}
217: if bins0 <= 0:
/* "splitBBox.pyx":217
* except:
* bins0 = bins1 = <
long > bins
* if bins0 <
= 0: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* bins0 = 1
* if bins1 <
= 0:
*/
__pyx_t_5 = (__pyx_v_bins0 <
= 0);
if (__pyx_t_5) {
218: bins0 = 1
/* "splitBBox.pyx":218
* bins0 = bins1 = <
long > bins
* if bins0 <
= 0:
* bins0 = 1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if bins1 <
= 0:
* bins1 = 1
*/
__pyx_v_bins0 = 1;
goto __pyx_L16;
}
__pyx_L16:;
219: if bins1 <= 0:
/* "splitBBox.pyx":219
* if bins0 <
= 0:
* bins0 = 1
* if bins1 <
= 0: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* bins1 = 1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
*/
__pyx_t_5 = (__pyx_v_bins1 <
= 0);
if (__pyx_t_5) {
220: bins1 = 1
/* "splitBBox.pyx":220
* bins0 = 1
* if bins1 <
= 0:
* bins1 = 1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
*/
__pyx_v_bins1 = 1;
goto __pyx_L17;
}
__pyx_L17:;
221: cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
/* "splitBBox.pyx":221
* if bins1 <
= 0:
* bins1 = 1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_10 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cdata = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cdata.diminfo[0].strides = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdata.diminfo[0].shape = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_10 = 0;
__pyx_v_cdata = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":221
* if bins1 <
= 0:
* bins1 = 1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
*/
__pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_7);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float64));
PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_n_s__float64));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float64));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
222: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
/* "splitBBox.pyx":222
* bins1 = 1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
*/
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0.diminfo[0].strides = __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0.diminfo[0].shape = __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_11 = 0;
__pyx_v_cpos0 = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "splitBBox.pyx":222
* bins1 = 1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
*/
__pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_8);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
223: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
/* "splitBBox.pyx":223
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_12 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cdelta_pos0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cdelta_pos0.diminfo[0].strides = __pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdelta_pos0.diminfo[0].shape = __pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_12 = 0;
__pyx_v_cdelta_pos0 = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":223
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
*/
__pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_9);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
224: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
/* "splitBBox.pyx":224
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
*/
__pyx_t_4 = PyNumber_Subtract(((PyObject *)__pyx_v_cpos0), ((PyObject *)__pyx_v_cdelta_pos0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_13 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0_inf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0_inf.diminfo[0].strides = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_inf.diminfo[0].shape = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_13 = 0;
__pyx_v_cpos0_inf = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
225: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
/* "splitBBox.pyx":225
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
*/
__pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_cpos0), ((PyObject *)__pyx_v_cdelta_pos0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0_sup = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0_sup.diminfo[0].strides = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_sup.diminfo[0].shape = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_14 = 0;
__pyx_v_cpos0_sup = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
226: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
/* "splitBBox.pyx":226
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
*/
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos1), __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos1.diminfo[0].strides = __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1.diminfo[0].shape = __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_15 = 0;
__pyx_v_cpos1 = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "splitBBox.pyx":226
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
*/
__pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_10);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
227: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
/* "splitBBox.pyx":227
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos1), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_16 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cdelta_pos1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cdelta_pos1.diminfo[0].strides = __pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdelta_pos1.diminfo[0].shape = __pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_16 = 0;
__pyx_v_cdelta_pos1 = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":227
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
*/
__pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_11);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));
228: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
/* "splitBBox.pyx":228
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
*/
__pyx_t_4 = PyNumber_Subtract(((PyObject *)__pyx_v_cpos1), ((PyObject *)__pyx_v_cdelta_pos1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos1_inf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos1_inf.diminfo[0].strides = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_inf.diminfo[0].shape = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_17 = 0;
__pyx_v_cpos1_inf = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
229: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
/* "splitBBox.pyx":229
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
*/
__pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_cpos1), ((PyObject *)__pyx_v_cdelta_pos1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_18 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos1_sup = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos1_sup.diminfo[0].strides = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_sup.diminfo[0].shape = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_18 = 0;
__pyx_v_cpos1_sup = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
230: cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
/* "splitBBox.pyx":230
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_19));
__Pyx_GIVEREF(((PyObject *)__pyx_t_19));
__pyx_t_19 = 0;
__pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_19));
if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
__pyx_v_outData = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outData.diminfo[0].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outData.diminfo[0].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outData.diminfo[1].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outData.diminfo[1].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[1];
}
}
__pyx_t_20 = 0;
__pyx_v_outData = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
231: cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
/* "splitBBox.pyx":231
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_19 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
__pyx_v_outCount = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outCount.diminfo[0].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outCount.diminfo[0].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outCount.diminfo[1].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outCount.diminfo[1].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[1];
}
}
__pyx_t_21 = 0;
__pyx_v_outCount = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
232: cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
/* "splitBBox.pyx":232
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32")
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_19));
__Pyx_GIVEREF(((PyObject *)__pyx_t_19));
__pyx_t_19 = 0;
__pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_19));
if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_22 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
__pyx_v_outMerge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outMerge.diminfo[0].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMerge.diminfo[0].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outMerge.diminfo[1].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outMerge.diminfo[1].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[1];
}
}
__pyx_t_22 = 0;
__pyx_v_outMerge = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
233: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
/* "splitBBox.pyx":233
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32")
*
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_19 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_23 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_edges0.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_edges0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_edges0.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_edges0.diminfo[0].strides = __pyx_pybuffernd_edges0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_edges0.diminfo[0].shape = __pyx_pybuffernd_edges0.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_23 = 0;
__pyx_v_edges0 = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
234: cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32")
/* "splitBBox.pyx":234
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32") # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* cdef float min0, max0, min1, max1, deltaR, deltaL, deltaU, deltaD, deltaA, tmp
*/
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_19 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_24 = ((PyArrayObject *)__pyx_t_19);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_edges1.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_edges1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_edges1.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_edges1.diminfo[0].strides = __pyx_pybuffernd_edges1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_edges1.diminfo[0].shape = __pyx_pybuffernd_edges1.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_24 = 0;
__pyx_v_edges1 = ((PyArrayObject *)__pyx_t_19);
__pyx_t_19 = 0;
235:
236: cdef float min0, max0, min1, max1, deltaR, deltaL, deltaU, deltaD, deltaA, tmp
237: cdef float pos0_min, pos0_max, pos1_min, pos1_max, pos0_maxin, pos1_maxin
238: cdef float fbin0_min, fbin0_max, fbin1_min, fbin1_max
239: cdef long bin0_max, bin0_min, bin1_max, bin1_min
240: cdef double epsilon = 1e-10
/* "splitBBox.pyx":240
* cdef float fbin0_min, fbin0_max, fbin1_min, fbin1_max
* cdef long bin0_max, bin0_min, bin1_max, bin1_min
* cdef double epsilon = 1e-10 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef double data
*
*/
__pyx_v_epsilon = 1e-10;
241: cdef double data
242:
243: if pos0Range is not None and len(pos0Range) == 2:
/* "splitBBox.pyx":243
* cdef double data
*
* if pos0Range is not None and len(pos0Range) == 2: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0_min = min(pos0Range)
* pos0_maxin = max(pos0Range)
*/
__pyx_t_5 = (__pyx_v_pos0Range != Py_None);
if (__pyx_t_5) {
__pyx_t_25 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_26 = (__pyx_t_25 == 2);
__pyx_t_27 = __pyx_t_26;
} else {
__pyx_t_27 = __pyx_t_5;
}
if (__pyx_t_27) {
244: pos0_min = min(pos0Range)
/* "splitBBox.pyx":244
*
* if pos0Range is not None and len(pos0Range) == 2:
* pos0_min = min(pos0Range) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0_maxin = max(pos0Range)
* else:
*/
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_INCREF(__pyx_v_pos0Range);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_pos0Range);
__Pyx_GIVEREF(__pyx_v_pos0Range);
__pyx_t_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos0_min = __pyx_t_28;
245: pos0_maxin = max(pos0Range)
/* "splitBBox.pyx":245
* if pos0Range is not None and len(pos0Range) == 2:
* pos0_min = min(pos0Range)
* pos0_maxin = max(pos0Range) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* else:
* pos0_min = max(0.0, cpos0_inf.min())
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_pos0Range);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos0Range);
__Pyx_GIVEREF(__pyx_v_pos0Range);
__pyx_t_19 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos0_maxin = __pyx_t_28;
goto __pyx_L18;
}
/*else*/ {
246: else:
247: pos0_min = max(0.0, cpos0_inf.min())
/* "splitBBox.pyx":247
* pos0_maxin = max(pos0Range)
* else:
* pos0_min = max(0.0, cpos0_inf.min()) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0_maxin = cpos0_sup.max()
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*/
__pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_inf), __pyx_n_s__min); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_29 = 0.0;
__pyx_t_3 = PyFloat_FromDouble(__pyx_t_29); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_27 <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_27) {
__Pyx_INCREF(__pyx_t_1);
__pyx_t_19 = __pyx_t_1;
} else {
__pyx_t_4 = PyFloat_FromDouble(__pyx_t_29); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_19 = __pyx_t_4;
__pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos0_min = __pyx_t_28;
248: pos0_maxin = cpos0_sup.max()
/* "splitBBox.pyx":248
* else:
* pos0_min = max(0.0, cpos0_inf.min())
* pos0_maxin = cpos0_sup.max() # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
*/
__pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_sup), __pyx_n_s__max); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos0_maxin = __pyx_t_28;
}
__pyx_L18:;
249: pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
/* "splitBBox.pyx":249
* pos0_min = max(0.0, cpos0_inf.min())
* pos0_maxin = cpos0_sup.max()
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* if pos1Range is not None and len(pos1Range) > 1:
*/
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_pos0_maxin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_19 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__finfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__float32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__pyx_t_19 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__eps); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Add(__pyx_int_1, __pyx_t_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos0_max = __pyx_t_28;
250:
251: if pos1Range is not None and len(pos1Range) > 1:
/* "splitBBox.pyx":251
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
* if pos1Range is not None and len(pos1Range) > 1: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range)
*/
__pyx_t_27 = (__pyx_v_pos1Range != Py_None);
if (__pyx_t_27) {
__pyx_t_25 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_5 = (__pyx_t_25 > 1);
__pyx_t_26 = __pyx_t_5;
} else {
__pyx_t_26 = __pyx_t_27;
}
if (__pyx_t_26) {
252: pos1_min = min(pos1Range)
/* "splitBBox.pyx":252
*
* if pos1Range is not None and len(pos1Range) > 1:
* pos1_min = min(pos1Range) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1_maxin = max(pos1Range)
* else:
*/
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_INCREF(__pyx_v_pos1Range);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_pos1Range);
__Pyx_GIVEREF(__pyx_v_pos1Range);
__pyx_t_3 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos1_min = __pyx_t_28;
253: pos1_maxin = max(pos1Range)
/* "splitBBox.pyx":253
* if pos1Range is not None and len(pos1Range) > 1:
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* else:
* tmp = cdelta_pos1.min()
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_pos1Range);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos1Range);
__Pyx_GIVEREF(__pyx_v_pos1Range);
__pyx_t_19 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos1_maxin = __pyx_t_28;
goto __pyx_L19;
}
/*else*/ {
254: else:
255: tmp = cdelta_pos1.min()
/* "splitBBox.pyx":255
* pos1_maxin = max(pos1Range)
* else:
* tmp = cdelta_pos1.min() # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1_min = cpos1.min() - tmp
* pos1_maxin = cpos1.max() + tmp
*/
__pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_cdelta_pos1), __pyx_n_s__min); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_3 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_tmp = __pyx_t_28;
256: pos1_min = cpos1.min() - tmp
/* "splitBBox.pyx":256
* else:
* tmp = cdelta_pos1.min()
* pos1_min = cpos1.min() - tmp # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1_maxin = cpos1.max() + tmp
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*/
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos1), __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_19 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyFloat_FromDouble(__pyx_v_tmp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyNumber_Subtract(__pyx_t_19, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos1_min = __pyx_t_28;
257: pos1_maxin = cpos1.max() + tmp
/* "splitBBox.pyx":257
* tmp = cdelta_pos1.min()
* pos1_min = cpos1.min() - tmp
* pos1_maxin = cpos1.max() + tmp # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos1), __pyx_n_s__max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_tmp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_19 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos1_maxin = __pyx_t_28;
}
__pyx_L19:;
258: pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
/* "splitBBox.pyx":258
* pos1_min = cpos1.min() - tmp
* pos1_maxin = cpos1.max() + tmp
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* cdef float dpos0 = (pos0_max - pos0_min) / (<
float > (bins0))
*/
__pyx_t_19 = PyFloat_FromDouble(__pyx_v_pos1_maxin); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__eps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyNumber_Add(__pyx_int_1, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyNumber_Multiply(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos1_max = __pyx_t_28;
259:
260: cdef float dpos0 = (pos0_max - pos0_min) / (< float > (bins0))
/* "splitBBox.pyx":260
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
* cdef float dpos0 = (pos0_max - pos0_min) / (<
float > (bins0)) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef float dpos1 = (pos1_max - pos1_min) / (<
float > (bins1))
*
*/
__pyx_v_dpos0 = ((__pyx_v_pos0_max - __pyx_v_pos0_min) / ((float)__pyx_v_bins0));
261: cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1))
/* "splitBBox.pyx":261
*
* cdef float dpos0 = (pos0_max - pos0_min) / (<
float > (bins0))
* cdef float dpos1 = (pos1_max - pos1_min) / (<
float > (bins1)) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* with nogil:
*/
__pyx_v_dpos1 = ((__pyx_v_pos1_max - __pyx_v_pos1_min) / ((float)__pyx_v_bins1));
262:
263: with nogil:
/* "splitBBox.pyx":263
* cdef float dpos1 = (pos1_max - pos1_min) / (<
float > (bins1))
*
* with nogil: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(bins0):
* edges0[i] = pos0_min + (0.5 +<
double > i) * dpos0
*/
{
#ifdef WITH_THREAD
PyThreadState *_save = NULL;
#endif
Py_UNBLOCK_THREADS
/*try:*/ {
/* "splitBBox.pyx":263
* cdef float dpos1 = (pos1_max - pos1_min) / (<
float > (bins1))
*
* with nogil: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(bins0):
* edges0[i] = pos0_min + (0.5 +<
double > i) * dpos0
*/
/*finally:*/ {
Py_BLOCK_THREADS
}
}
264: for i in range(bins0):
/* "splitBBox.pyx":264
*
* with nogil:
* for i in range(bins0): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* edges0[i] = pos0_min + (0.5 +<
double > i) * dpos0
* for i in range(bins1):
*/
__pyx_t_9 = __pyx_v_bins0;
for (__pyx_t_2 = 0; __pyx_t_2 <
__pyx_t_9; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
265: edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
/* "splitBBox.pyx":265
* with nogil:
* for i in range(bins0):
* edges0[i] = pos0_min + (0.5 +<
double > i) * dpos0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(bins1):
* edges1[i] = pos1_min + (0.5 +<
double > i) * dpos1
*/
__pyx_t_30 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_edges0.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_edges0.diminfo[0].strides) = (__pyx_v_pos0_min + ((0.5 + ((double)__pyx_v_i)) * __pyx_v_dpos0));
}
266: for i in range(bins1):
/* "splitBBox.pyx":266
* for i in range(bins0):
* edges0[i] = pos0_min + (0.5 +<
double > i) * dpos0
* for i in range(bins1): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* edges1[i] = pos1_min + (0.5 +<
double > i) * dpos1
*
*/
__pyx_t_9 = __pyx_v_bins1;
for (__pyx_t_2 = 0; __pyx_t_2 <
__pyx_t_9; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
267: edges1[i] = pos1_min + (0.5 +< double > i) * dpos1
/* "splitBBox.pyx":267
* edges0[i] = pos0_min + (0.5 +<
double > i) * dpos0
* for i in range(bins1):
* edges1[i] = pos1_min + (0.5 +<
double > i) * dpos1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* for idx in range(size):
*/
__pyx_t_31 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_edges1.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_edges1.diminfo[0].strides) = (__pyx_v_pos1_min + ((0.5 + ((double)__pyx_v_i)) * __pyx_v_dpos1));
}
268:
269: for idx in range(size):
/* "splitBBox.pyx":269
* edges1[i] = pos1_min + (0.5 +<
double > i) * dpos1
*
* for idx in range(size): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* data = cdata[idx]
* min0 = cpos0_inf[idx]
*/
__pyx_t_9 = __pyx_v_size;
for (__pyx_t_2 = 0; __pyx_t_2 <
__pyx_t_9; __pyx_t_2+=1) {
__pyx_v_idx = __pyx_t_2;
270: data = cdata[idx]
/* "splitBBox.pyx":270
*
* for idx in range(size):
* data = cdata[idx] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx]
*/
__pyx_t_32 = __pyx_v_idx;
__pyx_v_data = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_cdata.diminfo[0].strides));
271: min0 = cpos0_inf[idx]
/* "splitBBox.pyx":271
* for idx in range(size):
* data = cdata[idx]
* min0 = cpos0_inf[idx] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* max0 = cpos0_sup[idx]
* min1 = cpos1_inf[idx]
*/
__pyx_t_33 = __pyx_v_idx;
__pyx_v_min0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_cpos0_inf.diminfo[0].strides));
272: max0 = cpos0_sup[idx]
/* "splitBBox.pyx":272
* data = cdata[idx]
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* min1 = cpos1_inf[idx]
* max1 = cpos1_sup[idx]
*/
__pyx_t_34 = __pyx_v_idx;
__pyx_v_max0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_cpos0_sup.diminfo[0].strides));
273: min1 = cpos1_inf[idx]
/* "splitBBox.pyx":273
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx]
* min1 = cpos1_inf[idx] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* max1 = cpos1_sup[idx]
*
*/
__pyx_t_35 = __pyx_v_idx;
__pyx_v_min1 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_cpos1_inf.diminfo[0].strides));
274: max1 = cpos1_sup[idx]
/* "splitBBox.pyx":274
* max0 = cpos0_sup[idx]
* min1 = cpos1_inf[idx]
* max1 = cpos1_sup[idx] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* if (max0 <
pos0_min) or (max1 <
pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :
*/
__pyx_t_36 = __pyx_v_idx;
__pyx_v_max1 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_cpos1_sup.diminfo[0].strides));
275:
276: if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :
/* "splitBBox.pyx":276
* max1 = cpos1_sup[idx]
*
* if (max0 <
pos0_min) or (max1 <
pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) : # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* continue
*
*/
__pyx_t_26 = (__pyx_v_max0 <
__pyx_v_pos0_min);
if (!__pyx_t_26) {
__pyx_t_27 = (__pyx_v_max1 <
__pyx_v_pos1_min);
if (!__pyx_t_27) {
__pyx_t_5 = (__pyx_v_min0 > __pyx_v_pos0_maxin);
if (!__pyx_t_5) {
__pyx_t_37 = (__pyx_v_min1 > __pyx_v_pos1_maxin);
__pyx_t_38 = __pyx_t_37;
} else {
__pyx_t_38 = __pyx_t_5;
}
__pyx_t_5 = __pyx_t_38;
} else {
__pyx_t_5 = __pyx_t_27;
}
__pyx_t_27 = __pyx_t_5;
} else {
__pyx_t_27 = __pyx_t_26;
}
if (__pyx_t_27) {
277: continue
/* "splitBBox.pyx":277
*
* if (max0 <
pos0_min) or (max1 <
pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :
* continue # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* if min0 <
pos0_min:
*/
goto __pyx_L27_continue;
goto __pyx_L29;
}
__pyx_L29:;
278:
279: if min0 < pos0_min:
/* "splitBBox.pyx":279
* continue
*
* if min0 <
pos0_min: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* min0 = pos0_min
* if min1 <
pos1_min:
*/
__pyx_t_27 = (__pyx_v_min0 <
__pyx_v_pos0_min);
if (__pyx_t_27) {
280: min0 = pos0_min
/* "splitBBox.pyx":280
*
* if min0 <
pos0_min:
* min0 = pos0_min # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if min1 <
pos1_min:
* min1 = pos1_min
*/
__pyx_v_min0 = __pyx_v_pos0_min;
goto __pyx_L30;
}
__pyx_L30:;
281: if min1 < pos1_min:
/* "splitBBox.pyx":281
* if min0 <
pos0_min:
* min0 = pos0_min
* if min1 <
pos1_min: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* min1 = pos1_min
* if max0 > pos0_maxin:
*/
__pyx_t_27 = (__pyx_v_min1 <
__pyx_v_pos1_min);
if (__pyx_t_27) {
282: min1 = pos1_min
/* "splitBBox.pyx":282
* min0 = pos0_min
* if min1 <
pos1_min:
* min1 = pos1_min # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if max0 > pos0_maxin:
* max0 = pos0_maxin
*/
__pyx_v_min1 = __pyx_v_pos1_min;
goto __pyx_L31;
}
__pyx_L31:;
283: if max0 > pos0_maxin:
/* "splitBBox.pyx":283
* if min1 <
pos1_min:
* min1 = pos1_min
* if max0 > pos0_maxin: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* max0 = pos0_maxin
* if max1 > pos1_maxin:
*/
__pyx_t_27 = (__pyx_v_max0 > __pyx_v_pos0_maxin);
if (__pyx_t_27) {
284: max0 = pos0_maxin
/* "splitBBox.pyx":284
* min1 = pos1_min
* if max0 > pos0_maxin:
* max0 = pos0_maxin # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if max1 > pos1_maxin:
* max1 = pos1_maxin
*/
__pyx_v_max0 = __pyx_v_pos0_maxin;
goto __pyx_L32;
}
__pyx_L32:;
285: if max1 > pos1_maxin:
/* "splitBBox.pyx":285
* if max0 > pos0_maxin:
* max0 = pos0_maxin
* if max1 > pos1_maxin: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* max1 = pos1_maxin
*
*/
__pyx_t_27 = (__pyx_v_max1 > __pyx_v_pos1_maxin);
if (__pyx_t_27) {
286: max1 = pos1_maxin
/* "splitBBox.pyx":286
* max0 = pos0_maxin
* if max1 > pos1_maxin:
* max1 = pos1_maxin # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
*
*/
__pyx_v_max1 = __pyx_v_pos1_maxin;
goto __pyx_L33;
}
__pyx_L33:;
287:
288:
289: fbin0_min = getBinNr(min0, pos0_min, dpos0)
/* "splitBBox.pyx":289
*
*
* fbin0_min = getBinNr(min0, pos0_min, dpos0) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* fbin0_max = getBinNr(max0, pos0_min, dpos0)
* fbin1_min = getBinNr(min1, pos1_min, dpos1)
*/
__pyx_v_fbin0_min = __pyx_f_9splitBBox_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_dpos0);
290: fbin0_max = getBinNr(max0, pos0_min, dpos0)
/* "splitBBox.pyx":290
*
* fbin0_min = getBinNr(min0, pos0_min, dpos0)
* fbin0_max = getBinNr(max0, pos0_min, dpos0) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* fbin1_min = getBinNr(min1, pos1_min, dpos1)
* fbin1_max = getBinNr(max1, pos1_min, dpos1)
*/
__pyx_v_fbin0_max = __pyx_f_9splitBBox_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_dpos0);
291: fbin1_min = getBinNr(min1, pos1_min, dpos1)
/* "splitBBox.pyx":291
* fbin0_min = getBinNr(min0, pos0_min, dpos0)
* fbin0_max = getBinNr(max0, pos0_min, dpos0)
* fbin1_min = getBinNr(min1, pos1_min, dpos1) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* fbin1_max = getBinNr(max1, pos1_min, dpos1)
*
*/
__pyx_v_fbin1_min = __pyx_f_9splitBBox_getBinNr(__pyx_v_min1, __pyx_v_pos1_min, __pyx_v_dpos1);
292: fbin1_max = getBinNr(max1, pos1_min, dpos1)
/* "splitBBox.pyx":292
* fbin0_max = getBinNr(max0, pos0_min, dpos0)
* fbin1_min = getBinNr(min1, pos1_min, dpos1)
* fbin1_max = getBinNr(max1, pos1_min, dpos1) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* bin0_min = <
long > floor(fbin0_min)
*/
__pyx_v_fbin1_max = __pyx_f_9splitBBox_getBinNr(__pyx_v_max1, __pyx_v_pos1_min, __pyx_v_dpos1);
293:
294: bin0_min = < long > floor(fbin0_min)
/* "splitBBox.pyx":294
* fbin1_max = getBinNr(max1, pos1_min, dpos1)
*
* bin0_min = <
long > floor(fbin0_min) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* bin0_max = <
long > floor(fbin0_max)
* bin1_min = <
long > floor(fbin1_min)
*/
__pyx_v_bin0_min = ((long)floor(__pyx_v_fbin0_min));
295: bin0_max = < long > floor(fbin0_max)
/* "splitBBox.pyx":295
*
* bin0_min = <
long > floor(fbin0_min)
* bin0_max = <
long > floor(fbin0_max) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* bin1_min = <
long > floor(fbin1_min)
* bin1_max = <
long > floor(fbin1_max)
*/
__pyx_v_bin0_max = ((long)floor(__pyx_v_fbin0_max));
296: bin1_min = < long > floor(fbin1_min)
/* "splitBBox.pyx":296
* bin0_min = <
long > floor(fbin0_min)
* bin0_max = <
long > floor(fbin0_max)
* bin1_min = <
long > floor(fbin1_min) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* bin1_max = <
long > floor(fbin1_max)
*
*/
__pyx_v_bin1_min = ((long)floor(__pyx_v_fbin1_min));
297: bin1_max = < long > floor(fbin1_max)
/* "splitBBox.pyx":297
* bin0_max = <
long > floor(fbin0_max)
* bin1_min = <
long > floor(fbin1_min)
* bin1_max = <
long > floor(fbin1_max) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
*
*/
__pyx_v_bin1_max = ((long)floor(__pyx_v_fbin1_max));
298:
299:
300: if bin0_min == bin0_max:
/* "splitBBox.pyx":300
*
*
* if bin0_min == bin0_max: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if bin1_min == bin1_max:
* #All pixel is within a single bin
*/
__pyx_t_27 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
if (__pyx_t_27) {
301: if bin1_min == bin1_max:
/* "splitBBox.pyx":301
*
* if bin0_min == bin0_max:
* if bin1_min == bin1_max: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* #All pixel is within a single bin
* outCount[bin0_min, bin1_min] += 1.0
*/
__pyx_t_27 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
if (__pyx_t_27) {
302: #All pixel is within a single bin
303: outCount[bin0_min, bin1_min] += 1.0
/* "splitBBox.pyx":303
* if bin1_min == bin1_max:
* #All pixel is within a single bin
* outCount[bin0_min, bin1_min] += 1.0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min, bin1_min] += data
* else:
*/
__pyx_t_39 = __pyx_v_bin0_min;
__pyx_t_40 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_outCount.diminfo[1].strides) += 1.0;
304: outData[bin0_min, bin1_min] += data
/* "splitBBox.pyx":304
* #All pixel is within a single bin
* outCount[bin0_min, bin1_min] += 1.0
* outData[bin0_min, bin1_min] += data # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* else:
* #spread on more than 2 bins
*/
__pyx_t_41 = __pyx_v_bin0_min;
__pyx_t_42 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_outData.diminfo[1].strides) += __pyx_v_data;
goto __pyx_L35;
}
/*else*/ {
305: else:
306: #spread on more than 2 bins
307: deltaD = (< float > (bin1_min + 1)) - fbin1_min
/* "splitBBox.pyx":307
* else:
* #spread on more than 2 bins
* deltaD = (<
float > (bin1_min + 1)) - fbin1_min # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltaU = fbin1_max - (<
double > bin1_max)
* deltaA = 1.0 / (fbin1_max - fbin1_min)
*/
__pyx_v_deltaD = (((float)(__pyx_v_bin1_min + 1)) - __pyx_v_fbin1_min);
308: deltaU = fbin1_max - (< double > bin1_max)
/* "splitBBox.pyx":308
* #spread on more than 2 bins
* deltaD = (<
float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (<
double > bin1_max) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltaA = 1.0 / (fbin1_max - fbin1_min)
*
*/
__pyx_v_deltaU = (__pyx_v_fbin1_max - ((double)__pyx_v_bin1_max));
309: deltaA = 1.0 / (fbin1_max - fbin1_min)
/* "splitBBox.pyx":309
* deltaD = (<
float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (<
double > bin1_max)
* deltaA = 1.0 / (fbin1_max - fbin1_min) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaD
*/
__pyx_v_deltaA = (1.0 / (__pyx_v_fbin1_max - __pyx_v_fbin1_min));
310:
311: outCount[bin0_min, bin1_min] += < double > deltaA * deltaD
/* "splitBBox.pyx":311
* deltaA = 1.0 / (fbin1_max - fbin1_min)
*
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaD # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min, bin1_min] += data * deltaA * deltaD
*
*/
__pyx_t_43 = __pyx_v_bin0_min;
__pyx_t_44 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaD);
312: outData[bin0_min, bin1_min] += data * deltaA * deltaD
/* "splitBBox.pyx":312
*
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaD
* outData[bin0_min, bin1_min] += data * deltaA * deltaD # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* outCount[bin0_min, bin1_max] += <
double > deltaA * deltaU
*/
__pyx_t_45 = __pyx_v_bin0_min;
__pyx_t_46 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaD);
313:
314: outCount[bin0_min, bin1_max] += < double > deltaA * deltaU
/* "splitBBox.pyx":314
* outData[bin0_min, bin1_min] += data * deltaA * deltaD
*
* outCount[bin0_min, bin1_max] += <
double > deltaA * deltaU # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min, bin1_max] += data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max):
*/
__pyx_t_47 = __pyx_v_bin0_min;
__pyx_t_48 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaU);
315: outData[bin0_min, bin1_max] += data * deltaA * deltaU
/* "splitBBox.pyx":315
*
* outCount[bin0_min, bin1_max] += <
double > deltaA * deltaU
* outData[bin0_min, bin1_max] += data * deltaA * deltaU # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += <
double > deltaA
*/
__pyx_t_49 = __pyx_v_bin0_min;
__pyx_t_50 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaU);
316: for j in range(bin1_min + 1, bin1_max):
/* "splitBBox.pyx":316
* outCount[bin0_min, bin1_max] += <
double > deltaA * deltaU
* outData[bin0_min, bin1_max] += data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outCount[bin0_min, j] += <
double > deltaA
* outData[bin0_min, j] += data * deltaA
*/
__pyx_t_51 = __pyx_v_bin1_max;
for (__pyx_t_52 = (__pyx_v_bin1_min + 1); __pyx_t_52 <
__pyx_t_51; __pyx_t_52+=1) {
__pyx_v_j = __pyx_t_52;
317: outCount[bin0_min, j] += < double > deltaA
/* "splitBBox.pyx":317
* outData[bin0_min, bin1_max] += data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += <
double > deltaA # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min, j] += data * deltaA
*
*/
__pyx_t_53 = __pyx_v_bin0_min;
__pyx_t_54 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_54, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((double)__pyx_v_deltaA);
318: outData[bin0_min, j] += data * deltaA
/* "splitBBox.pyx":318
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += <
double > deltaA
* outData[bin0_min, j] += data * deltaA # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* else: #spread on more than 2 bins in dim 0
*/
__pyx_t_55 = __pyx_v_bin0_min;
__pyx_t_56 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_outData.diminfo[1].strides) += (__pyx_v_data * __pyx_v_deltaA);
}
}
__pyx_L35:;
goto __pyx_L34;
}
/*else*/ {
319:
320: else: #spread on more than 2 bins in dim 0
321: if bin1_min == bin1_max:
/* "splitBBox.pyx":321
*
* else: #spread on more than 2 bins in dim 0
* if bin1_min == bin1_max: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* #All pixel fall on 1 bins in dim 1
* deltaA = 1.0 / (fbin0_max - fbin0_min)
*/
__pyx_t_27 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
if (__pyx_t_27) {
322: #All pixel fall on 1 bins in dim 1
323: deltaA = 1.0 / (fbin0_max - fbin0_min)
/* "splitBBox.pyx":323
* if bin1_min == bin1_max:
* #All pixel fall on 1 bins in dim 1
* deltaA = 1.0 / (fbin0_max - fbin0_min) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltaL = (<
float > (bin0_min + 1)) - fbin0_min
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaL
*/
__pyx_v_deltaA = (1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min));
324: deltaL = (< float > (bin0_min + 1)) - fbin0_min
/* "splitBBox.pyx":324
* #All pixel fall on 1 bins in dim 1
* deltaA = 1.0 / (fbin0_max - fbin0_min)
* deltaL = (<
float > (bin0_min + 1)) - fbin0_min # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaL
* outData[bin0_min, bin1_min] += <
double > data * deltaA * deltaL
*/
__pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);
325: outCount[bin0_min, bin1_min] += < double > deltaA * deltaL
/* "splitBBox.pyx":325
* deltaA = 1.0 / (fbin0_max - fbin0_min)
* deltaL = (<
float > (bin0_min + 1)) - fbin0_min
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaL # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min, bin1_min] += <
double > data * deltaA * deltaL
* deltaR = fbin0_max - (<
float > bin0_max)
*/
__pyx_t_51 = __pyx_v_bin0_min;
__pyx_t_52 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaL);
326: outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL
/* "splitBBox.pyx":326
* deltaL = (<
float > (bin0_min + 1)) - fbin0_min
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaL
* outData[bin0_min, bin1_min] += <
double > data * deltaA * deltaL # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltaR = fbin0_max - (<
float > bin0_max)
* outCount[bin0_max, bin1_min] += <
double > deltaA * deltaR
*/
__pyx_t_57 = __pyx_v_bin0_min;
__pyx_t_58 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL);
327: deltaR = fbin0_max - (< float > bin0_max)
/* "splitBBox.pyx":327
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaL
* outData[bin0_min, bin1_min] += <
double > data * deltaA * deltaL
* deltaR = fbin0_max - (<
float > bin0_max) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outCount[bin0_max, bin1_min] += <
double > deltaA * deltaR
* outData[bin0_max, bin1_min] += <
double > data * deltaA * deltaR
*/
__pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));
328: outCount[bin0_max, bin1_min] += < double > deltaA * deltaR
/* "splitBBox.pyx":328
* outData[bin0_min, bin1_min] += <
double > data * deltaA * deltaL
* deltaR = fbin0_max - (<
float > bin0_max)
* outCount[bin0_max, bin1_min] += <
double > deltaA * deltaR # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_max, bin1_min] += <
double > data * deltaA * deltaR
* for i in range(bin0_min + 1, bin0_max):
*/
__pyx_t_59 = __pyx_v_bin0_max;
__pyx_t_60 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaR);
329: outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR
/* "splitBBox.pyx":329
* deltaR = fbin0_max - (<
float > bin0_max)
* outCount[bin0_max, bin1_min] += <
double > deltaA * deltaR
* outData[bin0_max, bin1_min] += <
double > data * deltaA * deltaR # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += <
double > deltaA
*/
__pyx_t_61 = __pyx_v_bin0_max;
__pyx_t_62 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR);
330: for i in range(bin0_min + 1, bin0_max):
/* "splitBBox.pyx":330
* outCount[bin0_max, bin1_min] += <
double > deltaA * deltaR
* outData[bin0_max, bin1_min] += <
double > data * deltaA * deltaR
* for i in range(bin0_min + 1, bin0_max): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outCount[i, bin1_min] += <
double > deltaA
* outData[i, bin1_min] += <
double > data * deltaA
*/
__pyx_t_63 = __pyx_v_bin0_max;
for (__pyx_t_64 = (__pyx_v_bin0_min + 1); __pyx_t_64 <
__pyx_t_63; __pyx_t_64+=1) {
__pyx_v_i = __pyx_t_64;
331: outCount[i, bin1_min] += < double > deltaA
/* "splitBBox.pyx":331
* outData[bin0_max, bin1_min] += <
double > data * deltaA * deltaR
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += <
double > deltaA # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[i, bin1_min] += <
double > data * deltaA
* else:
*/
__pyx_t_65 = __pyx_v_i;
__pyx_t_66 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_65, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_66, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((double)__pyx_v_deltaA);
332: outData[i, bin1_min] += < double > data * deltaA
/* "splitBBox.pyx":332
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += <
double > deltaA
* outData[i, bin1_min] += <
double > data * deltaA # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* else:
* #spread on n pix in dim0 and m pixel in dim1:
*/
__pyx_t_67 = __pyx_v_i;
__pyx_t_68 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_outData.diminfo[1].strides) += (((double)__pyx_v_data) * __pyx_v_deltaA);
}
goto __pyx_L38;
}
/*else*/ {
333: else:
334: #spread on n pix in dim0 and m pixel in dim1:
335: deltaL = (< float > (bin0_min + 1)) - fbin0_min
/* "splitBBox.pyx":335
* else:
* #spread on n pix in dim0 and m pixel in dim1:
* deltaL = (<
float > (bin0_min + 1)) - fbin0_min # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltaR = fbin0_max - (<
float > bin0_max)
* deltaD = (<
float > (bin1_min + 1)) - fbin1_min
*/
__pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);
336: deltaR = fbin0_max - (< float > bin0_max)
/* "splitBBox.pyx":336
* #spread on n pix in dim0 and m pixel in dim1:
* deltaL = (<
float > (bin0_min + 1)) - fbin0_min
* deltaR = fbin0_max - (<
float > bin0_max) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltaD = (<
float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (<
float > bin1_max)
*/
__pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));
337: deltaD = (< float > (bin1_min + 1)) - fbin1_min
/* "splitBBox.pyx":337
* deltaL = (<
float > (bin0_min + 1)) - fbin0_min
* deltaR = fbin0_max - (<
float > bin0_max)
* deltaD = (<
float > (bin1_min + 1)) - fbin1_min # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltaU = fbin1_max - (<
float > bin1_max)
* deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min)
*/
__pyx_v_deltaD = (((float)(__pyx_v_bin1_min + 1)) - __pyx_v_fbin1_min);
338: deltaU = fbin1_max - (< float > bin1_max)
/* "splitBBox.pyx":338
* deltaR = fbin0_max - (<
float > bin0_max)
* deltaD = (<
float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (<
float > bin1_max) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min)
*
*/
__pyx_v_deltaU = (__pyx_v_fbin1_max - ((float)__pyx_v_bin1_max));
339: deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min)
/* "splitBBox.pyx":339
* deltaD = (<
float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (<
float > bin1_max)
* deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaL * deltaD
*/
__pyx_v_deltaA = ((1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min)) / (__pyx_v_fbin1_max - __pyx_v_fbin1_min));
340:
341: outCount[bin0_min, bin1_min] += < double > deltaA * deltaL * deltaD
/* "splitBBox.pyx":341
* deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min)
*
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaL * deltaD # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min, bin1_min] += <
double > data * deltaA * deltaL * deltaD
*
*/
__pyx_t_63 = __pyx_v_bin0_min;
__pyx_t_64 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaD);
342: outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL * deltaD
/* "splitBBox.pyx":342
*
* outCount[bin0_min, bin1_min] += <
double > deltaA * deltaL * deltaD
* outData[bin0_min, bin1_min] += <
double > data * deltaA * deltaL * deltaD # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* outCount[bin0_min, bin1_max] += <
double > deltaA * deltaL * deltaU
*/
__pyx_t_69 = __pyx_v_bin0_min;
__pyx_t_70 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_70, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaD);
343:
344: outCount[bin0_min, bin1_max] += < double > deltaA * deltaL * deltaU
/* "splitBBox.pyx":344
* outData[bin0_min, bin1_min] += <
double > data * deltaA * deltaL * deltaD
*
* outCount[bin0_min, bin1_max] += <
double > deltaA * deltaL * deltaU # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min, bin1_max] += <
double > data * deltaA * deltaL * deltaU
*
*/
__pyx_t_71 = __pyx_v_bin0_min;
__pyx_t_72 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_72, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaU);
345: outData[bin0_min, bin1_max] += < double > data * deltaA * deltaL * deltaU
/* "splitBBox.pyx":345
*
* outCount[bin0_min, bin1_max] += <
double > deltaA * deltaL * deltaU
* outData[bin0_min, bin1_max] += <
double > data * deltaA * deltaL * deltaU # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* outCount[bin0_max, bin1_min] += <
double > deltaA * deltaR * deltaD
*/
__pyx_t_73 = __pyx_v_bin0_min;
__pyx_t_74 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_73, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_74, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaU);
346:
347: outCount[bin0_max, bin1_min] += < double > deltaA * deltaR * deltaD
/* "splitBBox.pyx":347
* outData[bin0_min, bin1_max] += <
double > data * deltaA * deltaL * deltaU
*
* outCount[bin0_max, bin1_min] += <
double > deltaA * deltaR * deltaD # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_max, bin1_min] += <
double > data * deltaA * deltaR * deltaD
*
*/
__pyx_t_75 = __pyx_v_bin0_max;
__pyx_t_76 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_75, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_76, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaD);
348: outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR * deltaD
/* "splitBBox.pyx":348
*
* outCount[bin0_max, bin1_min] += <
double > deltaA * deltaR * deltaD
* outData[bin0_max, bin1_min] += <
double > data * deltaA * deltaR * deltaD # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* outCount[bin0_max, bin1_max] += <
double > deltaA * deltaR * deltaU
*/
__pyx_t_77 = __pyx_v_bin0_max;
__pyx_t_78 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_77, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_78, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaD);
349:
350: outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU
/* "splitBBox.pyx":350
* outData[bin0_max, bin1_min] += <
double > data * deltaA * deltaR * deltaD
*
* outCount[bin0_max, bin1_max] += <
double > deltaA * deltaR * deltaU # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_max, bin1_max] += <
double > data * deltaA * deltaR * deltaU
* for i in range(bin0_min + 1, bin0_max):
*/
__pyx_t_79 = __pyx_v_bin0_max;
__pyx_t_80 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_80, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaU);
351: outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU
/* "splitBBox.pyx":351
*
* outCount[bin0_max, bin1_max] += <
double > deltaA * deltaR * deltaU
* outData[bin0_max, bin1_max] += <
double > data * deltaA * deltaR * deltaU # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += <
double > deltaA * deltaD
*/
__pyx_t_81 = __pyx_v_bin0_max;
__pyx_t_82 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_81, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_82, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaU);
352: for i in range(bin0_min + 1, bin0_max):
/* "splitBBox.pyx":352
* outCount[bin0_max, bin1_max] += <
double > deltaA * deltaR * deltaU
* outData[bin0_max, bin1_max] += <
double > data * deltaA * deltaR * deltaU
* for i in range(bin0_min + 1, bin0_max): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outCount[i, bin1_min] += <
double > deltaA * deltaD
* outData[i, bin1_min] += <
double > data * deltaA * deltaD
*/
__pyx_t_83 = __pyx_v_bin0_max;
for (__pyx_t_84 = (__pyx_v_bin0_min + 1); __pyx_t_84 <
__pyx_t_83; __pyx_t_84+=1) {
__pyx_v_i = __pyx_t_84;
353: outCount[i, bin1_min] += < double > deltaA * deltaD
/* "splitBBox.pyx":353
* outData[bin0_max, bin1_max] += <
double > data * deltaA * deltaR * deltaU
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += <
double > deltaA * deltaD # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[i, bin1_min] += <
double > data * deltaA * deltaD
* for j in range(bin1_min + 1, bin1_max):
*/
__pyx_t_85 = __pyx_v_i;
__pyx_t_86 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_85, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_86, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaD);
354: outData[i, bin1_min] += < double > data * deltaA * deltaD
/* "splitBBox.pyx":354
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += <
double > deltaA * deltaD
* outData[i, bin1_min] += <
double > data * deltaA * deltaD # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for j in range(bin1_min + 1, bin1_max):
* outCount[i, j] += <
double > deltaA
*/
__pyx_t_87 = __pyx_v_i;
__pyx_t_88 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_87, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_88, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaD);
355: for j in range(bin1_min + 1, bin1_max):
/* "splitBBox.pyx":355
* outCount[i, bin1_min] += <
double > deltaA * deltaD
* outData[i, bin1_min] += <
double > data * deltaA * deltaD
* for j in range(bin1_min + 1, bin1_max): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outCount[i, j] += <
double > deltaA
* outData[i, j] += <
double > data * deltaA
*/
__pyx_t_89 = __pyx_v_bin1_max;
for (__pyx_t_90 = (__pyx_v_bin1_min + 1); __pyx_t_90 <
__pyx_t_89; __pyx_t_90+=1) {
__pyx_v_j = __pyx_t_90;
356: outCount[i, j] += < double > deltaA
/* "splitBBox.pyx":356
* outData[i, bin1_min] += <
double > data * deltaA * deltaD
* for j in range(bin1_min + 1, bin1_max):
* outCount[i, j] += <
double > deltaA # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[i, j] += <
double > data * deltaA
* outCount[i, bin1_max] += <
double > deltaA * deltaU
*/
__pyx_t_91 = __pyx_v_i;
__pyx_t_92 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_91, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_92, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((double)__pyx_v_deltaA);
357: outData[i, j] += < double > data * deltaA
/* "splitBBox.pyx":357
* for j in range(bin1_min + 1, bin1_max):
* outCount[i, j] += <
double > deltaA
* outData[i, j] += <
double > data * deltaA # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outCount[i, bin1_max] += <
double > deltaA * deltaU
* outData[i, bin1_max] += <
double > data * deltaA * deltaU
*/
__pyx_t_93 = __pyx_v_i;
__pyx_t_94 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_93, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_94, __pyx_pybuffernd_outData.diminfo[1].strides) += (((double)__pyx_v_data) * __pyx_v_deltaA);
}
358: outCount[i, bin1_max] += < double > deltaA * deltaU
/* "splitBBox.pyx":358
* outCount[i, j] += <
double > deltaA
* outData[i, j] += <
double > data * deltaA
* outCount[i, bin1_max] += <
double > deltaA * deltaU # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[i, bin1_max] += <
double > data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max):
*/
__pyx_t_89 = __pyx_v_i;
__pyx_t_90 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_89, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_90, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaU);
359: outData[i, bin1_max] += < double > data * deltaA * deltaU
/* "splitBBox.pyx":359
* outData[i, j] += <
double > data * deltaA
* outCount[i, bin1_max] += <
double > deltaA * deltaU
* outData[i, bin1_max] += <
double > data * deltaA * deltaU # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += <
double > deltaA * deltaL
*/
__pyx_t_95 = __pyx_v_i;
__pyx_t_96 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_95, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_96, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaU);
}
360: for j in range(bin1_min + 1, bin1_max):
/* "splitBBox.pyx":360
* outCount[i, bin1_max] += <
double > deltaA * deltaU
* outData[i, bin1_max] += <
double > data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outCount[bin0_min, j] += <
double > deltaA * deltaL
* outData[bin0_min, j] += <
double > data * deltaA * deltaL
*/
__pyx_t_83 = __pyx_v_bin1_max;
for (__pyx_t_84 = (__pyx_v_bin1_min + 1); __pyx_t_84 <
__pyx_t_83; __pyx_t_84+=1) {
__pyx_v_j = __pyx_t_84;
361: outCount[bin0_min, j] += < double > deltaA * deltaL
/* "splitBBox.pyx":361
* outData[i, bin1_max] += <
double > data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += <
double > deltaA * deltaL # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_min, j] += <
double > data * deltaA * deltaL
*
*/
__pyx_t_97 = __pyx_v_bin0_min;
__pyx_t_98 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_97, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_98, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaL);
362: outData[bin0_min, j] += < double > data * deltaA * deltaL
/* "splitBBox.pyx":362
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += <
double > deltaA * deltaL
* outData[bin0_min, j] += <
double > data * deltaA * deltaL # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* outCount[bin0_max, j] += <
double > deltaA * deltaR
*/
__pyx_t_99 = __pyx_v_bin0_min;
__pyx_t_100 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_99, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_100, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL);
363:
364: outCount[bin0_max, j] += < double > deltaA * deltaR
/* "splitBBox.pyx":364
* outData[bin0_min, j] += <
double > data * deltaA * deltaL
*
* outCount[bin0_max, j] += <
double > deltaA * deltaR # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outData[bin0_max, j] += <
double > data * deltaA * deltaR
*
*/
__pyx_t_101 = __pyx_v_bin0_max;
__pyx_t_102 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_101, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_102, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaR);
365: outData[bin0_max, j] += < double > data * deltaA * deltaR
/* "splitBBox.pyx":365
*
* outCount[bin0_max, j] += <
double > deltaA * deltaR
* outData[bin0_max, j] += <
double > data * deltaA * deltaR # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* for i in range(bins0):
*/
__pyx_t_103 = __pyx_v_bin0_max;
__pyx_t_104 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_103, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_104, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR);
}
}
__pyx_L38:;
}
__pyx_L34:;
__pyx_L27_continue:;
}
366:
367: for i in range(bins0):
/* "splitBBox.pyx":367
* outData[bin0_max, j] += <
double > data * deltaA * deltaR
*
* for i in range(bins0): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* for j in range(bins1):
* if outCount[i, j] > epsilon:
*/
__pyx_t_9 = __pyx_v_bins0;
for (__pyx_t_2 = 0; __pyx_t_2 <
__pyx_t_9; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
368: for j in range(bins1):
/* "splitBBox.pyx":368
*
* for i in range(bins0):
* for j in range(bins1): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if outCount[i, j] > epsilon:
* outMerge[i, j] = outData[i, j] / outCount[i, j]
*/
__pyx_t_83 = __pyx_v_bins1;
for (__pyx_t_84 = 0; __pyx_t_84 <
__pyx_t_83; __pyx_t_84+=1) {
__pyx_v_j = __pyx_t_84;
369: if outCount[i, j] > epsilon:
/* "splitBBox.pyx":369
* for i in range(bins0):
* for j in range(bins1):
* if outCount[i, j] > epsilon: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* outMerge[i, j] = outData[i, j] / outCount[i, j]
* else:
*/
__pyx_t_105 = __pyx_v_i;
__pyx_t_106 = __pyx_v_j;
__pyx_t_27 = ((*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_105, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_106, __pyx_pybuffernd_outCount.diminfo[1].strides)) > __pyx_v_epsilon);
if (__pyx_t_27) {
370: outMerge[i, j] = outData[i, j] / outCount[i, j]
/* "splitBBox.pyx":370
* for j in range(bins1):
* if outCount[i, j] > epsilon:
* outMerge[i, j] = outData[i, j] / outCount[i, j] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* else:
* outMerge[i, j] = dummy
*/
__pyx_t_107 = __pyx_v_i;
__pyx_t_108 = __pyx_v_j;
__pyx_t_109 = __pyx_v_i;
__pyx_t_110 = __pyx_v_j;
__pyx_t_111 = __pyx_v_i;
__pyx_t_112 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_111, __pyx_pybuffernd_outMerge.diminfo[0].strides, __pyx_t_112, __pyx_pybuffernd_outMerge.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_107, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_108, __pyx_pybuffernd_outData.diminfo[1].strides)) / (*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_outCount.diminfo[1].strides)));
goto __pyx_L51;
}
/*else*/ {
371: else:
372: outMerge[i, j] = dummy
/* "splitBBox.pyx":372
* outMerge[i, j] = outData[i, j] / outCount[i, j]
* else:
* outMerge[i, j] = dummy # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* return outMerge.T, edges0, edges1, outData.T, outCount.T
*
*/
__pyx_t_113 = __pyx_v_i;
__pyx_t_114 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_113, __pyx_pybuffernd_outMerge.diminfo[0].strides, __pyx_t_114, __pyx_pybuffernd_outMerge.diminfo[1].strides) = __pyx_v_dummy;
}
__pyx_L51:;
}
}
}
373: return outMerge.T, edges0, edges1, outData.T, outCount.T
/* "splitBBox.pyx":373
* else:
* outMerge[i, j] = dummy
* return outMerge.T, edges0, edges1, outData.T, outCount.T # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_outMerge), __pyx_n_s__T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_outData), __pyx_n_s__T); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_outCount), __pyx_n_s__T); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_edges0));
PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_edges0));
__Pyx_GIVEREF(((PyObject *)__pyx_v_edges0));
__Pyx_INCREF(((PyObject *)__pyx_v_edges1));
PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_edges1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_edges1));
PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_19);
__Pyx_GIVEREF(__pyx_t_19);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
__pyx_t_19 = 0;
__pyx_r = ((PyObject *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_19);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("splitBBox.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_cdata);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0);
__Pyx_XDECREF((PyObject *)__pyx_v_cdelta_pos0);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0_inf);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0_sup);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1);
__Pyx_XDECREF((PyObject *)__pyx_v_cdelta_pos1);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1_inf);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1_sup);
__Pyx_XDECREF((PyObject *)__pyx_v_outData);
__Pyx_XDECREF((PyObject *)__pyx_v_outCount);
__Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
__Pyx_XDECREF((PyObject *)__pyx_v_edges0);
__Pyx_XDECREF((PyObject *)__pyx_v_edges1);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
374:
pyfai-0.3.5/src/bilinear.html 0000644 0016116 0006511 00000207230 11703641246 015253 0 ustar kieffer soft
Generated by Cython 0.15.1+ on Wed Dec 21 21:48:02 2011
Raw output: bilinear.c
1: # -*- coding: utf8 -*-
/* "bilinear.pyx":1
* # -*- coding: utf8 -*- # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* #
* # Project: Azimuthal integration
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2: #
3: # Project: Azimuthal integration
4: # https://forge.epn-campus.eu/projects/azimuthal
5: #
6: # File: "$Id$"
7: #
8: # Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
9: #
10: # Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
11: #
12: # This program is free software: you can redistribute it and/or modify
13: # it under the terms of the GNU General Public License as published by
14: # the Free Software Foundation, either version 3 of the License, or
15: # (at your option) any later version.
16: #
17: # This program is distributed in the hope that it will be useful,
18: # but WITHOUT ANY WARRANTY; without even the implied warranty of
19: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20: # GNU General Public License for more details.
21: #
22: # You should have received a copy of the GNU General Public License
23: # along with this program. If not, see <http://www.gnu.org/licenses/>.
24: #
25:
26: __author__ = "Jerome Kieffer"
/* "bilinear.pyx":26
* #
*
* __author__ = "Jerome Kieffer" # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* __license__ = "GPLv3"
* __date__ = "21/12/2011"
*/
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_14)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27: __license__ = "GPLv3"
/* "bilinear.pyx":27
*
* __author__ = "Jerome Kieffer"
* __license__ = "GPLv3" # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* __date__ = "21/12/2011"
* __copyright__ = "2011, ESRF"
*/
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____license__, ((PyObject *)__pyx_n_s__GPLv3)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28: __date__ = "21/12/2011"
/* "bilinear.pyx":28
* __author__ = "Jerome Kieffer"
* __license__ = "GPLv3"
* __date__ = "21/12/2011" # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* __copyright__ = "2011, ESRF"
* __contact__ = "jerome.kieffer@esrf.fr"
*/
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____date__, ((PyObject *)__pyx_kp_s_15)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29: __copyright__ = "2011, ESRF"
/* "bilinear.pyx":29
* __license__ = "GPLv3"
* __date__ = "21/12/2011"
* __copyright__ = "2011, ESRF" # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* __contact__ = "jerome.kieffer@esrf.fr"
*
*/
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____copyright__, ((PyObject *)__pyx_kp_s_16)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30: __contact__ = "jerome.kieffer@esrf.fr"
/* "bilinear.pyx":30
* __date__ = "21/12/2011"
* __copyright__ = "2011, ESRF"
* __contact__ = "jerome.kieffer@esrf.fr" # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* import cython
*/
if (PyObject_SetAttr(__pyx_m, __pyx_n_s____contact__, ((PyObject *)__pyx_kp_s_17)) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31:
32: import cython
33: cimport numpy
34: import numpy
/* "bilinear.pyx":34
* import cython
* cimport numpy
* import numpy # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* ctypedef numpy.float32_t DTYPE_float32_t
*
*/
__pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__numpy, __pyx_t_1) <
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35: ctypedef numpy.float32_t DTYPE_float32_t
36:
37: cdef extern from "math.h":
38: float floor(float) nogil
39: float ceil(float) nogil
40: cdef extern from "stdlib.h":
41: void free(void * ptr)nogil
42: void * calloc(size_t nmemb, size_t size)nogil
43: void * malloc(size_t size)nogil
44: void * memcpy(void * dst, void * src, long n)
45: cdef extern from "numpy/arrayobject.h":
46: ctypedef int intp
47: ctypedef extern class numpy.ndarray [object PyArrayObject]:
48: cdef char * data
49: cdef int nd
50: cdef intp * dimensions
51: cdef intp * strides
52: cdef int flags
53:
54: @cython.boundscheck(False)
55: cdef class bilinear:
56: """Bilinear interpolator for finding max"""
57:
58: cdef float * data
59: cdef float max, min
60: cdef long d0_max, d1_max, r
61:
62: def __dealloc__(self):
/* "bilinear.pyx":62
* cdef long d0_max, d1_max, r
*
* def __dealloc__(self): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* free(self.data)
*
*/
static void __pyx_pf_8bilinear_8bilinear___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_8bilinear_8bilinear___dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__");
63: free(self.data)
/* "bilinear.pyx":63
*
* def __dealloc__(self):
* free(self.data) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
* def __init__(self, numpy.ndarray data not None):
*/
free(((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data);
__Pyx_RefNannyFinishContext();
}
64:
65: def __init__(self, numpy.ndarray data not None):
/* "bilinear.pyx":65
* free(self.data)
*
* def __init__(self, numpy.ndarray data not None): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* assert data.ndim == 2
* self.d0_max = data.shape[0] - 1
*/
static int __pyx_pf_8bilinear_8bilinear_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_8bilinear_8bilinear_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *__pyx_v_data = 0;
PyArrayObject *__pyx_v_data2 = 0;
__Pyx_LocalBuf_ND __pyx_pybuffernd_data2;
__Pyx_Buffer __pyx_pybuffer_data2;
int __pyx_r;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,0};
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__");
{
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
if (likely(values[0])) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") <
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_v_data = ((PyArrayObject *)values[0]);
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_data = ((PyArrayObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("bilinear.bilinear.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_pybuffer_data2.pybuffer.buf = NULL;
__pyx_pybuffer_data2.refcount = 0;
__pyx_pybuffernd_data2.data = NULL;
__pyx_pybuffernd_data2.rcbuffer = &__pyx_pybuffer_data2;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 0, "data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66: assert data.ndim == 2
/* "bilinear.pyx":66
*
* def __init__(self, numpy.ndarray data not None):
* assert data.ndim == 2 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.d0_max = data.shape[0] - 1
* self.d1_max = data.shape[1] - 1
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!(__pyx_v_data->nd == 2))) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
67: self.d0_max = data.shape[0] - 1
/* "bilinear.pyx":67
* def __init__(self, numpy.ndarray data not None):
* assert data.ndim == 2
* self.d0_max = data.shape[0] - 1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.d1_max = data.shape[1] - 1
* self.r = data.shape[1]
*/
((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->d0_max = ((__pyx_v_data->dimensions[0]) - 1);
68: self.d1_max = data.shape[1] - 1
/* "bilinear.pyx":68
* assert data.ndim == 2
* self.d0_max = data.shape[0] - 1
* self.d1_max = data.shape[1] - 1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.r = data.shape[1]
* self.max = data.max()
*/
((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->d1_max = ((__pyx_v_data->dimensions[1]) - 1);
69: self.r = data.shape[1]
/* "bilinear.pyx":69
* self.d0_max = data.shape[0] - 1
* self.d1_max = data.shape[1] - 1
* self.r = data.shape[1] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.max = data.max()
* self.min = data.min()
*/
((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r = (__pyx_v_data->dimensions[1]);
70: self.max = data.max()
/* "bilinear.pyx":70
* self.d1_max = data.shape[1] - 1
* self.r = data.shape[1]
* self.max = data.max() # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.min = data.min()
* self.data = <
float *> malloc(data.size * sizeof(float))
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->max = __pyx_t_3;
71: self.min = data.min()
/* "bilinear.pyx":71
* self.r = data.shape[1]
* self.max = data.max()
* self.min = data.min() # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* self.data = <
float *> malloc(data.size * sizeof(float))
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] data2 = numpy.ascontiguousarray(data.astype("float32"))
*/
__pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->min = __pyx_t_3;
72: self.data = < float *> malloc(data.size * sizeof(float))
/* "bilinear.pyx":72
* self.max = data.max()
* self.min = data.min()
* self.data = <
float *> malloc(data.size * sizeof(float)) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] data2 = numpy.ascontiguousarray(data.astype("float32"))
* memcpy(self.data, data2.data, data.size * sizeof(float))
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_FromSize_t((sizeof(float))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data = ((float *)malloc(__pyx_t_5));
73: cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] data2 = numpy.ascontiguousarray(data.astype("float32"))
/* "bilinear.pyx":73
* self.min = data.min()
* self.data = <
float *> malloc(data.size * sizeof(float))
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] data2 = numpy.ascontiguousarray(data.astype("float32")) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* memcpy(self.data, data2.data, data.size * sizeof(float))
*
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data2.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_8bilinear_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
__pyx_v_data2 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_data2.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_data2.diminfo[0].strides = __pyx_pybuffernd_data2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data2.diminfo[0].shape = __pyx_pybuffernd_data2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data2.diminfo[1].strides = __pyx_pybuffernd_data2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data2.diminfo[1].shape = __pyx_pybuffernd_data2.rcbuffer->pybuffer.shape[1];
}
}
__pyx_t_6 = 0;
__pyx_v_data2 = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "bilinear.pyx":73
* self.min = data.min()
* self.data = <
float *> malloc(data.size * sizeof(float))
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] data2 = numpy.ascontiguousarray(data.astype("float32")) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* memcpy(self.data, data2.data, data.size * sizeof(float))
*
*/
__pyx_k_tuple_1 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_1);
__Pyx_INCREF(((PyObject *)__pyx_n_s__float32));
PyTuple_SET_ITEM(__pyx_k_tuple_1, 0, ((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__float32));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1));
74: memcpy(self.data, data2.data, data.size * sizeof(float))
/* "bilinear.pyx":74
* self.data = <
float *> malloc(data.size * sizeof(float))
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] data2 = numpy.ascontiguousarray(data.astype("float32"))
* memcpy(self.data, data2.data, data.size * sizeof(float)) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*
*
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(float))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
memcpy(((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data, __pyx_v_data2->data, __pyx_t_7);
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data2.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("bilinear.bilinear.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data2.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_data2);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
75:
76:
77: def f_cy(self, x):
/* "bilinear.pyx":77
*
*
* def f_cy(self, x): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* """
* Function f((y,x)) where f is a continuous function (y,x) are pixel coordinates
*/
static PyObject *__pyx_pf_8bilinear_8bilinear_2f_cy(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
static char __pyx_doc_8bilinear_8bilinear_2f_cy[] = "\n Function f((y,x)) where f is a continuous function (y,x) are pixel coordinates\n @param x: 2-tuple of float \n @return: Interpolated signal from the image (negative for minimizer)\n\n ";
static PyObject *__pyx_pf_8bilinear_8bilinear_2f_cy(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
float __pyx_v_d0;
float __pyx_v_d1;
int __pyx_v_i0;
int __pyx_v_i1;
int __pyx_v_j0;
int __pyx_v_j1;
float __pyx_v_x0;
float __pyx_v_x1;
float __pyx_v_y0;
float __pyx_v_y1;
float __pyx_v_res;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("f_cy");
78: """
79: Function f((y,x)) where f is a continuous function (y,x) are pixel coordinates
80: @param x: 2-tuple of float
81: @return: Interpolated signal from the image (negative for minimizer)
82:
83: """
84: cdef float d0 = x[0]
/* "bilinear.pyx":84
*
* """
* cdef float d0 = x[0] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef float d1 = x[1]
* cdef int i0, i1, j0, j1
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_d0 = __pyx_t_2;
85: cdef float d1 = x[1]
/* "bilinear.pyx":85
* """
* cdef float d0 = x[0]
* cdef float d1 = x[1] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef int i0, i1, j0, j1
* cdef float x0, x1, y0, y1, res
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_d1 = __pyx_t_2;
86: cdef int i0, i1, j0, j1
87: cdef float x0, x1, y0, y1, res
88: x0 = floor(d0)
/* "bilinear.pyx":88
* cdef int i0, i1, j0, j1
* cdef float x0, x1, y0, y1, res
* x0 = floor(d0) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* x1 = ceil(d0)
* y0 = floor(d1)
*/
__pyx_v_x0 = floor(__pyx_v_d0);
89: x1 = ceil(d0)
/* "bilinear.pyx":89
* cdef float x0, x1, y0, y1, res
* x0 = floor(d0)
* x1 = ceil(d0) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* y0 = floor(d1)
* y1 = ceil(d1)
*/
__pyx_v_x1 = ceil(__pyx_v_d0);
90: y0 = floor(d1)
/* "bilinear.pyx":90
* x0 = floor(d0)
* x1 = ceil(d0)
* y0 = floor(d1) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* y1 = ceil(d1)
* i0 = <
int > x0
*/
__pyx_v_y0 = floor(__pyx_v_d1);
91: y1 = ceil(d1)
/* "bilinear.pyx":91
* x1 = ceil(d0)
* y0 = floor(d1)
* y1 = ceil(d1) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* i0 = <
int > x0
* i1 = <
int > x1
*/
__pyx_v_y1 = ceil(__pyx_v_d1);
92: i0 = < int > x0
/* "bilinear.pyx":92
* y0 = floor(d1)
* y1 = ceil(d1)
* i0 = <
int > x0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* i1 = <
int > x1
* j0 = <
int > y0
*/
__pyx_v_i0 = ((int)__pyx_v_x0);
93: i1 = < int > x1
/* "bilinear.pyx":93
* y1 = ceil(d1)
* i0 = <
int > x0
* i1 = <
int > x1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* j0 = <
int > y0
* j1 = <
int > y1
*/
__pyx_v_i1 = ((int)__pyx_v_x1);
94: j0 = < int > y0
/* "bilinear.pyx":94
* i0 = <
int > x0
* i1 = <
int > x1
* j0 = <
int > y0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* j1 = <
int > y1
* if d0 <
0:
*/
__pyx_v_j0 = ((int)__pyx_v_y0);
95: j1 = < int > y1
/* "bilinear.pyx":95
* i1 = <
int > x1
* j0 = <
int > y0
* j1 = <
int > y1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* if d0 <
0:
* res = self.min + d0
*/
__pyx_v_j1 = ((int)__pyx_v_y1);
96: if d0 < 0:
/* "bilinear.pyx":96
* j0 = <
int > y0
* j1 = <
int > y1
* if d0 <
0: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* res = self.min + d0
* elif d1 <
0:
*/
__pyx_t_3 = (__pyx_v_d0 <
0.0);
if (__pyx_t_3) {
97: res = self.min + d0
/* "bilinear.pyx":97
* j1 = <
int > y1
* if d0 <
0:
* res = self.min + d0 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif d1 <
0:
* res = self.min + d1
*/
__pyx_v_res = (((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->min + __pyx_v_d0);
goto __pyx_L5;
}
98: elif d1 < 0:
/* "bilinear.pyx":98
* if d0 <
0:
* res = self.min + d0
* elif d1 <
0: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* res = self.min + d1
* elif d0 > self.d0_max:
*/
__pyx_t_3 = (__pyx_v_d1 <
0.0);
if (__pyx_t_3) {
99: res = self.min + d1
/* "bilinear.pyx":99
* res = self.min + d0
* elif d1 <
0:
* res = self.min + d1 # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif d0 > self.d0_max:
* res = self.min - d0 + self.d0_max
*/
__pyx_v_res = (((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->min + __pyx_v_d1);
goto __pyx_L5;
}
100: elif d0 > self.d0_max:
/* "bilinear.pyx":100
* elif d1 <
0:
* res = self.min + d1
* elif d0 > self.d0_max: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* res = self.min - d0 + self.d0_max
* elif d1 > self.d1_max:
*/
__pyx_t_3 = (__pyx_v_d0 > ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->d0_max);
if (__pyx_t_3) {
101: res = self.min - d0 + self.d0_max
/* "bilinear.pyx":101
* res = self.min + d1
* elif d0 > self.d0_max:
* res = self.min - d0 + self.d0_max # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif d1 > self.d1_max:
* res = self.min - d1 + self.d1_max
*/
__pyx_v_res = ((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->min - __pyx_v_d0) + ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->d0_max);
goto __pyx_L5;
}
102: elif d1 > self.d1_max:
/* "bilinear.pyx":102
* elif d0 > self.d0_max:
* res = self.min - d0 + self.d0_max
* elif d1 > self.d1_max: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* res = self.min - d1 + self.d1_max
* elif (i0 == i1) and (j0 == j1):
*/
__pyx_t_3 = (__pyx_v_d1 > ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->d1_max);
if (__pyx_t_3) {
103: res = self.min - d1 + self.d1_max
/* "bilinear.pyx":103
* res = self.min - d0 + self.d0_max
* elif d1 > self.d1_max:
* res = self.min - d1 + self.d1_max # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif (i0 == i1) and (j0 == j1):
* res = self.data[i0 * self.r + j0]
*/
__pyx_v_res = ((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->min - __pyx_v_d1) + ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->d1_max);
goto __pyx_L5;
}
104: elif (i0 == i1) and (j0 == j1):
/* "bilinear.pyx":104
* elif d1 > self.d1_max:
* res = self.min - d1 + self.d1_max
* elif (i0 == i1) and (j0 == j1): # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* res = self.data[i0 * self.r + j0]
* elif i0 == i1:
*/
__pyx_t_3 = (__pyx_v_i0 == __pyx_v_i1);
if (__pyx_t_3) {
__pyx_t_4 = (__pyx_v_j0 == __pyx_v_j1);
__pyx_t_5 = __pyx_t_4;
} else {
__pyx_t_5 = __pyx_t_3;
}
if (__pyx_t_5) {
105: res = self.data[i0 * self.r + j0]
/* "bilinear.pyx":105
* res = self.min - d1 + self.d1_max
* elif (i0 == i1) and (j0 == j1):
* res = self.data[i0 * self.r + j0] # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif i0 == i1:
* res = (self.data[i0 * self.r + j0] * (y1 - d1)) + (self.data[i0 * self.r + j1] * (d1 - y0))
*/
__pyx_v_res = (((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data[((__pyx_v_i0 * ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r) + __pyx_v_j0)]);
goto __pyx_L5;
}
106: elif i0 == i1:
/* "bilinear.pyx":106
* elif (i0 == i1) and (j0 == j1):
* res = self.data[i0 * self.r + j0]
* elif i0 == i1: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* res = (self.data[i0 * self.r + j0] * (y1 - d1)) + (self.data[i0 * self.r + j1] * (d1 - y0))
* elif j0 == j1:
*/
__pyx_t_5 = (__pyx_v_i0 == __pyx_v_i1);
if (__pyx_t_5) {
107: res = (self.data[i0 * self.r + j0] * (y1 - d1)) + (self.data[i0 * self.r + j1] * (d1 - y0))
/* "bilinear.pyx":107
* res = self.data[i0 * self.r + j0]
* elif i0 == i1:
* res = (self.data[i0 * self.r + j0] * (y1 - d1)) + (self.data[i0 * self.r + j1] * (d1 - y0)) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* elif j0 == j1:
* res = (self.data[i0 * self.r + j0] * (x1 - d0)) + (self.data[i1 * self.r + j0] * (d0 - x0))
*/
__pyx_v_res = (((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data[((__pyx_v_i0 * ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r) + __pyx_v_j0)]) * (__pyx_v_y1 - __pyx_v_d1)) + ((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data[((__pyx_v_i0 * ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r) + __pyx_v_j1)]) * (__pyx_v_d1 - __pyx_v_y0)));
goto __pyx_L5;
}
108: elif j0 == j1:
/* "bilinear.pyx":108
* elif i0 == i1:
* res = (self.data[i0 * self.r + j0] * (y1 - d1)) + (self.data[i0 * self.r + j1] * (d1 - y0))
* elif j0 == j1: # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* res = (self.data[i0 * self.r + j0] * (x1 - d0)) + (self.data[i1 * self.r + j0] * (d0 - x0))
* else:
*/
__pyx_t_5 = (__pyx_v_j0 == __pyx_v_j1);
if (__pyx_t_5) {
109: res = (self.data[i0 * self.r + j0] * (x1 - d0)) + (self.data[i1 * self.r + j0] * (d0 - x0))
/* "bilinear.pyx":109
* res = (self.data[i0 * self.r + j0] * (y1 - d1)) + (self.data[i0 * self.r + j1] * (d1 - y0))
* elif j0 == j1:
* res = (self.data[i0 * self.r + j0] * (x1 - d0)) + (self.data[i1 * self.r + j0] * (d0 - x0)) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* else:
* res = (self.data[i0 * self.r + j0] * (x1 - d0) * (y1 - d1)) \
*/
__pyx_v_res = (((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data[((__pyx_v_i0 * ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r) + __pyx_v_j0)]) * (__pyx_v_x1 - __pyx_v_d0)) + ((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data[((__pyx_v_i1 * ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r) + __pyx_v_j0)]) * (__pyx_v_d0 - __pyx_v_x0)));
goto __pyx_L5;
}
/*else*/ {
110: else:
111: res = (self.data[i0 * self.r + j0] * (x1 - d0) * (y1 - d1)) \
112: + (self.data[i1 * self.r + j0] * (d0 - x0) * (y1 - d1)) \
113: + (self.data[i0 * self.r + j1] * (x1 - d0) * (d1 - y0)) \
114: + (self.data[i1 * self.r + j1] * (d0 - x0) * (d1 - y0))
/* "bilinear.pyx":114
* + (self.data[i1 * self.r + j0] * (d0 - x0) * (y1 - d1)) \
* + (self.data[i0 * self.r + j1] * (x1 - d0) * (d1 - y0)) \
* + (self.data[i1 * self.r + j1] * (d0 - x0) * (d1 - y0)) # <
<
<
<
<
<
<
<
<
<
<
<
<
<
* return - res
*/
__pyx_v_res = ((((((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data[((__pyx_v_i0 * ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r) + __pyx_v_j0)]) * (__pyx_v_x1 - __pyx_v_d0)) * (__pyx_v_y1 - __pyx_v_d1)) + (((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data[((__pyx_v_i1 * ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r) + __pyx_v_j0)]) * (__pyx_v_d0 - __pyx_v_x0)) * (__pyx_v_y1 - __pyx_v_d1))) + (((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data[((__pyx_v_i0 * ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r) + __pyx_v_j1)]) * (__pyx_v_x1 - __pyx_v_d0)) * (__pyx_v_d1 - __pyx_v_y0))) + (((((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->data[((__pyx_v_i1 * ((struct __pyx_obj_8bilinear_bilinear *)__pyx_v_self)->r) + __pyx_v_j1)]) * (__pyx_v_d0 - __pyx_v_x0)) * (__pyx_v_d1 - __pyx_v_y0)));
}
__pyx_L5:;
115: return - res
/* "bilinear.pyx":115
* + (self.data[i0 * self.r + j1] * (x1 - d0) * (d1 - y0)) \
* + (self.data[i1 * self.r + j1] * (d0 - x0) * (d1 - y0))
* return - res # <
<
<
<
<
<
<
<
<
<
<
<
<
<
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyFloat_FromDouble((-__pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("bilinear.bilinear.f_cy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
pyfai-0.3.5/src/splitPixel.pyx 0000644 0016116 0006511 00000042703 11656053703 015503 0 ustar kieffer soft #!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Project: Azimuthal integration
# https://forge.epn-campus.eu/projects/azimuthal
#
# File: "$Id$"
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
import cython
cimport numpy
import numpy
cdef extern from "math.h":
double floor(double)nogil
double fabs(double)nogil
cdef extern from "stdlib.h":
void free(void * ptr)nogil
void * calloc(size_t nmemb, size_t size)nogil
void * malloc(size_t size)nogil
ctypedef numpy.int64_t DTYPE_int64_t
ctypedef numpy.float64_t DTYPE_float64_t
cdef double areaTriangle(double a0,
double a1,
double b0,
double b1,
double c0,
double c1):
"""
Calculate the area of the ABC triangle with corners:
A(a0,a1)
B(b0,b1)
C(c0,c1)
@return: area, i.e. 1/2 * (B-A)^(C-A)
"""
return 0.5 * abs(((b0 - a0) * (c1 - a1)) - ((b1 - a1) * (c0 - a0)))
cdef double areaQuad(double a0,
double a1,
double b0,
double b1,
double c0,
double c1,
double d0,
double d1
):
"""
Calculate the area of the ABCD quadrilataire with corners:
A(a0,a1)
B(b0,b1)
C(c0,c1)
D(d0,d1)
@return: area, i.e. 1/2 * (AC ^ BD)
"""
return 0.5 * abs(((c0 - a0) * (d1 - b1)) - ((c1 - a1) * (d0 - b0)))
@cython.cdivision(True)
cdef double getBinNr(double x0, double pos0_min, double dpos) nogil:
"""
calculate the bin number for any point
param x0: current position
param pos0_min: position minimum
param dpos: bin width
"""
return (x0 - pos0_min) / dpos
cdef double min4f(double a, double b, double c, double d) nogil:
if (a <= b) and (a <= c) and (a <= d):
return a
if (b <= a) and (b <= c) and (b <= d):
return b
if (c <= a) and (c <= b) and (c <= d):
return c
else:
return d
cdef double max4f(double a, double b, double c, double d) nogil:
"""Calculates the max of 4 double numbers"""
if (a >= b) and (a >= c) and (a >= d):
return a
if (b >= a) and (b >= c) and (b >= d):
return b
if (c >= a) and (c >= b) and (c >= d):
return c
else:
return d
@cython.cdivision(True)
@cython.boundscheck(False)
@cython.wraparound(False)
def fullSplit1D(numpy.ndarray pos not None,
numpy.ndarray weights not None,
long bins=100,
pos0Range=None,
pos1Range=None,
double dummy=0.0
):
"""
Calculates histogram of pos weighted by weights
Splitting is done on the pixel's bounding box like fit2D
@param pos: 3D array with pos0; Corner A,B,C,D; tth or chi
@param weights: array with intensities
@param bins: number of output bins
@param pos0Range: minimum and maximum of the 2th range
@param pos1Range: minimum and maximum of the chi range
@param dummy: value for bins without pixels
@return 2theta, I, weighted histogram, unweighted histogram
"""
assert pos.shape[0] == weights.size
assert pos.shape[1] == 4
assert pos.shape[2] == 2
assert pos.ndim == 3
assert bins > 1
cdef long size = weights.size
cdef numpy.ndarray[DTYPE_float64_t, ndim = 3] cpos = pos.astype("float64")
cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.astype("float64").ravel()
cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")
cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float64")
cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float64")
cdef double min0, max0, deltaR, deltaL, deltaA
cdef double pos0_min, pos0_max, pos0_maxin, pos1_min, pos1_max, pos1_maxin
if pos0Range is not None and len(pos0Range) > 1:
pos0_min = min(pos0Range)
pos0_maxin = max(pos0Range)
else:
pos0_min = pos[:, :, 0].min()
pos0_maxin = pos[:, :, 0].max()
pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.double).eps)
if pos1Range is not None and len(pos1Range) > 1:
pos1_min = min(pos1Range)
pos1_maxin = max(pos1Range)
else:
pos1_min = pos[:, :, 1].min()
pos1_max = pos[:, :, 1].max()
pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.double).eps)
cdef double dpos = (pos0_max - pos0_min) / (< double > (bins))
cdef long bin = 0
cdef long i, idx
cdef double fbin0_min, fbin0_max#, fbin1_min, fbin1_max
cdef long bin0_max, bin0_min
cdef double aeraPixel, a0, b0, c0, d0
cdef double epsilon = 1e-10
with nogil:
for i in range(bins):
outPos[i] = pos0_min + (0.5 +< double > i) * dpos
for idx in range(size):
data = < double > cdata[idx]
a0 = < double > cpos[idx, 0, 0]
b0 = < double > cpos[idx, 1, 0]
c0 = < double > cpos[idx, 2, 0]
d0 = < double > cpos[idx, 3, 0]
min0 = min4f(a0, b0, c0, d0)
max0 = max4f(a0, b0, c0, d0)
fbin0_min = getBinNr(min0, pos0_min, dpos)
fbin0_max = getBinNr(max0, pos0_min, dpos)
bin0_min = < long > floor(fbin0_min)
bin0_max = < long > floor(fbin0_max)
if bin0_min == bin0_max:
#All pixel is within a single bin
outCount[bin0_min] += 1.0
outData[bin0_min] += data
# else we have pixel spliting.
else:
aeraPixel = fbin0_max - fbin0_min
deltaA = 1.0 / aeraPixel
deltaL = < double > (bin0_min + 1) - fbin0_min
deltaR = fbin0_max - (< double > bin0_max)
outCount[bin0_min] += deltaA * deltaL
outData[bin0_min] += data * deltaA * deltaL
outCount[bin0_max] += deltaA * deltaR
outData[bin0_max] += data * deltaA * deltaR
if bin0_min + 1 != bin0_max:
for i in range(bin0_min + 1, bin0_max):
outCount[i] += deltaA
outData[i] += data * deltaA
for i in range(bins):
if outCount[i] > epsilon:
outMerge[i] = outData[i] / outCount[i]
else:
outMerge[i] = dummy
return outPos, outMerge, outData, outCount
@cython.cdivision(True)
@cython.boundscheck(False)
@cython.wraparound(False)
def fullSplit2D(numpy.ndarray pos not None,
numpy.ndarray weights not None,
bins not None,
pos0Range=None,
pos1Range=None,
double dummy=0.0):
"""
Calculate 2D histogram of pos weighted by weights
Splitting is done on the pixel's bounding box like fit2D
@param pos: 3D array with pos0; Corner A,B,C,D; tth or chi
@param weights: array with intensities
@param bins: number of output bins int or 2-tuple of int
@param pos0Range: minimum and maximum of the 2th range
@param pos1Range: minimum and maximum of the chi range
@param dummy: value for bins without pixels
@return I, edges0, edges1, weighted histogram(2D), unweighted histogram (2D)
"""
cdef long bins0, bins1, i, j, idx
cdef long size = weights.size
assert pos.shape[0] == weights.size
assert pos.shape[1] == 4 # 4 corners
assert pos.shape[2] == 2 # tth and chi
assert pos.ndim == 3
try:
bins0, bins1 = tuple(bins)
except:
bins0 = bins1 = < long > bins
if bins0 <= 0:
bins0 = 1
if bins1 <= 0:
bins1 = 1
cdef numpy.ndarray[DTYPE_float64_t, ndim = 3] cpos = pos.astype("float64")
cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.astype("float64").ravel()
cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float64")
cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float64")
cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float64")
cdef double min0, max0, min1, max1, deltaR, deltaL, deltaU, deltaD, deltaA
cdef double pos0_min, pos0_max, pos1_min, pos1_max, pos0_maxin, pos1_maxin
cdef double fbin0_min, fbin0_max, fbin1_min, fbin1_max
cdef long bin0_max, bin0_min, bin1_max, bin1_min
cdef double aeraPixel, a0, a1, b0, b1, c0, c1, d0, d1
cdef double epsilon = 1e-10
if pos0Range is not None and len(pos0Range) == 2:
pos0_min = min(pos0Range)
pos0_maxin = max(pos0Range)
else:
pos0_min = pos[:, :, 0].min()
pos0_maxin = pos[:, :, 0].max()
pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.double).eps)
if pos1Range is not None and len(pos1Range) > 1:
pos1_min = min(pos1Range)
pos1_maxin = max(pos1Range)
else:
pos1_min = pos[:, :, 1].min()
pos1_maxin = pos[:, :, 1].max()
pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.double).eps)
cdef double dpos0 = (pos0_max - pos0_min) / (< double > (bins0))
cdef double dpos1 = (pos1_max - pos1_min) / (< double > (bins1))
with nogil:
for i in range(bins0):
edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
for i in range(bins1):
edges1[i] = pos1_min + (0.5 +< double > i) * dpos1
for idx in range(size):
data = < double > cdata[idx]
a0 = < double > cpos[idx, 0, 0]
a1 = < double > cpos[idx, 0, 1]
b0 = < double > cpos[idx, 1, 0]
b1 = < double > cpos[idx, 1, 1]
c0 = < double > cpos[idx, 2, 0]
c1 = < double > cpos[idx, 2, 1]
d0 = < double > cpos[idx, 3, 0]
d1 = < double > cpos[idx, 3, 1]
min0 = min4f(a0, b0, c0, d0)
max0 = max4f(a0, b0, c0, d0)
min1 = min4f(a1, b1, c1, d1)
max1 = max4f(a1, b1, c1, d1)
# splitOnePixel2D(min0, max0, min1, max1,
# data,
# pos0_min, pos1_min,
# dpos0, dpos1,
# outCount,
# outData)
if max0 < pos0_min:
with gil:
print("max0 (%s) < self.pos0_min %s" % (max0 , pos0_min))
continue
if max1 < pos1_min:
with gil:
print("max1 (%s) < pos1_min %s" % (max0 , pos0_min))
continue
if min0 > pos0_maxin:
with gil:
print("min0 (%s) > pos0_maxin %s" % (max0 , pos0_maxin))
continue
if min1 > pos1_maxin:
with gil:
print("min1 (%s) > pos1_maxin %s" % (max0 , pos1_maxin))
continue
if min0 < pos0_min:
data = data * (pos0_min - min0) / (max0 - min0)
min0 = pos0_min
if min1 < pos1_min:
data = data * (pos1_min - min1) / (max1 - min1)
min1 = pos1_min
if max0 > pos0_maxin:
data = data * (max0 - pos0_maxin) / (max0 - min0)
max0 = pos0_maxin
if max1 > pos1_maxin:
data = data * (max1 - pos1_maxin) / (max1 - min1)
max1 = pos1_maxin
## treat data for pixel on chi discontinuity
if ((max1 - min1) / dpos1) > (bins1 / 2.0):
# with gil:
# print("max1: %s; min1: %s; dpos1: %s" % (max1 , min1, dpos1))
if pos1_maxin - max1 > min1 - pos1_min:
min1 = max1
max1 = pos1_maxin
else:
max1 = min1
min1 = pos1_min
fbin0_min = getBinNr(min0, pos0_min, dpos0)
fbin0_max = getBinNr(max0, pos0_min, dpos0)
fbin1_min = getBinNr(min1, pos1_min, dpos1)
fbin1_max = getBinNr(max1, pos1_min, dpos1)
bin0_min = < long > floor(fbin0_min)
bin0_max = < long > floor(fbin0_max)
bin1_min = < long > floor(fbin1_min)
bin1_max = < long > floor(fbin1_max)
if bin0_min == bin0_max:
if bin1_min == bin1_max:
#All pixel is within a single bin
outCount[bin0_min, bin1_min] += 1.0
outData[bin0_min, bin1_min] += data
else:
#spread on more than 2 bins
aeraPixel = fbin1_max - fbin1_min
deltaD = (< double > (bin1_min + 1)) - fbin1_min
deltaU = fbin1_max - (< double > bin1_max)
deltaA = 1.0 / aeraPixel
outCount[bin0_min, bin1_min] += deltaA * deltaD
outData[bin0_min, bin1_min] += data * deltaA * deltaD
outCount[bin0_min, bin1_max] += deltaA * deltaU
outData[bin0_min, bin1_max] += data * deltaA * deltaU
# if bin1_min +1< bin1_max:
for j in range(bin1_min + 1, bin1_max):
outCount[bin0_min, j] += deltaA
outData[bin0_min, j] += data * deltaA
else: #spread on more than 2 bins in dim 0
if bin1_min == bin1_max:
#All pixel fall on 1 bins in dim 1
aeraPixel = fbin0_max - fbin0_min
deltaL = (< double > (bin0_min + 1)) - fbin0_min
deltaA = deltaL / aeraPixel
outCount[bin0_min, bin1_min] += deltaA
outData[bin0_min, bin1_min] += data * deltaA
deltaR = fbin0_max - (< double > bin0_max)
deltaA = deltaR / aeraPixel
outCount[bin0_max, bin1_min] += deltaA
outData[bin0_max, bin1_min] += data * deltaA
deltaA = 1.0 / aeraPixel
for i in range(bin0_min + 1, bin0_max):
outCount[i, bin1_min] += deltaA
outData[i, bin1_min] += data * deltaA
else:
#spread on n pix in dim0 and m pixel in dim1:
aeraPixel = (fbin0_max - fbin0_min) * (fbin1_max - fbin1_min)
deltaL = (< double > (bin0_min + 1)) - fbin0_min
deltaR = fbin0_max - (< double > bin0_max)
deltaD = (< double > (bin1_min + 1)) - fbin1_min
deltaU = fbin1_max - (< double > bin1_max)
deltaA = 1.0 / aeraPixel
outCount[bin0_min, bin1_min] += deltaA * deltaL * deltaD
outData[bin0_min, bin1_min] += data * deltaA * deltaL * deltaD
outCount[bin0_min, bin1_max] += deltaA * deltaL * deltaU
outData[bin0_min, bin1_max] += data * deltaA * deltaL * deltaU
outCount[bin0_max, bin1_min] += deltaA * deltaR * deltaD
outData[bin0_max, bin1_min] += data * deltaA * deltaR * deltaD
outCount[bin0_max, bin1_max] += deltaA * deltaR * deltaU
outData[bin0_max, bin1_max] += data * deltaA * deltaR * deltaU
for i in range(bin0_min + 1, bin0_max):
outCount[i, bin1_min] += deltaA * deltaD
outData[i, bin1_min] += data * deltaA * deltaD
for j in range(bin1_min + 1, bin1_max):
outCount[i, j] += deltaA
outData[i, j] += data * deltaA
outCount[i, bin1_max] += deltaA * deltaU
outData[i, bin1_max] += data * deltaA * deltaU
for j in range(bin1_min + 1, bin1_max):
outCount[bin0_min, j] += deltaA * deltaL
outData[bin0_min, j] += data * deltaA * deltaL
outCount[bin0_max, j] += deltaA * deltaR
outData[bin0_max, j] += data * deltaA * deltaR
#with nogil:
for i in range(bins0):
for j in range(bins1):
if outCount[i, j] > epsilon:
outMerge[i, j] = outData[i, j] / outCount[i, j]
else:
outMerge[i, j] = dummy
return outMerge.T, edges0, edges1, outData.T, outCount.T
pyfai-0.3.5/src/splitBBox.c 0000644 0016116 0006511 00001617210 11656557527 014675 0 ustar kieffer soft /* Generated by Cython 0.15.1+ on Wed Nov 9 08:54:07 2011 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
#error Cython requires Python 2.4+.
#else
#include /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PY_FORMAT_SIZE_T ""
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
#define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o)
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
#define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif
#if PY_VERSION_HEX < 0x02060000
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
#define PyVarObject_HEAD_INIT(type, size) \
PyObject_HEAD_INIT(type) size,
#define PyType_Modified(t)
typedef struct {
void *buf;
PyObject *obj;
Py_ssize_t len;
Py_ssize_t itemsize;
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
void *internal;
} Py_buffer;
#define PyBUF_SIMPLE 0
#define PyBUF_WRITABLE 0x0001
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#endif
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
#define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
/* new Py3.3 unicode representation (PEP 393) */
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_GET_LENGTH)
#define CYTHON_PEP393_ENABLED
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#else
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
#define PyBytesObject PyStringObject
#define PyBytes_Type PyString_Type
#define PyBytes_Check PyString_Check
#define PyBytes_CheckExact PyString_CheckExact
#define PyBytes_FromString PyString_FromString
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
#define PyBytes_FromFormat PyString_FromFormat
#define PyBytes_DecodeEscape PyString_DecodeEscape
#define PyBytes_AsString PyString_AsString
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
#define PyBytes_Size PyString_Size
#define PyBytes_AS_STRING PyString_AS_STRING
#define PyBytes_GET_SIZE PyString_GET_SIZE
#define PyBytes_Repr PyString_Repr
#define PyBytes_Concat PyString_Concat
#define PyBytes_ConcatAndDel PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
#define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
#define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
#else
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
#define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
#define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
#define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
#define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
#define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
#define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
#else
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_NAMESTR(n) ((char *)(n))
#define __Pyx_DOCSTR(n) ((char *)(n))
#else
#define __Pyx_NAMESTR(n) (n)
#define __Pyx_DOCSTR(n) (n)
#endif
#ifndef __PYX_EXTERN_C
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#endif
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include
#define __PYX_HAVE__splitBBox
#define __PYX_HAVE_API__splitBBox
#include "stdio.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "math.h"
#ifdef _OPENMP
#include
#endif /* _OPENMP */
#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif
/* inline attribute */
#ifndef CYTHON_INLINE
#if defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
/* Type Conversion Predeclarations */
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
#if !defined(CYTHON_CCOMPLEX)
#if defined(__cplusplus)
#define CYTHON_CCOMPLEX 1
#elif defined(_Complex_I)
#define CYTHON_CCOMPLEX 1
#else
#define CYTHON_CCOMPLEX 0
#endif
#endif
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#include
#else
#include
#endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
#undef _Complex_I
#define _Complex_I 1.0fj
#endif
static const char *__pyx_f[] = {
"splitBBox.pyx",
"numpy.pxd",
};
/* "numpy.pxd":719
* # in Cython to enable them only on the right systems.
*
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;
/* "numpy.pxd":720
*
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;
/* "numpy.pxd":721
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
* ctypedef npy_int64 int64_t
* #ctypedef npy_int96 int96_t
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;
/* "numpy.pxd":722
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
* #ctypedef npy_int96 int96_t
* #ctypedef npy_int128 int128_t
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;
/* "numpy.pxd":726
* #ctypedef npy_int128 int128_t
*
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
/* "numpy.pxd":727
*
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;
/* "numpy.pxd":728
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
* ctypedef npy_uint64 uint64_t
* #ctypedef npy_uint96 uint96_t
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
/* "numpy.pxd":729
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
* #ctypedef npy_uint96 uint96_t
* #ctypedef npy_uint128 uint128_t
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
/* "numpy.pxd":733
* #ctypedef npy_uint128 uint128_t
*
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
* ctypedef npy_float64 float64_t
* #ctypedef npy_float80 float80_t
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;
/* "numpy.pxd":734
*
* ctypedef npy_float32 float32_t
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
* #ctypedef npy_float80 float80_t
* #ctypedef npy_float128 float128_t
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;
/* "numpy.pxd":743
* # The int types are mapped a bit surprising --
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t # <<<<<<<<<<<<<<
* ctypedef npy_longlong long_t
* ctypedef npy_longlong longlong_t
*/
typedef npy_long __pyx_t_5numpy_int_t;
/* "numpy.pxd":744
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
* ctypedef npy_longlong longlong_t
*
*/
typedef npy_longlong __pyx_t_5numpy_long_t;
/* "numpy.pxd":745
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
*
* ctypedef npy_ulong uint_t
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;
/* "numpy.pxd":747
* ctypedef npy_longlong longlong_t
*
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
* ctypedef npy_ulonglong ulong_t
* ctypedef npy_ulonglong ulonglong_t
*/
typedef npy_ulong __pyx_t_5numpy_uint_t;
/* "numpy.pxd":748
*
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
* ctypedef npy_ulonglong ulonglong_t
*
*/
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
/* "numpy.pxd":749
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
*
* ctypedef npy_intp intp_t
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
/* "numpy.pxd":751
* ctypedef npy_ulonglong ulonglong_t
*
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
* ctypedef npy_uintp uintp_t
*
*/
typedef npy_intp __pyx_t_5numpy_intp_t;
/* "numpy.pxd":752
*
* ctypedef npy_intp intp_t
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
*
* ctypedef npy_double float_t
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;
/* "numpy.pxd":754
* ctypedef npy_uintp uintp_t
*
* ctypedef npy_double float_t # <<<<<<<<<<<<<<
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t
*/
typedef npy_double __pyx_t_5numpy_float_t;
/* "numpy.pxd":755
*
* ctypedef npy_double float_t
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
* ctypedef npy_longdouble longdouble_t
*
*/
typedef npy_double __pyx_t_5numpy_double_t;
/* "numpy.pxd":756
* ctypedef npy_double float_t
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
*
* ctypedef npy_cfloat cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
/* "splitBBox.pyx":36
*
*
* ctypedef numpy.int64_t DTYPE_int64_t # <<<<<<<<<<<<<<
* ctypedef numpy.float64_t DTYPE_float64_t
* ctypedef numpy.float32_t DTYPE_float32_t
*/
typedef __pyx_t_5numpy_int64_t __pyx_t_9splitBBox_DTYPE_int64_t;
/* "splitBBox.pyx":37
*
* ctypedef numpy.int64_t DTYPE_int64_t
* ctypedef numpy.float64_t DTYPE_float64_t # <<<<<<<<<<<<<<
* ctypedef numpy.float32_t DTYPE_float32_t
*
*/
typedef __pyx_t_5numpy_float64_t __pyx_t_9splitBBox_DTYPE_float64_t;
/* "splitBBox.pyx":38
* ctypedef numpy.int64_t DTYPE_int64_t
* ctypedef numpy.float64_t DTYPE_float64_t
* ctypedef numpy.float32_t DTYPE_float32_t # <<<<<<<<<<<<<<
*
*
*/
typedef __pyx_t_5numpy_float32_t __pyx_t_9splitBBox_DTYPE_float32_t;
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< float > __pyx_t_float_complex;
#else
typedef float _Complex __pyx_t_float_complex;
#endif
#else
typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< double > __pyx_t_double_complex;
#else
typedef double _Complex __pyx_t_double_complex;
#endif
#else
typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
/*--- Type declarations ---*/
/* "numpy.pxd":758
* ctypedef npy_longdouble longdouble_t
*
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
* ctypedef npy_cdouble cdouble_t
* ctypedef npy_clongdouble clongdouble_t
*/
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
/* "numpy.pxd":759
*
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
* ctypedef npy_clongdouble clongdouble_t
*
*/
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
/* "numpy.pxd":760
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
*
* ctypedef npy_cdouble complex_t
*/
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
/* "numpy.pxd":762
* ctypedef npy_clongdouble clongdouble_t
*
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew1(a):
*/
typedef npy_cdouble __pyx_t_5numpy_complex_t;
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, int);
void (*DECREF)(void*, PyObject*, int);
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*SetupContext)(const char*, int, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#define __Pyx_RefNannySetupContext(name) __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name)
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XINCREF(r) Py_XINCREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_XGOTREF(r)
#define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name); /*proto*/
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact); /*proto*/
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
#define IS_UNSIGNED(type) (((type) -1) > 0)
/* Run-time type information about structs used with buffers */
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
const char* name; /* for error messages only */
struct __Pyx_StructField_* fields;
size_t size; /* sizeof(type) */
char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject */
char is_unsigned;
int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
__Pyx_TypeInfo* type;
const char* name;
size_t offset;
} __Pyx_StructField;
typedef struct {
__Pyx_StructField* field;
size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
__Pyx_StructField root;
__Pyx_BufFmt_StackElem* head;
size_t fmt_offset;
size_t new_count, enc_count;
int is_complex;
char enc_type;
char new_packmode;
char enc_packmode;
} __Pyx_BufFmt_Context;
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
__Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
/* structs for buffer access */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
size_t refcount;
Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
__Pyx_Buffer *rcbuffer;
char *data;
__Pyx_Buf_DimInfo diminfo[32];
} __Pyx_LocalBuf_ND;
#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
#define __Pyx_GetBuffer PyObject_GetBuffer
#define __Pyx_ReleaseBuffer PyBuffer_Release
#endif
Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
#ifndef __PYX_FORCE_INIT_THREADS
#define __PYX_FORCE_INIT_THREADS 0
#endif
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#define __Pyx_CREAL(z) ((z).real())
#define __Pyx_CIMAG(z) ((z).imag())
#else
#define __Pyx_CREAL(z) (__real__(z))
#define __Pyx_CIMAG(z) (__imag__(z))
#endif
#else
#define __Pyx_CREAL(z) ((z).real)
#define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
#define __Pyx_SET_CREAL(z,x) ((z).real(x))
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
#define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
#define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
#if CYTHON_CCOMPLEX
#define __Pyx_c_eqf(a, b) ((a)==(b))
#define __Pyx_c_sumf(a, b) ((a)+(b))
#define __Pyx_c_difff(a, b) ((a)-(b))
#define __Pyx_c_prodf(a, b) ((a)*(b))
#define __Pyx_c_quotf(a, b) ((a)/(b))
#define __Pyx_c_negf(a) (-(a))
#ifdef __cplusplus
#define __Pyx_c_is_zerof(z) ((z)==(float)0)
#define __Pyx_c_conjf(z) (::std::conj(z))
#if 1
#define __Pyx_c_absf(z) (::std::abs(z))
#define __Pyx_c_powf(a, b) (::std::pow(a, b))
#endif
#else
#define __Pyx_c_is_zerof(z) ((z)==0)
#define __Pyx_c_conjf(z) (conjf(z))
#if 1
#define __Pyx_c_absf(z) (cabsf(z))
#define __Pyx_c_powf(a, b) (cpowf(a, b))
#endif
#endif
#else
static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
#if 1
static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
#endif
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
#if CYTHON_CCOMPLEX
#define __Pyx_c_eq(a, b) ((a)==(b))
#define __Pyx_c_sum(a, b) ((a)+(b))
#define __Pyx_c_diff(a, b) ((a)-(b))
#define __Pyx_c_prod(a, b) ((a)*(b))
#define __Pyx_c_quot(a, b) ((a)/(b))
#define __Pyx_c_neg(a) (-(a))
#ifdef __cplusplus
#define __Pyx_c_is_zero(z) ((z)==(double)0)
#define __Pyx_c_conj(z) (::std::conj(z))
#if 1
#define __Pyx_c_abs(z) (::std::abs(z))
#define __Pyx_c_pow(a, b) (::std::pow(a, b))
#endif
#else
#define __Pyx_c_is_zero(z) ((z)==0)
#define __Pyx_c_conj(z) (conj(z))
#if 1
#define __Pyx_c_abs(z) (cabs(z))
#define __Pyx_c_pow(a, b) (cpow(a, b))
#endif
#endif
#else
static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
#if 1
static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
#endif
#endif
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
static int __Pyx_check_binary_version(void);
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
int __pyx_lineno, const char *__pyx_filename); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from 'cython' */
/* Module declarations from 'cpython.buffer' */
/* Module declarations from 'cpython.ref' */
/* Module declarations from 'libc.stdio' */
/* Module declarations from 'cpython.object' */
/* Module declarations from 'libc.stdlib' */
/* Module declarations from 'numpy' */
/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
/* Module declarations from 'splitBBox' */
static float __pyx_f_9splitBBox_getBinNr(float, float, float); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t = { "DTYPE_float64_t", NULL, sizeof(__pyx_t_9splitBBox_DTYPE_float64_t), 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t = { "DTYPE_float32_t", NULL, sizeof(__pyx_t_9splitBBox_DTYPE_float32_t), 'R', 0, 0 };
#define __Pyx_MODULE_NAME "splitBBox"
int __pyx_module_is_main_splitBBox = 0;
/* Implementation of 'splitBBox' */
static PyObject *__pyx_builtin_min;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static char __pyx_k_12[] = "ndarray is not C contiguous";
static char __pyx_k_14[] = "ndarray is not Fortran contiguous";
static char __pyx_k_16[] = "Non-native byte order not supported";
static char __pyx_k_18[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_19[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_22[] = "Format string allocated too short.";
static char __pyx_k_26[] = "/home/kieffer/workspace-ssd/azimuthal/pyFAI/src/splitBBox.pyx";
static char __pyx_k__B[] = "B";
static char __pyx_k__H[] = "H";
static char __pyx_k__I[] = "I";
static char __pyx_k__L[] = "L";
static char __pyx_k__O[] = "O";
static char __pyx_k__Q[] = "Q";
static char __pyx_k__T[] = "T";
static char __pyx_k__b[] = "b";
static char __pyx_k__d[] = "d";
static char __pyx_k__f[] = "f";
static char __pyx_k__g[] = "g";
static char __pyx_k__h[] = "h";
static char __pyx_k__i[] = "i";
static char __pyx_k__j[] = "j";
static char __pyx_k__l[] = "l";
static char __pyx_k__q[] = "q";
static char __pyx_k__Zd[] = "Zd";
static char __pyx_k__Zf[] = "Zf";
static char __pyx_k__Zg[] = "Zg";
static char __pyx_k__bin[] = "bin";
static char __pyx_k__eps[] = "eps";
static char __pyx_k__idx[] = "idx";
static char __pyx_k__max[] = "max";
static char __pyx_k__min[] = "min";
static char __pyx_k__tmp[] = "tmp";
static char __pyx_k__bins[] = "bins";
static char __pyx_k__data[] = "data";
static char __pyx_k__dpos[] = "dpos";
static char __pyx_k__max0[] = "max0";
static char __pyx_k__max1[] = "max1";
static char __pyx_k__min0[] = "min0";
static char __pyx_k__min1[] = "min1";
static char __pyx_k__pos0[] = "pos0";
static char __pyx_k__pos1[] = "pos1";
static char __pyx_k__size[] = "size";
static char __pyx_k__bins0[] = "bins0";
static char __pyx_k__bins1[] = "bins1";
static char __pyx_k__cdata[] = "cdata";
static char __pyx_k__cpos0[] = "cpos0";
static char __pyx_k__cpos1[] = "cpos1";
static char __pyx_k__dpos0[] = "dpos0";
static char __pyx_k__dpos1[] = "dpos1";
static char __pyx_k__dtype[] = "dtype";
static char __pyx_k__dummy[] = "dummy";
static char __pyx_k__finfo[] = "finfo";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__range[] = "range";
static char __pyx_k__ravel[] = "ravel";
static char __pyx_k__zeros[] = "zeros";
static char __pyx_k__astype[] = "astype";
static char __pyx_k__deltaA[] = "deltaA";
static char __pyx_k__deltaD[] = "deltaD";
static char __pyx_k__deltaL[] = "deltaL";
static char __pyx_k__deltaR[] = "deltaR";
static char __pyx_k__deltaU[] = "deltaU";
static char __pyx_k__edges0[] = "edges0";
static char __pyx_k__edges1[] = "edges1";
static char __pyx_k__outPos[] = "outPos";
static char __pyx_k__epsilon[] = "epsilon";
static char __pyx_k__float32[] = "float32";
static char __pyx_k__float64[] = "float64";
static char __pyx_k__outData[] = "outData";
static char __pyx_k__weights[] = "weights";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__bin0_max[] = "bin0_max";
static char __pyx_k__bin0_min[] = "bin0_min";
static char __pyx_k__bin1_max[] = "bin1_max";
static char __pyx_k__bin1_min[] = "bin1_min";
static char __pyx_k__outCount[] = "outCount";
static char __pyx_k__outMerge[] = "outMerge";
static char __pyx_k__pos0_max[] = "pos0_max";
static char __pyx_k__pos0_min[] = "pos0_min";
static char __pyx_k__pos1_max[] = "pos1_max";
static char __pyx_k__pos1_min[] = "pos1_min";
static char __pyx_k__checkpos1[] = "checkpos1";
static char __pyx_k__cpos0_inf[] = "cpos0_inf";
static char __pyx_k__cpos0_sup[] = "cpos0_sup";
static char __pyx_k__cpos1_inf[] = "cpos1_inf";
static char __pyx_k__cpos1_sup[] = "cpos1_sup";
static char __pyx_k__fbin0_max[] = "fbin0_max";
static char __pyx_k__fbin0_min[] = "fbin0_min";
static char __pyx_k__fbin1_max[] = "fbin1_max";
static char __pyx_k__fbin1_min[] = "fbin1_min";
static char __pyx_k__pos0Range[] = "pos0Range";
static char __pyx_k__pos1Range[] = "pos1Range";
static char __pyx_k__splitBBox[] = "splitBBox";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k__delta_pos0[] = "delta_pos0";
static char __pyx_k__delta_pos1[] = "delta_pos1";
static char __pyx_k__pos0_maxin[] = "pos0_maxin";
static char __pyx_k__pos1_maxin[] = "pos1_maxin";
static char __pyx_k__cdelta_pos0[] = "cdelta_pos0";
static char __pyx_k__cdelta_pos1[] = "cdelta_pos1";
static char __pyx_k__histoBBox1d[] = "histoBBox1d";
static char __pyx_k__histoBBox2d[] = "histoBBox2d";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static PyObject *__pyx_kp_u_12;
static PyObject *__pyx_kp_u_14;
static PyObject *__pyx_kp_u_16;
static PyObject *__pyx_kp_u_18;
static PyObject *__pyx_kp_u_19;
static PyObject *__pyx_kp_u_22;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__T;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__astype;
static PyObject *__pyx_n_s__bin;
static PyObject *__pyx_n_s__bin0_max;
static PyObject *__pyx_n_s__bin0_min;
static PyObject *__pyx_n_s__bin1_max;
static PyObject *__pyx_n_s__bin1_min;
static PyObject *__pyx_n_s__bins;
static PyObject *__pyx_n_s__bins0;
static PyObject *__pyx_n_s__bins1;
static PyObject *__pyx_n_s__cdata;
static PyObject *__pyx_n_s__cdelta_pos0;
static PyObject *__pyx_n_s__cdelta_pos1;
static PyObject *__pyx_n_s__checkpos1;
static PyObject *__pyx_n_s__cpos0;
static PyObject *__pyx_n_s__cpos0_inf;
static PyObject *__pyx_n_s__cpos0_sup;
static PyObject *__pyx_n_s__cpos1;
static PyObject *__pyx_n_s__cpos1_inf;
static PyObject *__pyx_n_s__cpos1_sup;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__deltaA;
static PyObject *__pyx_n_s__deltaD;
static PyObject *__pyx_n_s__deltaL;
static PyObject *__pyx_n_s__deltaR;
static PyObject *__pyx_n_s__deltaU;
static PyObject *__pyx_n_s__delta_pos0;
static PyObject *__pyx_n_s__delta_pos1;
static PyObject *__pyx_n_s__dpos;
static PyObject *__pyx_n_s__dpos0;
static PyObject *__pyx_n_s__dpos1;
static PyObject *__pyx_n_s__dtype;
static PyObject *__pyx_n_s__dummy;
static PyObject *__pyx_n_s__edges0;
static PyObject *__pyx_n_s__edges1;
static PyObject *__pyx_n_s__eps;
static PyObject *__pyx_n_s__epsilon;
static PyObject *__pyx_n_s__fbin0_max;
static PyObject *__pyx_n_s__fbin0_min;
static PyObject *__pyx_n_s__fbin1_max;
static PyObject *__pyx_n_s__fbin1_min;
static PyObject *__pyx_n_s__finfo;
static PyObject *__pyx_n_s__float32;
static PyObject *__pyx_n_s__float64;
static PyObject *__pyx_n_s__histoBBox1d;
static PyObject *__pyx_n_s__histoBBox2d;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__idx;
static PyObject *__pyx_n_s__j;
static PyObject *__pyx_n_s__max;
static PyObject *__pyx_n_s__max0;
static PyObject *__pyx_n_s__max1;
static PyObject *__pyx_n_s__min;
static PyObject *__pyx_n_s__min0;
static PyObject *__pyx_n_s__min1;
static PyObject *__pyx_n_s__numpy;
static PyObject *__pyx_n_s__outCount;
static PyObject *__pyx_n_s__outData;
static PyObject *__pyx_n_s__outMerge;
static PyObject *__pyx_n_s__outPos;
static PyObject *__pyx_n_s__pos0;
static PyObject *__pyx_n_s__pos0Range;
static PyObject *__pyx_n_s__pos0_max;
static PyObject *__pyx_n_s__pos0_maxin;
static PyObject *__pyx_n_s__pos0_min;
static PyObject *__pyx_n_s__pos1;
static PyObject *__pyx_n_s__pos1Range;
static PyObject *__pyx_n_s__pos1_max;
static PyObject *__pyx_n_s__pos1_maxin;
static PyObject *__pyx_n_s__pos1_min;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__ravel;
static PyObject *__pyx_n_s__size;
static PyObject *__pyx_n_s__splitBBox;
static PyObject *__pyx_n_s__tmp;
static PyObject *__pyx_n_s__weights;
static PyObject *__pyx_n_s__zeros;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_15;
static PyObject *__pyx_int_36;
static PyObject *__pyx_int_100;
static PyObject *__pyx_k_tuple_1;
static PyObject *__pyx_k_tuple_2;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_tuple_4;
static PyObject *__pyx_k_tuple_5;
static PyObject *__pyx_k_tuple_6;
static PyObject *__pyx_k_tuple_7;
static PyObject *__pyx_k_tuple_8;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_11;
static PyObject *__pyx_k_tuple_13;
static PyObject *__pyx_k_tuple_15;
static PyObject *__pyx_k_tuple_17;
static PyObject *__pyx_k_tuple_20;
static PyObject *__pyx_k_tuple_21;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_codeobj_25;
static PyObject *__pyx_k_codeobj_28;
/* "splitBBox.pyx":42
*
* @cython.cdivision(True)
* cdef float getBinNr(float x0, float pos0_min, float dpos) nogil: # <<<<<<<<<<<<<<
* """
* calculate the bin number for any point
*/
static float __pyx_f_9splitBBox_getBinNr(float __pyx_v_x0, float __pyx_v_pos0_min, float __pyx_v_dpos) {
float __pyx_r;
/* "splitBBox.pyx":49
* param dpos: bin width
* """
* return (x0 - pos0_min) / dpos # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = ((__pyx_v_x0 - __pyx_v_pos0_min) / __pyx_v_dpos);
goto __pyx_L0;
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}
/* "splitBBox.pyx":55
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def histoBBox1d(numpy.ndarray weights not None, # <<<<<<<<<<<<<<
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
*/
static PyObject *__pyx_pf_9splitBBox_histoBBox1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9splitBBox_histoBBox1d[] = "\n Calculates histogram of pos0 (tth) weighted by weights\n \n Splitting is done on the pixel's bounding box like fit2D\n \n @param weights: array with intensities\n @param pos0: 1D array with pos0: tth or q_vect\n @param delta_pos0: 1D array with delta pos0: max center-corner distance\n @param pos1: 1D array with pos1: chi\n @param delta_pos1: 1D array with max pos1: max center-corner distance, unused ! \n @param bins: number of output bins\n @param pos0Range: minimum and maximum of the 2th range\n @param pos1Range: minimum and maximum of the chi range\n @param dummy: value for bins without pixels \n @return 2theta, I, weighted histogram, unweighted histogram\n ";
static PyMethodDef __pyx_mdef_9splitBBox_histoBBox1d = {__Pyx_NAMESTR("histoBBox1d"), (PyCFunction)__pyx_pf_9splitBBox_histoBBox1d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9splitBBox_histoBBox1d)};
static PyObject *__pyx_pf_9splitBBox_histoBBox1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *__pyx_v_weights = 0;
PyArrayObject *__pyx_v_pos0 = 0;
PyArrayObject *__pyx_v_delta_pos0 = 0;
PyObject *__pyx_v_pos1 = 0;
PyObject *__pyx_v_delta_pos1 = 0;
long __pyx_v_bins;
PyObject *__pyx_v_pos0Range = 0;
PyObject *__pyx_v_pos1Range = 0;
float __pyx_v_dummy;
long __pyx_v_size;
PyArrayObject *__pyx_v_cdata = 0;
PyArrayObject *__pyx_v_cpos0_inf = 0;
PyArrayObject *__pyx_v_cpos0_sup = 0;
PyArrayObject *__pyx_v_cpos1_inf = 0;
PyArrayObject *__pyx_v_cpos1_sup = 0;
PyArrayObject *__pyx_v_outData = 0;
PyArrayObject *__pyx_v_outCount = 0;
PyArrayObject *__pyx_v_outMerge = 0;
PyArrayObject *__pyx_v_outPos = 0;
float __pyx_v_deltaR;
float __pyx_v_deltaL;
float __pyx_v_deltaA;
float __pyx_v_pos0_min;
float __pyx_v_pos0_max;
float __pyx_v_pos0_maxin;
float __pyx_v_pos1_min;
float __pyx_v_pos1_max;
float __pyx_v_pos1_maxin;
float __pyx_v_min0;
float __pyx_v_max0;
float __pyx_v_fbin0_min;
float __pyx_v_fbin0_max;
int __pyx_v_checkpos1;
float __pyx_v_dpos;
CYTHON_UNUSED long __pyx_v_bin;
long __pyx_v_i;
long __pyx_v_idx;
long __pyx_v_bin0_max;
long __pyx_v_bin0_min;
double __pyx_v_epsilon;
double __pyx_v_data;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
__Pyx_Buffer __pyx_pybuffer_outMerge;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_inf;
__Pyx_Buffer __pyx_pybuffer_cpos0_inf;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outPos;
__Pyx_Buffer __pyx_pybuffer_outPos;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_sup;
__Pyx_Buffer __pyx_pybuffer_cpos0_sup;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_sup;
__Pyx_Buffer __pyx_pybuffer_cpos1_sup;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
__Pyx_Buffer __pyx_pybuffer_outCount;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cdata;
__Pyx_Buffer __pyx_pybuffer_cdata;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
__Pyx_Buffer __pyx_pybuffer_outData;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_inf;
__Pyx_Buffer __pyx_pybuffer_cpos1_inf;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
long __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyArrayObject *__pyx_t_6 = NULL;
PyArrayObject *__pyx_t_7 = NULL;
PyArrayObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyArrayObject *__pyx_t_10 = NULL;
PyArrayObject *__pyx_t_11 = NULL;
PyArrayObject *__pyx_t_12 = NULL;
PyArrayObject *__pyx_t_13 = NULL;
Py_ssize_t __pyx_t_14;
int __pyx_t_15;
int __pyx_t_16;
float __pyx_t_17;
PyArrayObject *__pyx_t_18 = NULL;
int __pyx_t_19;
PyObject *__pyx_t_20 = NULL;
PyObject *__pyx_t_21 = NULL;
PyObject *__pyx_t_22 = NULL;
PyArrayObject *__pyx_t_23 = NULL;
long __pyx_t_24;
long __pyx_t_25;
long __pyx_t_26;
long __pyx_t_27;
long __pyx_t_28;
long __pyx_t_29;
long __pyx_t_30;
long __pyx_t_31;
long __pyx_t_32;
long __pyx_t_33;
long __pyx_t_34;
long __pyx_t_35;
long __pyx_t_36;
long __pyx_t_37;
long __pyx_t_38;
long __pyx_t_39;
long __pyx_t_40;
long __pyx_t_41;
long __pyx_t_42;
long __pyx_t_43;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__weights,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__dummy,0};
__Pyx_RefNannySetupContext("histoBBox1d");
__pyx_self = __pyx_self;
{
PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
/* "splitBBox.pyx":58
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
* pos1=None, # <<<<<<<<<<<<<<
* delta_pos1=None,
* long bins=100,
*/
values[3] = ((PyObject *)Py_None);
/* "splitBBox.pyx":59
* numpy.ndarray delta_pos0 not None,
* pos1=None,
* delta_pos1=None, # <<<<<<<<<<<<<<
* long bins=100,
* pos0Range=None,
*/
values[4] = ((PyObject *)Py_None);
/* "splitBBox.pyx":61
* delta_pos1=None,
* long bins=100,
* pos0Range=None, # <<<<<<<<<<<<<<
* pos1Range=None,
* float dummy=0.0
*/
values[6] = ((PyObject *)Py_None);
/* "splitBBox.pyx":62
* long bins=100,
* pos0Range=None,
* pos1Range=None, # <<<<<<<<<<<<<<
* float dummy=0.0
* ):
*/
values[7] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights);
if (likely(values[0])) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0);
if (likely(values[1])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0);
if (likely(values[2])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1);
if (value) { values[4] = value; kw_args--; }
}
case 5:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
if (value) { values[5] = value; kw_args--; }
}
case 6:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
if (value) { values[6] = value; kw_args--; }
}
case 7:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
if (value) { values[7] = value; kw_args--; }
}
case 8:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
if (value) { values[8] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histoBBox1d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_v_weights = ((PyArrayObject *)values[0]);
__pyx_v_pos0 = ((PyArrayObject *)values[1]);
__pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
__pyx_v_pos1 = values[3];
__pyx_v_delta_pos1 = values[4];
if (values[5]) {
__pyx_v_bins = __Pyx_PyInt_AsLong(values[5]); if (unlikely((__pyx_v_bins == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_bins = ((long)100);
}
__pyx_v_pos0Range = values[6];
__pyx_v_pos1Range = values[7];
if (values[8]) {
__pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
/* "splitBBox.pyx":63
* pos0Range=None,
* pos1Range=None,
* float dummy=0.0 # <<<<<<<<<<<<<<
* ):
* """
*/
__pyx_v_dummy = ((float)0.0);
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_weights = ((PyArrayObject *)values[0]);
__pyx_v_pos0 = ((PyArrayObject *)values[1]);
__pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
__pyx_v_pos1 = values[3];
__pyx_v_delta_pos1 = values[4];
if (values[5]) {
__pyx_v_bins = __Pyx_PyInt_AsLong(values[5]); if (unlikely((__pyx_v_bins == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_bins = ((long)100);
}
__pyx_v_pos0Range = values[6];
__pyx_v_pos1Range = values[7];
if (values[8]) {
__pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_dummy = ((float)0.0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("histoBBox1d", 0, 3, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("splitBBox.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_pybuffer_cdata.pybuffer.buf = NULL;
__pyx_pybuffer_cdata.refcount = 0;
__pyx_pybuffernd_cdata.data = NULL;
__pyx_pybuffernd_cdata.rcbuffer = &__pyx_pybuffer_cdata;
__pyx_pybuffer_cpos0_inf.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0_inf.refcount = 0;
__pyx_pybuffernd_cpos0_inf.data = NULL;
__pyx_pybuffernd_cpos0_inf.rcbuffer = &__pyx_pybuffer_cpos0_inf;
__pyx_pybuffer_cpos0_sup.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0_sup.refcount = 0;
__pyx_pybuffernd_cpos0_sup.data = NULL;
__pyx_pybuffernd_cpos0_sup.rcbuffer = &__pyx_pybuffer_cpos0_sup;
__pyx_pybuffer_cpos1_inf.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1_inf.refcount = 0;
__pyx_pybuffernd_cpos1_inf.data = NULL;
__pyx_pybuffernd_cpos1_inf.rcbuffer = &__pyx_pybuffer_cpos1_inf;
__pyx_pybuffer_cpos1_sup.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1_sup.refcount = 0;
__pyx_pybuffernd_cpos1_sup.data = NULL;
__pyx_pybuffernd_cpos1_sup.rcbuffer = &__pyx_pybuffer_cpos1_sup;
__pyx_pybuffer_outData.pybuffer.buf = NULL;
__pyx_pybuffer_outData.refcount = 0;
__pyx_pybuffernd_outData.data = NULL;
__pyx_pybuffernd_outData.rcbuffer = &__pyx_pybuffer_outData;
__pyx_pybuffer_outCount.pybuffer.buf = NULL;
__pyx_pybuffer_outCount.refcount = 0;
__pyx_pybuffernd_outCount.data = NULL;
__pyx_pybuffernd_outCount.rcbuffer = &__pyx_pybuffer_outCount;
__pyx_pybuffer_outMerge.pybuffer.buf = NULL;
__pyx_pybuffer_outMerge.refcount = 0;
__pyx_pybuffernd_outMerge.data = NULL;
__pyx_pybuffernd_outMerge.rcbuffer = &__pyx_pybuffer_outMerge;
__pyx_pybuffer_outPos.pybuffer.buf = NULL;
__pyx_pybuffer_outPos.refcount = 0;
__pyx_pybuffernd_outPos.data = NULL;
__pyx_pybuffernd_outPos.rcbuffer = &__pyx_pybuffer_outPos;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 0, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos0), __pyx_ptype_5numpy_ndarray, 0, "pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_delta_pos0), __pyx_ptype_5numpy_ndarray, 0, "delta_pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "splitBBox.pyx":81
* @return 2theta, I, weighted histogram, unweighted histogram
* """
* cdef long size = weights.size # <<<<<<<<<<<<<<
* assert pos0.size == size
* assert delta_pos0.size == size
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_size = __pyx_t_2;
/* "splitBBox.pyx":82
* """
* cdef long size = weights.size
* assert pos0.size == size # <<<<<<<<<<<<<<
* assert delta_pos0.size == size
* assert bins > 1
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
/* "splitBBox.pyx":83
* cdef long size = weights.size
* assert pos0.size == size
* assert delta_pos0.size == size # <<<<<<<<<<<<<<
* assert bins > 1
*
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
/* "splitBBox.pyx":84
* assert pos0.size == size
* assert delta_pos0.size == size
* assert bins > 1 # <<<<<<<<<<<<<<
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!(__pyx_v_bins > 1))) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
/* "splitBBox.pyx":86
* assert bins > 1
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cdata = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cdata.diminfo[0].strides = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdata.diminfo[0].shape = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_6 = 0;
__pyx_v_cdata = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":87
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
*/
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0_inf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0_inf.diminfo[0].strides = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_inf.diminfo[0].shape = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_7 = 0;
__pyx_v_cpos0_inf = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":88
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = (pos0.ravel() - delta_pos0.ravel()).astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = (pos0.ravel() + delta_pos0.ravel()).astype("float32") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup
*/
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0_sup = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0_sup.diminfo[0].strides = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_sup.diminfo[0].shape = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_8 = 0;
__pyx_v_cpos0_sup = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":92
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
*/
__pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_10 = ((PyArrayObject *)__pyx_t_9);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_outData = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outData.diminfo[0].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outData.diminfo[0].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_10 = 0;
__pyx_v_outData = ((PyArrayObject *)__pyx_t_9);
__pyx_t_9 = 0;
/* "splitBBox.pyx":93
*
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32")
*/
__pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
__pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_9));
if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_outCount = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outCount.diminfo[0].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outCount.diminfo[0].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_11 = 0;
__pyx_v_outCount = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "splitBBox.pyx":94
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outData = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32")
* cdef float deltaR, deltaL, deltaA
*/
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_outMerge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outMerge.diminfo[0].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMerge.diminfo[0].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_12 = 0;
__pyx_v_outMerge = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":95
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] outCount = numpy.zeros(bins, dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outMerge = numpy.zeros(bins, dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] outPos = numpy.zeros(bins, dtype="float32") # <<<<<<<<<<<<<<
* cdef float deltaR, deltaL, deltaA
* cdef float pos0_min, pos0_max, pos0_maxin, pos1_min, pos1_max, pos1_maxin, min0, max0, fbin0_min, fbin0_max
*/
__pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_13 = ((PyArrayObject *)__pyx_t_9);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_outPos = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outPos.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outPos.diminfo[0].strides = __pyx_pybuffernd_outPos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outPos.diminfo[0].shape = __pyx_pybuffernd_outPos.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_13 = 0;
__pyx_v_outPos = ((PyArrayObject *)__pyx_t_9);
__pyx_t_9 = 0;
/* "splitBBox.pyx":98
* cdef float deltaR, deltaL, deltaA
* cdef float pos0_min, pos0_max, pos0_maxin, pos1_min, pos1_max, pos1_maxin, min0, max0, fbin0_min, fbin0_max
* cdef int checkpos1 = 0 # <<<<<<<<<<<<<<
*
* if pos0Range is not None and len(pos0Range) > 1:
*/
__pyx_v_checkpos1 = 0;
/* "splitBBox.pyx":100
* cdef int checkpos1 = 0
*
* if pos0Range is not None and len(pos0Range) > 1: # <<<<<<<<<<<<<<
* pos0_min = min(pos0Range)
* if pos0_min < 0.0:
*/
__pyx_t_5 = (__pyx_v_pos0Range != Py_None);
if (__pyx_t_5) {
__pyx_t_14 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_15 = (__pyx_t_14 > 1);
__pyx_t_16 = __pyx_t_15;
} else {
__pyx_t_16 = __pyx_t_5;
}
if (__pyx_t_16) {
/* "splitBBox.pyx":101
*
* if pos0Range is not None and len(pos0Range) > 1:
* pos0_min = min(pos0Range) # <<<<<<<<<<<<<<
* if pos0_min < 0.0:
* pos0_min = 0.0
*/
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_pos0Range);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_pos0Range);
__Pyx_GIVEREF(__pyx_v_pos0Range);
__pyx_t_3 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos0_min = __pyx_t_17;
/* "splitBBox.pyx":102
* if pos0Range is not None and len(pos0Range) > 1:
* pos0_min = min(pos0Range)
* if pos0_min < 0.0: # <<<<<<<<<<<<<<
* pos0_min = 0.0
* pos0_maxin = max(pos0Range)
*/
__pyx_t_16 = (__pyx_v_pos0_min < 0.0);
if (__pyx_t_16) {
/* "splitBBox.pyx":103
* pos0_min = min(pos0Range)
* if pos0_min < 0.0:
* pos0_min = 0.0 # <<<<<<<<<<<<<<
* pos0_maxin = max(pos0Range)
* else:
*/
__pyx_v_pos0_min = 0.0;
goto __pyx_L7;
}
__pyx_L7:;
/* "splitBBox.pyx":104
* if pos0_min < 0.0:
* pos0_min = 0.0
* pos0_maxin = max(pos0Range) # <<<<<<<<<<<<<<
* else:
* pos0_min = cpos0_inf.min()
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_pos0Range);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos0Range);
__Pyx_GIVEREF(__pyx_v_pos0Range);
__pyx_t_9 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_pos0_maxin = __pyx_t_17;
goto __pyx_L6;
}
/*else*/ {
/* "splitBBox.pyx":106
* pos0_maxin = max(pos0Range)
* else:
* pos0_min = cpos0_inf.min() # <<<<<<<<<<<<<<
* pos0_maxin = cpos0_sup.max()
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*/
__pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_inf), __pyx_n_s__min); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos0_min = __pyx_t_17;
/* "splitBBox.pyx":107
* else:
* pos0_min = cpos0_inf.min()
* pos0_maxin = cpos0_sup.max() # <<<<<<<<<<<<<<
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
*/
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_sup), __pyx_n_s__max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_pos0_maxin = __pyx_t_17;
}
__pyx_L6:;
/* "splitBBox.pyx":108
* pos0_min = cpos0_inf.min()
* pos0_maxin = cpos0_sup.max()
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps) # <<<<<<<<<<<<<<
*
* if pos1Range is not None and len(pos1Range) > 1:
*/
__pyx_t_9 = PyFloat_FromDouble(__pyx_v_pos0_maxin); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__finfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__eps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyNumber_Add(__pyx_int_1, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Multiply(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos0_max = __pyx_t_17;
/* "splitBBox.pyx":110
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
* if pos1Range is not None and len(pos1Range) > 1: # <<<<<<<<<<<<<<
* assert pos1.size == size
* assert delta_pos1.size == size
*/
__pyx_t_16 = (__pyx_v_pos1Range != Py_None);
if (__pyx_t_16) {
__pyx_t_14 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_5 = (__pyx_t_14 > 1);
__pyx_t_15 = __pyx_t_5;
} else {
__pyx_t_15 = __pyx_t_16;
}
if (__pyx_t_15) {
/* "splitBBox.pyx":111
*
* if pos1Range is not None and len(pos1Range) > 1:
* assert pos1.size == size # <<<<<<<<<<<<<<
* assert delta_pos1.size == size
* checkpos1 = 1
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_3 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_15)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
/* "splitBBox.pyx":112
* if pos1Range is not None and len(pos1Range) > 1:
* assert pos1.size == size
* assert delta_pos1.size == size # <<<<<<<<<<<<<<
* checkpos1 = 1
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_9 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_1 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_15)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
/* "splitBBox.pyx":113
* assert pos1.size == size
* assert delta_pos1.size == size
* checkpos1 = 1 # <<<<<<<<<<<<<<
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
*/
__pyx_v_checkpos1 = 1;
/* "splitBBox.pyx":114
* assert delta_pos1.size == size
* checkpos1 = 1
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32") # <<<<<<<<<<<<<<
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
* pos1_min = min(pos1Range)
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_18 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
if (unlikely(__pyx_t_19 < 0)) {
PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer, (PyObject*)__pyx_v_cpos1_inf, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
__Pyx_RaiseBufferFallbackError();
} else {
PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
}
}
__pyx_pybuffernd_cpos1_inf.diminfo[0].strides = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_inf.diminfo[0].shape = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.shape[0];
if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_18 = 0;
__pyx_v_cpos1_inf = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":115
* checkpos1 = 1
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32") # <<<<<<<<<<<<<<
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range)
*/
__pyx_t_3 = PyObject_GetAttr(__pyx_v_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_GetAttr(__pyx_v_delta_pos1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_23 = ((PyArrayObject *)__pyx_t_3);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
if (unlikely(__pyx_t_19 < 0)) {
PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer, (PyObject*)__pyx_v_cpos1_sup, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
__Pyx_RaiseBufferFallbackError();
} else {
PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
}
}
__pyx_pybuffernd_cpos1_sup.diminfo[0].strides = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_sup.diminfo[0].shape = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.shape[0];
if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_23 = 0;
__pyx_v_cpos1_sup = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "splitBBox.pyx":116
* cpos1_inf = (pos1.ravel() - delta_pos1.ravel()).astype("float32")
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
* pos1_min = min(pos1Range) # <<<<<<<<<<<<<<
* pos1_maxin = max(pos1Range)
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_pos1Range);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos1Range);
__Pyx_GIVEREF(__pyx_v_pos1Range);
__pyx_t_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos1_min = __pyx_t_17;
/* "splitBBox.pyx":117
* cpos1_sup = (pos1.ravel() + delta_pos1.ravel()).astype("float32")
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range) # <<<<<<<<<<<<<<
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_pos1Range);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos1Range);
__Pyx_GIVEREF(__pyx_v_pos1Range);
__pyx_t_3 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos1_maxin = __pyx_t_17;
/* "splitBBox.pyx":118
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range)
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps) # <<<<<<<<<<<<<<
*
* cdef float dpos = (pos0_max - pos0_min) / (< float > (bins))
*/
__pyx_t_3 = PyFloat_FromDouble(__pyx_v_pos1_maxin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__finfo); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__eps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyNumber_Add(__pyx_int_1, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos1_max = __pyx_t_17;
goto __pyx_L8;
}
__pyx_L8:;
/* "splitBBox.pyx":120
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
* cdef float dpos = (pos0_max - pos0_min) / (< float > (bins)) # <<<<<<<<<<<<<<
* cdef long bin = 0
* cdef long i, idx
*/
__pyx_v_dpos = ((__pyx_v_pos0_max - __pyx_v_pos0_min) / ((float)__pyx_v_bins));
/* "splitBBox.pyx":121
*
* cdef float dpos = (pos0_max - pos0_min) / (< float > (bins))
* cdef long bin = 0 # <<<<<<<<<<<<<<
* cdef long i, idx
* cdef long bin0_max, bin0_min
*/
__pyx_v_bin = 0;
/* "splitBBox.pyx":124
* cdef long i, idx
* cdef long bin0_max, bin0_min
* cdef double epsilon = 1e-10 # <<<<<<<<<<<<<<
*
* with nogil:
*/
__pyx_v_epsilon = 1e-10;
/* "splitBBox.pyx":126
* cdef double epsilon = 1e-10
*
* with nogil: # <<<<<<<<<<<<<<
* for i in range(bins):
* outPos[i] = pos0_min + (0.5 +< float > i) * dpos
*/
{
#ifdef WITH_THREAD
PyThreadState *_save = NULL;
#endif
Py_UNBLOCK_THREADS
/*try:*/ {
/* "splitBBox.pyx":127
*
* with nogil:
* for i in range(bins): # <<<<<<<<<<<<<<
* outPos[i] = pos0_min + (0.5 +< float > i) * dpos
*
*/
__pyx_t_2 = __pyx_v_bins;
for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_2; __pyx_t_24+=1) {
__pyx_v_i = __pyx_t_24;
/* "splitBBox.pyx":128
* with nogil:
* for i in range(bins):
* outPos[i] = pos0_min + (0.5 +< float > i) * dpos # <<<<<<<<<<<<<<
*
* for idx in range(size):
*/
__pyx_t_25 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outPos.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_outPos.diminfo[0].strides) = (__pyx_v_pos0_min + ((0.5 + ((float)__pyx_v_i)) * __pyx_v_dpos));
}
/* "splitBBox.pyx":130
* outPos[i] = pos0_min + (0.5 +< float > i) * dpos
*
* for idx in range(size): # <<<<<<<<<<<<<<
* data = < double > cdata[idx]
* min0 = cpos0_inf[idx]
*/
__pyx_t_2 = __pyx_v_size;
for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_2; __pyx_t_24+=1) {
__pyx_v_idx = __pyx_t_24;
/* "splitBBox.pyx":131
*
* for idx in range(size):
* data = < double > cdata[idx] # <<<<<<<<<<<<<<
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx]
*/
__pyx_t_26 = __pyx_v_idx;
__pyx_v_data = ((double)(*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_cdata.diminfo[0].strides)));
/* "splitBBox.pyx":132
* for idx in range(size):
* data = < double > cdata[idx]
* min0 = cpos0_inf[idx] # <<<<<<<<<<<<<<
* max0 = cpos0_sup[idx]
* if checkpos1:
*/
__pyx_t_27 = __pyx_v_idx;
__pyx_v_min0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_cpos0_inf.diminfo[0].strides));
/* "splitBBox.pyx":133
* data = < double > cdata[idx]
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx] # <<<<<<<<<<<<<<
* if checkpos1:
* if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max):
*/
__pyx_t_28 = __pyx_v_idx;
__pyx_v_max0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_cpos0_sup.diminfo[0].strides));
/* "splitBBox.pyx":134
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx]
* if checkpos1: # <<<<<<<<<<<<<<
* if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max):
* continue
*/
if (__pyx_v_checkpos1) {
/* "splitBBox.pyx":135
* max0 = cpos0_sup[idx]
* if checkpos1:
* if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max): # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_t_29 = __pyx_v_idx;
__pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_cpos1_inf.diminfo[0].strides)) < __pyx_v_pos1_min);
if (!__pyx_t_15) {
__pyx_t_30 = __pyx_v_idx;
__pyx_t_16 = ((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_cpos1_sup.diminfo[0].strides)) > __pyx_v_pos1_max);
__pyx_t_5 = __pyx_t_16;
} else {
__pyx_t_5 = __pyx_t_15;
}
if (__pyx_t_5) {
/* "splitBBox.pyx":136
* if checkpos1:
* if (cpos1_inf[idx] < pos1_min) or (cpos1_sup[idx] > pos1_max):
* continue # <<<<<<<<<<<<<<
*
* fbin0_min = getBinNr(min0, pos0_min, dpos)
*/
goto __pyx_L14_continue;
goto __pyx_L17;
}
__pyx_L17:;
goto __pyx_L16;
}
__pyx_L16:;
/* "splitBBox.pyx":138
* continue
*
* fbin0_min = getBinNr(min0, pos0_min, dpos) # <<<<<<<<<<<<<<
* fbin0_max = getBinNr(max0, pos0_min, dpos)
* bin0_min = < long > floor(fbin0_min)
*/
__pyx_v_fbin0_min = __pyx_f_9splitBBox_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_dpos);
/* "splitBBox.pyx":139
*
* fbin0_min = getBinNr(min0, pos0_min, dpos)
* fbin0_max = getBinNr(max0, pos0_min, dpos) # <<<<<<<<<<<<<<
* bin0_min = < long > floor(fbin0_min)
* bin0_max = < long > floor(fbin0_max)
*/
__pyx_v_fbin0_max = __pyx_f_9splitBBox_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_dpos);
/* "splitBBox.pyx":140
* fbin0_min = getBinNr(min0, pos0_min, dpos)
* fbin0_max = getBinNr(max0, pos0_min, dpos)
* bin0_min = < long > floor(fbin0_min) # <<<<<<<<<<<<<<
* bin0_max = < long > floor(fbin0_max)
*
*/
__pyx_v_bin0_min = ((long)floor(__pyx_v_fbin0_min));
/* "splitBBox.pyx":141
* fbin0_max = getBinNr(max0, pos0_min, dpos)
* bin0_min = < long > floor(fbin0_min)
* bin0_max = < long > floor(fbin0_max) # <<<<<<<<<<<<<<
*
* if bin0_min == bin0_max:
*/
__pyx_v_bin0_max = ((long)floor(__pyx_v_fbin0_max));
/* "splitBBox.pyx":143
* bin0_max = < long > floor(fbin0_max)
*
* if bin0_min == bin0_max: # <<<<<<<<<<<<<<
* #All pixel is within a single bin
* outCount[bin0_min] += < double > 1.0
*/
__pyx_t_5 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
if (__pyx_t_5) {
/* "splitBBox.pyx":145
* if bin0_min == bin0_max:
* #All pixel is within a single bin
* outCount[bin0_min] += < double > 1.0 # <<<<<<<<<<<<<<
* outData[bin0_min] += < double > data
*
*/
__pyx_t_31 = __pyx_v_bin0_min;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_outCount.diminfo[0].strides) += ((double)1.0);
/* "splitBBox.pyx":146
* #All pixel is within a single bin
* outCount[bin0_min] += < double > 1.0
* outData[bin0_min] += < double > data # <<<<<<<<<<<<<<
*
* else: #we have pixel spliting.
*/
__pyx_t_32 = __pyx_v_bin0_min;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_outData.diminfo[0].strides) += ((double)__pyx_v_data);
goto __pyx_L18;
}
/*else*/ {
/* "splitBBox.pyx":149
*
* else: #we have pixel spliting.
* deltaA = 1.0 / (fbin0_max - fbin0_min) # <<<<<<<<<<<<<<
*
* deltaL = < float > (bin0_min + 1) - fbin0_min
*/
__pyx_v_deltaA = (1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min));
/* "splitBBox.pyx":151
* deltaA = 1.0 / (fbin0_max - fbin0_min)
*
* deltaL = < float > (bin0_min + 1) - fbin0_min # <<<<<<<<<<<<<<
* deltaR = fbin0_max - (< float > bin0_max)
*
*/
__pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);
/* "splitBBox.pyx":152
*
* deltaL = < float > (bin0_min + 1) - fbin0_min
* deltaR = fbin0_max - (< float > bin0_max) # <<<<<<<<<<<<<<
*
* outCount[bin0_min] += < double > deltaA * deltaL
*/
__pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));
/* "splitBBox.pyx":154
* deltaR = fbin0_max - (< float > bin0_max)
*
* outCount[bin0_min] += < double > deltaA * deltaL # <<<<<<<<<<<<<<
* outData[bin0_min] += < double > data * deltaA * deltaL
*
*/
__pyx_t_33 = __pyx_v_bin0_min;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_outCount.diminfo[0].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaL);
/* "splitBBox.pyx":155
*
* outCount[bin0_min] += < double > deltaA * deltaL
* outData[bin0_min] += < double > data * deltaA * deltaL # <<<<<<<<<<<<<<
*
* outCount[bin0_max] += < double > deltaA * deltaR
*/
__pyx_t_34 = __pyx_v_bin0_min;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_outData.diminfo[0].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL);
/* "splitBBox.pyx":157
* outData[bin0_min] += < double > data * deltaA * deltaL
*
* outCount[bin0_max] += < double > deltaA * deltaR # <<<<<<<<<<<<<<
* outData[bin0_max] += < double > data * deltaA * deltaR
*
*/
__pyx_t_35 = __pyx_v_bin0_max;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_outCount.diminfo[0].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaR);
/* "splitBBox.pyx":158
*
* outCount[bin0_max] += < double > deltaA * deltaR
* outData[bin0_max] += < double > data * deltaA * deltaR # <<<<<<<<<<<<<<
*
* if bin0_min + 1 < bin0_max:
*/
__pyx_t_36 = __pyx_v_bin0_max;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_outData.diminfo[0].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR);
/* "splitBBox.pyx":160
* outData[bin0_max] += < double > data * deltaA * deltaR
*
* if bin0_min + 1 < bin0_max: # <<<<<<<<<<<<<<
* for i in range(bin0_min + 1, bin0_max):
* outCount[i] += < double > deltaA
*/
__pyx_t_5 = ((__pyx_v_bin0_min + 1) < __pyx_v_bin0_max);
if (__pyx_t_5) {
/* "splitBBox.pyx":161
*
* if bin0_min + 1 < bin0_max:
* for i in range(bin0_min + 1, bin0_max): # <<<<<<<<<<<<<<
* outCount[i] += < double > deltaA
* outData[i] += data * < double > deltaA
*/
__pyx_t_37 = __pyx_v_bin0_max;
for (__pyx_t_38 = (__pyx_v_bin0_min + 1); __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
__pyx_v_i = __pyx_t_38;
/* "splitBBox.pyx":162
* if bin0_min + 1 < bin0_max:
* for i in range(bin0_min + 1, bin0_max):
* outCount[i] += < double > deltaA # <<<<<<<<<<<<<<
* outData[i] += data * < double > deltaA
*
*/
__pyx_t_39 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_outCount.diminfo[0].strides) += ((double)__pyx_v_deltaA);
/* "splitBBox.pyx":163
* for i in range(bin0_min + 1, bin0_max):
* outCount[i] += < double > deltaA
* outData[i] += data * < double > deltaA # <<<<<<<<<<<<<<
*
* for i in range(bins):
*/
__pyx_t_40 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_outData.diminfo[0].strides) += (__pyx_v_data * ((double)__pyx_v_deltaA));
}
goto __pyx_L19;
}
__pyx_L19:;
}
__pyx_L18:;
__pyx_L14_continue:;
}
/* "splitBBox.pyx":165
* outData[i] += data * < double > deltaA
*
* for i in range(bins): # <<<<<<<<<<<<<<
* if outCount[i] > epsilon:
* outMerge[i] = < float > (outData[i] / outCount[i])
*/
__pyx_t_2 = __pyx_v_bins;
for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_2; __pyx_t_24+=1) {
__pyx_v_i = __pyx_t_24;
/* "splitBBox.pyx":166
*
* for i in range(bins):
* if outCount[i] > epsilon: # <<<<<<<<<<<<<<
* outMerge[i] = < float > (outData[i] / outCount[i])
* else:
*/
__pyx_t_37 = __pyx_v_i;
__pyx_t_5 = ((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_outCount.diminfo[0].strides)) > __pyx_v_epsilon);
if (__pyx_t_5) {
/* "splitBBox.pyx":167
* for i in range(bins):
* if outCount[i] > epsilon:
* outMerge[i] = < float > (outData[i] / outCount[i]) # <<<<<<<<<<<<<<
* else:
* outMerge[i] = dummy
*/
__pyx_t_38 = __pyx_v_i;
__pyx_t_41 = __pyx_v_i;
__pyx_t_42 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_outMerge.diminfo[0].strides) = ((float)((*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_outData.diminfo[0].strides)) / (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_outCount.diminfo[0].strides))));
goto __pyx_L24;
}
/*else*/ {
/* "splitBBox.pyx":169
* outMerge[i] = < float > (outData[i] / outCount[i])
* else:
* outMerge[i] = dummy # <<<<<<<<<<<<<<
*
* return outPos, outMerge, outData, outCount
*/
__pyx_t_43 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_outMerge.diminfo[0].strides) = __pyx_v_dummy;
}
__pyx_L24:;
}
}
/* "splitBBox.pyx":126
* cdef double epsilon = 1e-10
*
* with nogil: # <<<<<<<<<<<<<<
* for i in range(bins):
* outPos[i] = pos0_min + (0.5 +< float > i) * dpos
*/
/*finally:*/ {
Py_BLOCK_THREADS
}
}
/* "splitBBox.pyx":171
* outMerge[i] = dummy
*
* return outPos, outMerge, outData, outCount # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_outPos));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_outPos));
__Pyx_GIVEREF(((PyObject *)__pyx_v_outPos));
__Pyx_INCREF(((PyObject *)__pyx_v_outMerge));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_outMerge));
__Pyx_GIVEREF(((PyObject *)__pyx_v_outMerge));
__Pyx_INCREF(((PyObject *)__pyx_v_outData));
PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_outData));
__Pyx_GIVEREF(((PyObject *)__pyx_v_outData));
__Pyx_INCREF(((PyObject *)__pyx_v_outCount));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_outCount));
__Pyx_GIVEREF(((PyObject *)__pyx_v_outCount));
__pyx_r = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_9);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("splitBBox.histoBBox1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outPos.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_cdata);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0_inf);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0_sup);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1_inf);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1_sup);
__Pyx_XDECREF((PyObject *)__pyx_v_outData);
__Pyx_XDECREF((PyObject *)__pyx_v_outCount);
__Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
__Pyx_XDECREF((PyObject *)__pyx_v_outPos);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "splitBBox.pyx":179
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def histoBBox2d(numpy.ndarray weights not None, # <<<<<<<<<<<<<<
* numpy.ndarray pos0 not None,
* numpy.ndarray delta_pos0 not None,
*/
static PyObject *__pyx_pf_9splitBBox_1histoBBox2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9splitBBox_1histoBBox2d[] = "\n Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights\n \n Splitting is done on the pixel's bounding box like fit2D\n \n\n @param weights: array with intensities\n @param pos0: 1D array with pos0: tth or q_vect\n @param delta_pos0: 1D array with delta pos0: max center-corner distance\n @param pos1: 1D array with pos1: chi\n @param delta_pos1: 1D array with max pos1: max center-corner distance, unused ! \n @param bins: number of output bins (tth=100, chi=36 by default)\n @param pos0Range: minimum and maximum of the 2th range\n @param pos1Range: minimum and maximum of the chi range\n @param dummy: value for bins without pixels \n @return 2theta, I, weighted histogram, unweighted histogram\n @return I, edges0, edges1, weighted histogram(2D), unweighted histogram (2D)\n ";
static PyMethodDef __pyx_mdef_9splitBBox_1histoBBox2d = {__Pyx_NAMESTR("histoBBox2d"), (PyCFunction)__pyx_pf_9splitBBox_1histoBBox2d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_9splitBBox_1histoBBox2d)};
static PyObject *__pyx_pf_9splitBBox_1histoBBox2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *__pyx_v_weights = 0;
PyArrayObject *__pyx_v_pos0 = 0;
PyArrayObject *__pyx_v_delta_pos0 = 0;
PyArrayObject *__pyx_v_pos1 = 0;
PyArrayObject *__pyx_v_delta_pos1 = 0;
PyObject *__pyx_v_bins = 0;
PyObject *__pyx_v_pos0Range = 0;
PyObject *__pyx_v_pos1Range = 0;
float __pyx_v_dummy;
long __pyx_v_bins0;
long __pyx_v_bins1;
long __pyx_v_i;
long __pyx_v_j;
long __pyx_v_idx;
long __pyx_v_size;
PyArrayObject *__pyx_v_cdata = 0;
PyArrayObject *__pyx_v_cpos0 = 0;
PyArrayObject *__pyx_v_cdelta_pos0 = 0;
PyArrayObject *__pyx_v_cpos0_inf = 0;
PyArrayObject *__pyx_v_cpos0_sup = 0;
PyArrayObject *__pyx_v_cpos1 = 0;
PyArrayObject *__pyx_v_cdelta_pos1 = 0;
PyArrayObject *__pyx_v_cpos1_inf = 0;
PyArrayObject *__pyx_v_cpos1_sup = 0;
PyArrayObject *__pyx_v_outData = 0;
PyArrayObject *__pyx_v_outCount = 0;
PyArrayObject *__pyx_v_outMerge = 0;
PyArrayObject *__pyx_v_edges0 = 0;
PyArrayObject *__pyx_v_edges1 = 0;
float __pyx_v_min0;
float __pyx_v_max0;
float __pyx_v_min1;
float __pyx_v_max1;
float __pyx_v_deltaR;
float __pyx_v_deltaL;
float __pyx_v_deltaU;
float __pyx_v_deltaD;
float __pyx_v_deltaA;
float __pyx_v_tmp;
float __pyx_v_pos0_min;
float __pyx_v_pos0_max;
float __pyx_v_pos1_min;
float __pyx_v_pos1_max;
float __pyx_v_pos0_maxin;
float __pyx_v_pos1_maxin;
float __pyx_v_fbin0_min;
float __pyx_v_fbin0_max;
float __pyx_v_fbin1_min;
float __pyx_v_fbin1_max;
long __pyx_v_bin0_max;
long __pyx_v_bin0_min;
long __pyx_v_bin1_max;
long __pyx_v_bin1_min;
double __pyx_v_epsilon;
double __pyx_v_data;
float __pyx_v_dpos0;
float __pyx_v_dpos1;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outMerge;
__Pyx_Buffer __pyx_pybuffer_outMerge;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_inf;
__Pyx_Buffer __pyx_pybuffer_cpos0_inf;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cdelta_pos1;
__Pyx_Buffer __pyx_pybuffer_cdelta_pos1;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cdelta_pos0;
__Pyx_Buffer __pyx_pybuffer_cdelta_pos0;
__Pyx_LocalBuf_ND __pyx_pybuffernd_edges0;
__Pyx_Buffer __pyx_pybuffer_edges0;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0_sup;
__Pyx_Buffer __pyx_pybuffer_cpos0_sup;
__Pyx_LocalBuf_ND __pyx_pybuffernd_edges1;
__Pyx_Buffer __pyx_pybuffer_edges1;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_sup;
__Pyx_Buffer __pyx_pybuffer_cpos1_sup;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outCount;
__Pyx_Buffer __pyx_pybuffer_outCount;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cdata;
__Pyx_Buffer __pyx_pybuffer_cdata;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1;
__Pyx_Buffer __pyx_pybuffer_cpos1;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos0;
__Pyx_Buffer __pyx_pybuffer_cpos0;
__Pyx_LocalBuf_ND __pyx_pybuffernd_outData;
__Pyx_Buffer __pyx_pybuffer_outData;
__Pyx_LocalBuf_ND __pyx_pybuffernd_cpos1_inf;
__Pyx_Buffer __pyx_pybuffer_cpos1_inf;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
long __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
long __pyx_t_9;
PyArrayObject *__pyx_t_10 = NULL;
PyArrayObject *__pyx_t_11 = NULL;
PyArrayObject *__pyx_t_12 = NULL;
PyArrayObject *__pyx_t_13 = NULL;
PyArrayObject *__pyx_t_14 = NULL;
PyArrayObject *__pyx_t_15 = NULL;
PyArrayObject *__pyx_t_16 = NULL;
PyArrayObject *__pyx_t_17 = NULL;
PyArrayObject *__pyx_t_18 = NULL;
PyObject *__pyx_t_19 = NULL;
PyArrayObject *__pyx_t_20 = NULL;
PyArrayObject *__pyx_t_21 = NULL;
PyArrayObject *__pyx_t_22 = NULL;
PyArrayObject *__pyx_t_23 = NULL;
PyArrayObject *__pyx_t_24 = NULL;
Py_ssize_t __pyx_t_25;
int __pyx_t_26;
int __pyx_t_27;
float __pyx_t_28;
double __pyx_t_29;
long __pyx_t_30;
long __pyx_t_31;
long __pyx_t_32;
long __pyx_t_33;
long __pyx_t_34;
long __pyx_t_35;
long __pyx_t_36;
int __pyx_t_37;
int __pyx_t_38;
long __pyx_t_39;
long __pyx_t_40;
long __pyx_t_41;
long __pyx_t_42;
long __pyx_t_43;
long __pyx_t_44;
long __pyx_t_45;
long __pyx_t_46;
long __pyx_t_47;
long __pyx_t_48;
long __pyx_t_49;
long __pyx_t_50;
long __pyx_t_51;
long __pyx_t_52;
long __pyx_t_53;
long __pyx_t_54;
long __pyx_t_55;
long __pyx_t_56;
long __pyx_t_57;
long __pyx_t_58;
long __pyx_t_59;
long __pyx_t_60;
long __pyx_t_61;
long __pyx_t_62;
long __pyx_t_63;
long __pyx_t_64;
long __pyx_t_65;
long __pyx_t_66;
long __pyx_t_67;
long __pyx_t_68;
long __pyx_t_69;
long __pyx_t_70;
long __pyx_t_71;
long __pyx_t_72;
long __pyx_t_73;
long __pyx_t_74;
long __pyx_t_75;
long __pyx_t_76;
long __pyx_t_77;
long __pyx_t_78;
long __pyx_t_79;
long __pyx_t_80;
long __pyx_t_81;
long __pyx_t_82;
long __pyx_t_83;
long __pyx_t_84;
long __pyx_t_85;
long __pyx_t_86;
long __pyx_t_87;
long __pyx_t_88;
long __pyx_t_89;
long __pyx_t_90;
long __pyx_t_91;
long __pyx_t_92;
long __pyx_t_93;
long __pyx_t_94;
long __pyx_t_95;
long __pyx_t_96;
long __pyx_t_97;
long __pyx_t_98;
long __pyx_t_99;
long __pyx_t_100;
long __pyx_t_101;
long __pyx_t_102;
long __pyx_t_103;
long __pyx_t_104;
long __pyx_t_105;
long __pyx_t_106;
long __pyx_t_107;
long __pyx_t_108;
long __pyx_t_109;
long __pyx_t_110;
long __pyx_t_111;
long __pyx_t_112;
long __pyx_t_113;
long __pyx_t_114;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__weights,&__pyx_n_s__pos0,&__pyx_n_s__delta_pos0,&__pyx_n_s__pos1,&__pyx_n_s__delta_pos1,&__pyx_n_s__bins,&__pyx_n_s__pos0Range,&__pyx_n_s__pos1Range,&__pyx_n_s__dummy,0};
__Pyx_RefNannySetupContext("histoBBox2d");
__pyx_self = __pyx_self;
{
PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
/* "splitBBox.pyx":184
* numpy.ndarray pos1 not None,
* numpy.ndarray delta_pos1 not None,
* bins=(100, 36), # <<<<<<<<<<<<<<
* pos0Range=None,
* pos1Range=None,
*/
values[5] = ((PyObject *)__pyx_k_tuple_6);
/* "splitBBox.pyx":185
* numpy.ndarray delta_pos1 not None,
* bins=(100, 36),
* pos0Range=None, # <<<<<<<<<<<<<<
* pos1Range=None,
* float dummy=0.0):
*/
values[6] = ((PyObject *)Py_None);
/* "splitBBox.pyx":186
* bins=(100, 36),
* pos0Range=None,
* pos1Range=None, # <<<<<<<<<<<<<<
* float dummy=0.0):
* """
*/
values[7] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weights);
if (likely(values[0])) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0);
if (likely(values[1])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos0);
if (likely(values[2])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1);
if (likely(values[3])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delta_pos1);
if (likely(values[4])) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 5:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
if (value) { values[5] = value; kw_args--; }
}
case 6:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos0Range);
if (value) { values[6] = value; kw_args--; }
}
case 7:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos1Range);
if (value) { values[7] = value; kw_args--; }
}
case 8:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
if (value) { values[8] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histoBBox2d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_v_weights = ((PyArrayObject *)values[0]);
__pyx_v_pos0 = ((PyArrayObject *)values[1]);
__pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
__pyx_v_pos1 = ((PyArrayObject *)values[3]);
__pyx_v_delta_pos1 = ((PyArrayObject *)values[4]);
__pyx_v_bins = values[5];
__pyx_v_pos0Range = values[6];
__pyx_v_pos1Range = values[7];
if (values[8]) {
__pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
/* "splitBBox.pyx":187
* pos0Range=None,
* pos1Range=None,
* float dummy=0.0): # <<<<<<<<<<<<<<
* """
* Calculate 2D histogram of pos0(tth),pos1(chi) weighted by weights
*/
__pyx_v_dummy = ((float)0.0);
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_weights = ((PyArrayObject *)values[0]);
__pyx_v_pos0 = ((PyArrayObject *)values[1]);
__pyx_v_delta_pos0 = ((PyArrayObject *)values[2]);
__pyx_v_pos1 = ((PyArrayObject *)values[3]);
__pyx_v_delta_pos1 = ((PyArrayObject *)values[4]);
__pyx_v_bins = values[5];
__pyx_v_pos0Range = values[6];
__pyx_v_pos1Range = values[7];
if (values[8]) {
__pyx_v_dummy = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_dummy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_dummy = ((float)0.0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("histoBBox2d", 0, 5, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("splitBBox.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_pybuffer_cdata.pybuffer.buf = NULL;
__pyx_pybuffer_cdata.refcount = 0;
__pyx_pybuffernd_cdata.data = NULL;
__pyx_pybuffernd_cdata.rcbuffer = &__pyx_pybuffer_cdata;
__pyx_pybuffer_cpos0.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0.refcount = 0;
__pyx_pybuffernd_cpos0.data = NULL;
__pyx_pybuffernd_cpos0.rcbuffer = &__pyx_pybuffer_cpos0;
__pyx_pybuffer_cdelta_pos0.pybuffer.buf = NULL;
__pyx_pybuffer_cdelta_pos0.refcount = 0;
__pyx_pybuffernd_cdelta_pos0.data = NULL;
__pyx_pybuffernd_cdelta_pos0.rcbuffer = &__pyx_pybuffer_cdelta_pos0;
__pyx_pybuffer_cpos0_inf.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0_inf.refcount = 0;
__pyx_pybuffernd_cpos0_inf.data = NULL;
__pyx_pybuffernd_cpos0_inf.rcbuffer = &__pyx_pybuffer_cpos0_inf;
__pyx_pybuffer_cpos0_sup.pybuffer.buf = NULL;
__pyx_pybuffer_cpos0_sup.refcount = 0;
__pyx_pybuffernd_cpos0_sup.data = NULL;
__pyx_pybuffernd_cpos0_sup.rcbuffer = &__pyx_pybuffer_cpos0_sup;
__pyx_pybuffer_cpos1.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1.refcount = 0;
__pyx_pybuffernd_cpos1.data = NULL;
__pyx_pybuffernd_cpos1.rcbuffer = &__pyx_pybuffer_cpos1;
__pyx_pybuffer_cdelta_pos1.pybuffer.buf = NULL;
__pyx_pybuffer_cdelta_pos1.refcount = 0;
__pyx_pybuffernd_cdelta_pos1.data = NULL;
__pyx_pybuffernd_cdelta_pos1.rcbuffer = &__pyx_pybuffer_cdelta_pos1;
__pyx_pybuffer_cpos1_inf.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1_inf.refcount = 0;
__pyx_pybuffernd_cpos1_inf.data = NULL;
__pyx_pybuffernd_cpos1_inf.rcbuffer = &__pyx_pybuffer_cpos1_inf;
__pyx_pybuffer_cpos1_sup.pybuffer.buf = NULL;
__pyx_pybuffer_cpos1_sup.refcount = 0;
__pyx_pybuffernd_cpos1_sup.data = NULL;
__pyx_pybuffernd_cpos1_sup.rcbuffer = &__pyx_pybuffer_cpos1_sup;
__pyx_pybuffer_outData.pybuffer.buf = NULL;
__pyx_pybuffer_outData.refcount = 0;
__pyx_pybuffernd_outData.data = NULL;
__pyx_pybuffernd_outData.rcbuffer = &__pyx_pybuffer_outData;
__pyx_pybuffer_outCount.pybuffer.buf = NULL;
__pyx_pybuffer_outCount.refcount = 0;
__pyx_pybuffernd_outCount.data = NULL;
__pyx_pybuffernd_outCount.rcbuffer = &__pyx_pybuffer_outCount;
__pyx_pybuffer_outMerge.pybuffer.buf = NULL;
__pyx_pybuffer_outMerge.refcount = 0;
__pyx_pybuffernd_outMerge.data = NULL;
__pyx_pybuffernd_outMerge.rcbuffer = &__pyx_pybuffer_outMerge;
__pyx_pybuffer_edges0.pybuffer.buf = NULL;
__pyx_pybuffer_edges0.refcount = 0;
__pyx_pybuffernd_edges0.data = NULL;
__pyx_pybuffernd_edges0.rcbuffer = &__pyx_pybuffer_edges0;
__pyx_pybuffer_edges1.pybuffer.buf = NULL;
__pyx_pybuffer_edges1.refcount = 0;
__pyx_pybuffernd_edges1.data = NULL;
__pyx_pybuffernd_edges1.rcbuffer = &__pyx_pybuffer_edges1;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 0, "weights", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos0), __pyx_ptype_5numpy_ndarray, 0, "pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_delta_pos0), __pyx_ptype_5numpy_ndarray, 0, "delta_pos0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos1), __pyx_ptype_5numpy_ndarray, 0, "pos1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_delta_pos1), __pyx_ptype_5numpy_ndarray, 0, "delta_pos1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "splitBBox.pyx":208
*
* cdef long bins0, bins1, i, j, idx
* cdef long size = weights.size # <<<<<<<<<<<<<<
* assert pos0.size == size
* assert pos1.size == size
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_size = __pyx_t_2;
/* "splitBBox.pyx":209
* cdef long bins0, bins1, i, j, idx
* cdef long size = weights.size
* assert pos0.size == size # <<<<<<<<<<<<<<
* assert pos1.size == size
* assert delta_pos0.size == size
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
/* "splitBBox.pyx":210
* cdef long size = weights.size
* assert pos0.size == size
* assert pos1.size == size # <<<<<<<<<<<<<<
* assert delta_pos0.size == size
* assert delta_pos1.size == size
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos1), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
/* "splitBBox.pyx":211
* assert pos0.size == size
* assert pos1.size == size
* assert delta_pos0.size == size # <<<<<<<<<<<<<<
* assert delta_pos1.size == size
* try:
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
/* "splitBBox.pyx":212
* assert pos1.size == size
* assert delta_pos0.size == size
* assert delta_pos1.size == size # <<<<<<<<<<<<<<
* try:
* bins0, bins1 = tuple(bins)
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos1), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#endif
/* "splitBBox.pyx":213
* assert delta_pos0.size == size
* assert delta_pos1.size == size
* try: # <<<<<<<<<<<<<<
* bins0, bins1 = tuple(bins)
* except:
*/
{
__Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
/*try:*/ {
/* "splitBBox.pyx":214
* assert delta_pos1.size == size
* try:
* bins0, bins1 = tuple(bins) # <<<<<<<<<<<<<<
* except:
* bins0 = bins1 = < long > bins
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_bins);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bins);
__Pyx_GIVEREF(__pyx_v_bins);
__pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (likely(PyTuple_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
}
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__Pyx_UnpackTupleError(__pyx_t_3, 2);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
}
__pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_4); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_bins0 = __pyx_t_2;
__pyx_v_bins1 = __pyx_t_9;
}
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L13_try_end;
__pyx_L6_error:;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "splitBBox.pyx":215
* try:
* bins0, bins1 = tuple(bins)
* except: # <<<<<<<<<<<<<<
* bins0 = bins1 = < long > bins
* if bins0 <= 0:
*/
/*except:*/ {
__Pyx_AddTraceback("splitBBox.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_1);
/* "splitBBox.pyx":216
* bins0, bins1 = tuple(bins)
* except:
* bins0 = bins1 = < long > bins # <<<<<<<<<<<<<<
* if bins0 <= 0:
* bins0 = 1
*/
__pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_v_bins); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
__pyx_v_bins0 = ((long)__pyx_t_9);
__pyx_v_bins1 = ((long)__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L7_exception_handled;
}
__pyx_L8_except_error:;
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
goto __pyx_L1_error;
__pyx_L7_exception_handled:;
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
__pyx_L13_try_end:;
}
/* "splitBBox.pyx":217
* except:
* bins0 = bins1 = < long > bins
* if bins0 <= 0: # <<<<<<<<<<<<<<
* bins0 = 1
* if bins1 <= 0:
*/
__pyx_t_5 = (__pyx_v_bins0 <= 0);
if (__pyx_t_5) {
/* "splitBBox.pyx":218
* bins0 = bins1 = < long > bins
* if bins0 <= 0:
* bins0 = 1 # <<<<<<<<<<<<<<
* if bins1 <= 0:
* bins1 = 1
*/
__pyx_v_bins0 = 1;
goto __pyx_L16;
}
__pyx_L16:;
/* "splitBBox.pyx":219
* if bins0 <= 0:
* bins0 = 1
* if bins1 <= 0: # <<<<<<<<<<<<<<
* bins1 = 1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
*/
__pyx_t_5 = (__pyx_v_bins1 <= 0);
if (__pyx_t_5) {
/* "splitBBox.pyx":220
* bins0 = 1
* if bins1 <= 0:
* bins1 = 1 # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
*/
__pyx_v_bins1 = 1;
goto __pyx_L17;
}
__pyx_L17:;
/* "splitBBox.pyx":221
* if bins1 <= 0:
* bins1 = 1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_weights), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_10 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cdata = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cdata.diminfo[0].strides = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdata.diminfo[0].shape = __pyx_pybuffernd_cdata.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_10 = 0;
__pyx_v_cdata = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":222
* bins1 = 1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
*/
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0.diminfo[0].strides = __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0.diminfo[0].shape = __pyx_pybuffernd_cpos0.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_11 = 0;
__pyx_v_cpos0 = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "splitBBox.pyx":223
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 1] cdata = weights.ravel().astype("float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos0), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_12 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cdelta_pos0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cdelta_pos0.diminfo[0].strides = __pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdelta_pos0.diminfo[0].shape = __pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_12 = 0;
__pyx_v_cdelta_pos0 = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":224
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0 = pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0 # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
*/
__pyx_t_4 = PyNumber_Subtract(((PyObject *)__pyx_v_cpos0), ((PyObject *)__pyx_v_cdelta_pos0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_13 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0_inf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0_inf.diminfo[0].strides = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_inf.diminfo[0].shape = __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_13 = 0;
__pyx_v_cpos0_inf = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":225
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos0 = delta_pos0.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0 # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
*/
__pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_cpos0), ((PyObject *)__pyx_v_cdelta_pos0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos0_sup = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos0_sup.diminfo[0].strides = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos0_sup.diminfo[0].shape = __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_14 = 0;
__pyx_v_cpos0_sup = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":226
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_inf = cpos0 - cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
*/
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_pos1), __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos1.diminfo[0].strides = __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1.diminfo[0].shape = __pyx_pybuffernd_cpos1.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_15 = 0;
__pyx_v_cpos1 = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "splitBBox.pyx":227
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos0_sup = cpos0 + cdelta_pos0
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_delta_pos1), __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_16 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cdelta_pos1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cdelta_pos1.diminfo[0].strides = __pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cdelta_pos1.diminfo[0].shape = __pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_16 = 0;
__pyx_v_cdelta_pos1 = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":228
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1 = pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1 # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
*/
__pyx_t_4 = PyNumber_Subtract(((PyObject *)__pyx_v_cpos1), ((PyObject *)__pyx_v_cdelta_pos1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos1_inf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos1_inf.diminfo[0].strides = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_inf.diminfo[0].shape = __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_17 = 0;
__pyx_v_cpos1_inf = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":229
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cdelta_pos1 = delta_pos1.ravel().astype("float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1 # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
*/
__pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_cpos1), ((PyObject *)__pyx_v_cdelta_pos1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_18 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_cpos1_sup = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_cpos1_sup.diminfo[0].strides = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cpos1_sup.diminfo[0].shape = __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_18 = 0;
__pyx_v_cpos1_sup = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":230
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_inf = cpos1 - cdelta_pos1
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_19));
__Pyx_GIVEREF(((PyObject *)__pyx_t_19));
__pyx_t_19 = 0;
__pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_19));
if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outData.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
__pyx_v_outData = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outData.diminfo[0].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outData.diminfo[0].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outData.diminfo[1].strides = __pyx_pybuffernd_outData.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outData.diminfo[1].shape = __pyx_pybuffernd_outData.rcbuffer->pybuffer.shape[1];
}
}
__pyx_t_20 = 0;
__pyx_v_outData = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":231
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] cpos1_sup = cpos1 + cdelta_pos1
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_19 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float64)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
__pyx_v_outCount = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outCount.diminfo[0].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outCount.diminfo[0].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outCount.diminfo[1].strides = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outCount.diminfo[1].shape = __pyx_pybuffernd_outCount.rcbuffer->pybuffer.shape[1];
}
}
__pyx_t_21 = 0;
__pyx_v_outCount = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":232
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outData = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32")
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_19));
__Pyx_GIVEREF(((PyObject *)__pyx_t_19));
__pyx_t_19 = 0;
__pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_19));
if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_22 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
__pyx_v_outMerge = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_outMerge.diminfo[0].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outMerge.diminfo[0].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outMerge.diminfo[1].strides = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outMerge.diminfo[1].shape = __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.shape[1];
}
}
__pyx_t_22 = 0;
__pyx_v_outMerge = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "splitBBox.pyx":233
* cdef numpy.ndarray[DTYPE_float64_t, ndim = 2] outCount = numpy.zeros((bins0, bins1), dtype="float64")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32") # <<<<<<<<<<<<<<
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32")
*
*/
__pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_19 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyInt_FromLong(__pyx_v_bins0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_23 = ((PyArrayObject *)__pyx_t_1);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_edges0.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_edges0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_edges0.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_edges0.diminfo[0].strides = __pyx_pybuffernd_edges0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_edges0.diminfo[0].shape = __pyx_pybuffernd_edges0.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_23 = 0;
__pyx_v_edges0 = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "splitBBox.pyx":234
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 2] outMerge = numpy.zeros((bins0, bins1), dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges0 = numpy.zeros(bins0, dtype="float32")
* cdef numpy.ndarray[DTYPE_float32_t, ndim = 1] edges1 = numpy.zeros(bins1, dtype="float32") # <<<<<<<<<<<<<<
*
* cdef float min0, max0, min1, max1, deltaR, deltaL, deltaU, deltaD, deltaA, tmp
*/
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyInt_FromLong(__pyx_v_bins1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__float32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_19 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_24 = ((PyArrayObject *)__pyx_t_19);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_edges1.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_9splitBBox_DTYPE_float32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
__pyx_v_edges1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_edges1.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_edges1.diminfo[0].strides = __pyx_pybuffernd_edges1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_edges1.diminfo[0].shape = __pyx_pybuffernd_edges1.rcbuffer->pybuffer.shape[0];
}
}
__pyx_t_24 = 0;
__pyx_v_edges1 = ((PyArrayObject *)__pyx_t_19);
__pyx_t_19 = 0;
/* "splitBBox.pyx":240
* cdef float fbin0_min, fbin0_max, fbin1_min, fbin1_max
* cdef long bin0_max, bin0_min, bin1_max, bin1_min
* cdef double epsilon = 1e-10 # <<<<<<<<<<<<<<
* cdef double data
*
*/
__pyx_v_epsilon = 1e-10;
/* "splitBBox.pyx":243
* cdef double data
*
* if pos0Range is not None and len(pos0Range) == 2: # <<<<<<<<<<<<<<
* pos0_min = min(pos0Range)
* pos0_maxin = max(pos0Range)
*/
__pyx_t_5 = (__pyx_v_pos0Range != Py_None);
if (__pyx_t_5) {
__pyx_t_25 = PyObject_Length(__pyx_v_pos0Range); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_26 = (__pyx_t_25 == 2);
__pyx_t_27 = __pyx_t_26;
} else {
__pyx_t_27 = __pyx_t_5;
}
if (__pyx_t_27) {
/* "splitBBox.pyx":244
*
* if pos0Range is not None and len(pos0Range) == 2:
* pos0_min = min(pos0Range) # <<<<<<<<<<<<<<
* pos0_maxin = max(pos0Range)
* else:
*/
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_INCREF(__pyx_v_pos0Range);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_pos0Range);
__Pyx_GIVEREF(__pyx_v_pos0Range);
__pyx_t_1 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos0_min = __pyx_t_28;
/* "splitBBox.pyx":245
* if pos0Range is not None and len(pos0Range) == 2:
* pos0_min = min(pos0Range)
* pos0_maxin = max(pos0Range) # <<<<<<<<<<<<<<
* else:
* pos0_min = max(0.0, cpos0_inf.min())
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_pos0Range);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos0Range);
__Pyx_GIVEREF(__pyx_v_pos0Range);
__pyx_t_19 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos0_maxin = __pyx_t_28;
goto __pyx_L18;
}
/*else*/ {
/* "splitBBox.pyx":247
* pos0_maxin = max(pos0Range)
* else:
* pos0_min = max(0.0, cpos0_inf.min()) # <<<<<<<<<<<<<<
* pos0_maxin = cpos0_sup.max()
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*/
__pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_inf), __pyx_n_s__min); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_29 = 0.0;
__pyx_t_3 = PyFloat_FromDouble(__pyx_t_29); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_27) {
__Pyx_INCREF(__pyx_t_1);
__pyx_t_19 = __pyx_t_1;
} else {
__pyx_t_4 = PyFloat_FromDouble(__pyx_t_29); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_19 = __pyx_t_4;
__pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos0_min = __pyx_t_28;
/* "splitBBox.pyx":248
* else:
* pos0_min = max(0.0, cpos0_inf.min())
* pos0_maxin = cpos0_sup.max() # <<<<<<<<<<<<<<
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
*/
__pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos0_sup), __pyx_n_s__max); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_1 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos0_maxin = __pyx_t_28;
}
__pyx_L18:;
/* "splitBBox.pyx":249
* pos0_min = max(0.0, cpos0_inf.min())
* pos0_maxin = cpos0_sup.max()
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps) # <<<<<<<<<<<<<<
*
* if pos1Range is not None and len(pos1Range) > 1:
*/
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_pos0_maxin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_19 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__finfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__float32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__pyx_t_19 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__eps); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Add(__pyx_int_1, __pyx_t_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_19 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos0_max = __pyx_t_28;
/* "splitBBox.pyx":251
* pos0_max = pos0_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
* if pos1Range is not None and len(pos1Range) > 1: # <<<<<<<<<<<<<<
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range)
*/
__pyx_t_27 = (__pyx_v_pos1Range != Py_None);
if (__pyx_t_27) {
__pyx_t_25 = PyObject_Length(__pyx_v_pos1Range); if (unlikely(__pyx_t_25 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_5 = (__pyx_t_25 > 1);
__pyx_t_26 = __pyx_t_5;
} else {
__pyx_t_26 = __pyx_t_27;
}
if (__pyx_t_26) {
/* "splitBBox.pyx":252
*
* if pos1Range is not None and len(pos1Range) > 1:
* pos1_min = min(pos1Range) # <<<<<<<<<<<<<<
* pos1_maxin = max(pos1Range)
* else:
*/
__pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_INCREF(__pyx_v_pos1Range);
PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_pos1Range);
__Pyx_GIVEREF(__pyx_v_pos1Range);
__pyx_t_3 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_pos1_min = __pyx_t_28;
/* "splitBBox.pyx":253
* if pos1Range is not None and len(pos1Range) > 1:
* pos1_min = min(pos1Range)
* pos1_maxin = max(pos1Range) # <<<<<<<<<<<<<<
* else:
* tmp = cdelta_pos1.min()
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_pos1Range);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pos1Range);
__Pyx_GIVEREF(__pyx_v_pos1Range);
__pyx_t_19 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos1_maxin = __pyx_t_28;
goto __pyx_L19;
}
/*else*/ {
/* "splitBBox.pyx":255
* pos1_maxin = max(pos1Range)
* else:
* tmp = cdelta_pos1.min() # <<<<<<<<<<<<<<
* pos1_min = cpos1.min() - tmp
* pos1_maxin = cpos1.max() + tmp
*/
__pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_cdelta_pos1), __pyx_n_s__min); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_3 = PyObject_Call(__pyx_t_19, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_tmp = __pyx_t_28;
/* "splitBBox.pyx":256
* else:
* tmp = cdelta_pos1.min()
* pos1_min = cpos1.min() - tmp # <<<<<<<<<<<<<<
* pos1_maxin = cpos1.max() + tmp
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*/
__pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos1), __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_19 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyFloat_FromDouble(__pyx_v_tmp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyNumber_Subtract(__pyx_t_19, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos1_min = __pyx_t_28;
/* "splitBBox.pyx":257
* tmp = cdelta_pos1.min()
* pos1_min = cpos1.min() - tmp
* pos1_maxin = cpos1.max() + tmp # <<<<<<<<<<<<<<
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_cpos1), __pyx_n_s__max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_tmp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_19 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_v_pos1_maxin = __pyx_t_28;
}
__pyx_L19:;
/* "splitBBox.pyx":258
* pos1_min = cpos1.min() - tmp
* pos1_maxin = cpos1.max() + tmp
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps) # <<<<<<<<<<<<<<
*
* cdef float dpos0 = (pos0_max - pos0_min) / (< float > (bins0))
*/
__pyx_t_19 = PyFloat_FromDouble(__pyx_v_pos1_maxin); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__eps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyNumber_Add(__pyx_int_1, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyNumber_Multiply(__pyx_t_19, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_28 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_pos1_max = __pyx_t_28;
/* "splitBBox.pyx":260
* pos1_max = pos1_maxin * (1 + numpy.finfo(numpy.float32).eps)
*
* cdef float dpos0 = (pos0_max - pos0_min) / (< float > (bins0)) # <<<<<<<<<<<<<<
* cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1))
*
*/
__pyx_v_dpos0 = ((__pyx_v_pos0_max - __pyx_v_pos0_min) / ((float)__pyx_v_bins0));
/* "splitBBox.pyx":261
*
* cdef float dpos0 = (pos0_max - pos0_min) / (< float > (bins0))
* cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1)) # <<<<<<<<<<<<<<
*
* with nogil:
*/
__pyx_v_dpos1 = ((__pyx_v_pos1_max - __pyx_v_pos1_min) / ((float)__pyx_v_bins1));
/* "splitBBox.pyx":263
* cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1))
*
* with nogil: # <<<<<<<<<<<<<<
* for i in range(bins0):
* edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
*/
{
#ifdef WITH_THREAD
PyThreadState *_save = NULL;
#endif
Py_UNBLOCK_THREADS
/*try:*/ {
/* "splitBBox.pyx":264
*
* with nogil:
* for i in range(bins0): # <<<<<<<<<<<<<<
* edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
* for i in range(bins1):
*/
__pyx_t_9 = __pyx_v_bins0;
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
/* "splitBBox.pyx":265
* with nogil:
* for i in range(bins0):
* edges0[i] = pos0_min + (0.5 +< double > i) * dpos0 # <<<<<<<<<<<<<<
* for i in range(bins1):
* edges1[i] = pos1_min + (0.5 +< double > i) * dpos1
*/
__pyx_t_30 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_edges0.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_edges0.diminfo[0].strides) = (__pyx_v_pos0_min + ((0.5 + ((double)__pyx_v_i)) * __pyx_v_dpos0));
}
/* "splitBBox.pyx":266
* for i in range(bins0):
* edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
* for i in range(bins1): # <<<<<<<<<<<<<<
* edges1[i] = pos1_min + (0.5 +< double > i) * dpos1
*
*/
__pyx_t_9 = __pyx_v_bins1;
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
/* "splitBBox.pyx":267
* edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
* for i in range(bins1):
* edges1[i] = pos1_min + (0.5 +< double > i) * dpos1 # <<<<<<<<<<<<<<
*
* for idx in range(size):
*/
__pyx_t_31 = __pyx_v_i;
*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_edges1.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_edges1.diminfo[0].strides) = (__pyx_v_pos1_min + ((0.5 + ((double)__pyx_v_i)) * __pyx_v_dpos1));
}
/* "splitBBox.pyx":269
* edges1[i] = pos1_min + (0.5 +< double > i) * dpos1
*
* for idx in range(size): # <<<<<<<<<<<<<<
* data = cdata[idx]
* min0 = cpos0_inf[idx]
*/
__pyx_t_9 = __pyx_v_size;
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) {
__pyx_v_idx = __pyx_t_2;
/* "splitBBox.pyx":270
*
* for idx in range(size):
* data = cdata[idx] # <<<<<<<<<<<<<<
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx]
*/
__pyx_t_32 = __pyx_v_idx;
__pyx_v_data = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_cdata.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_cdata.diminfo[0].strides));
/* "splitBBox.pyx":271
* for idx in range(size):
* data = cdata[idx]
* min0 = cpos0_inf[idx] # <<<<<<<<<<<<<<
* max0 = cpos0_sup[idx]
* min1 = cpos1_inf[idx]
*/
__pyx_t_33 = __pyx_v_idx;
__pyx_v_min0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_cpos0_inf.diminfo[0].strides));
/* "splitBBox.pyx":272
* data = cdata[idx]
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx] # <<<<<<<<<<<<<<
* min1 = cpos1_inf[idx]
* max1 = cpos1_sup[idx]
*/
__pyx_t_34 = __pyx_v_idx;
__pyx_v_max0 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_cpos0_sup.diminfo[0].strides));
/* "splitBBox.pyx":273
* min0 = cpos0_inf[idx]
* max0 = cpos0_sup[idx]
* min1 = cpos1_inf[idx] # <<<<<<<<<<<<<<
* max1 = cpos1_sup[idx]
*
*/
__pyx_t_35 = __pyx_v_idx;
__pyx_v_min1 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_cpos1_inf.diminfo[0].strides));
/* "splitBBox.pyx":274
* max0 = cpos0_sup[idx]
* min1 = cpos1_inf[idx]
* max1 = cpos1_sup[idx] # <<<<<<<<<<<<<<
*
* if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :
*/
__pyx_t_36 = __pyx_v_idx;
__pyx_v_max1 = (*__Pyx_BufPtrStrided1d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_cpos1_sup.diminfo[0].strides));
/* "splitBBox.pyx":276
* max1 = cpos1_sup[idx]
*
* if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) : # <<<<<<<<<<<<<<
* continue
*
*/
__pyx_t_26 = (__pyx_v_max0 < __pyx_v_pos0_min);
if (!__pyx_t_26) {
__pyx_t_27 = (__pyx_v_max1 < __pyx_v_pos1_min);
if (!__pyx_t_27) {
__pyx_t_5 = (__pyx_v_min0 > __pyx_v_pos0_maxin);
if (!__pyx_t_5) {
__pyx_t_37 = (__pyx_v_min1 > __pyx_v_pos1_maxin);
__pyx_t_38 = __pyx_t_37;
} else {
__pyx_t_38 = __pyx_t_5;
}
__pyx_t_5 = __pyx_t_38;
} else {
__pyx_t_5 = __pyx_t_27;
}
__pyx_t_27 = __pyx_t_5;
} else {
__pyx_t_27 = __pyx_t_26;
}
if (__pyx_t_27) {
/* "splitBBox.pyx":277
*
* if (max0 < pos0_min) or (max1 < pos1_min) or (min0 > pos0_maxin) or (min1 > pos1_maxin) :
* continue # <<<<<<<<<<<<<<
*
* if min0 < pos0_min:
*/
goto __pyx_L27_continue;
goto __pyx_L29;
}
__pyx_L29:;
/* "splitBBox.pyx":279
* continue
*
* if min0 < pos0_min: # <<<<<<<<<<<<<<
* min0 = pos0_min
* if min1 < pos1_min:
*/
__pyx_t_27 = (__pyx_v_min0 < __pyx_v_pos0_min);
if (__pyx_t_27) {
/* "splitBBox.pyx":280
*
* if min0 < pos0_min:
* min0 = pos0_min # <<<<<<<<<<<<<<
* if min1 < pos1_min:
* min1 = pos1_min
*/
__pyx_v_min0 = __pyx_v_pos0_min;
goto __pyx_L30;
}
__pyx_L30:;
/* "splitBBox.pyx":281
* if min0 < pos0_min:
* min0 = pos0_min
* if min1 < pos1_min: # <<<<<<<<<<<<<<
* min1 = pos1_min
* if max0 > pos0_maxin:
*/
__pyx_t_27 = (__pyx_v_min1 < __pyx_v_pos1_min);
if (__pyx_t_27) {
/* "splitBBox.pyx":282
* min0 = pos0_min
* if min1 < pos1_min:
* min1 = pos1_min # <<<<<<<<<<<<<<
* if max0 > pos0_maxin:
* max0 = pos0_maxin
*/
__pyx_v_min1 = __pyx_v_pos1_min;
goto __pyx_L31;
}
__pyx_L31:;
/* "splitBBox.pyx":283
* if min1 < pos1_min:
* min1 = pos1_min
* if max0 > pos0_maxin: # <<<<<<<<<<<<<<
* max0 = pos0_maxin
* if max1 > pos1_maxin:
*/
__pyx_t_27 = (__pyx_v_max0 > __pyx_v_pos0_maxin);
if (__pyx_t_27) {
/* "splitBBox.pyx":284
* min1 = pos1_min
* if max0 > pos0_maxin:
* max0 = pos0_maxin # <<<<<<<<<<<<<<
* if max1 > pos1_maxin:
* max1 = pos1_maxin
*/
__pyx_v_max0 = __pyx_v_pos0_maxin;
goto __pyx_L32;
}
__pyx_L32:;
/* "splitBBox.pyx":285
* if max0 > pos0_maxin:
* max0 = pos0_maxin
* if max1 > pos1_maxin: # <<<<<<<<<<<<<<
* max1 = pos1_maxin
*
*/
__pyx_t_27 = (__pyx_v_max1 > __pyx_v_pos1_maxin);
if (__pyx_t_27) {
/* "splitBBox.pyx":286
* max0 = pos0_maxin
* if max1 > pos1_maxin:
* max1 = pos1_maxin # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_max1 = __pyx_v_pos1_maxin;
goto __pyx_L33;
}
__pyx_L33:;
/* "splitBBox.pyx":289
*
*
* fbin0_min = getBinNr(min0, pos0_min, dpos0) # <<<<<<<<<<<<<<
* fbin0_max = getBinNr(max0, pos0_min, dpos0)
* fbin1_min = getBinNr(min1, pos1_min, dpos1)
*/
__pyx_v_fbin0_min = __pyx_f_9splitBBox_getBinNr(__pyx_v_min0, __pyx_v_pos0_min, __pyx_v_dpos0);
/* "splitBBox.pyx":290
*
* fbin0_min = getBinNr(min0, pos0_min, dpos0)
* fbin0_max = getBinNr(max0, pos0_min, dpos0) # <<<<<<<<<<<<<<
* fbin1_min = getBinNr(min1, pos1_min, dpos1)
* fbin1_max = getBinNr(max1, pos1_min, dpos1)
*/
__pyx_v_fbin0_max = __pyx_f_9splitBBox_getBinNr(__pyx_v_max0, __pyx_v_pos0_min, __pyx_v_dpos0);
/* "splitBBox.pyx":291
* fbin0_min = getBinNr(min0, pos0_min, dpos0)
* fbin0_max = getBinNr(max0, pos0_min, dpos0)
* fbin1_min = getBinNr(min1, pos1_min, dpos1) # <<<<<<<<<<<<<<
* fbin1_max = getBinNr(max1, pos1_min, dpos1)
*
*/
__pyx_v_fbin1_min = __pyx_f_9splitBBox_getBinNr(__pyx_v_min1, __pyx_v_pos1_min, __pyx_v_dpos1);
/* "splitBBox.pyx":292
* fbin0_max = getBinNr(max0, pos0_min, dpos0)
* fbin1_min = getBinNr(min1, pos1_min, dpos1)
* fbin1_max = getBinNr(max1, pos1_min, dpos1) # <<<<<<<<<<<<<<
*
* bin0_min = < long > floor(fbin0_min)
*/
__pyx_v_fbin1_max = __pyx_f_9splitBBox_getBinNr(__pyx_v_max1, __pyx_v_pos1_min, __pyx_v_dpos1);
/* "splitBBox.pyx":294
* fbin1_max = getBinNr(max1, pos1_min, dpos1)
*
* bin0_min = < long > floor(fbin0_min) # <<<<<<<<<<<<<<
* bin0_max = < long > floor(fbin0_max)
* bin1_min = < long > floor(fbin1_min)
*/
__pyx_v_bin0_min = ((long)floor(__pyx_v_fbin0_min));
/* "splitBBox.pyx":295
*
* bin0_min = < long > floor(fbin0_min)
* bin0_max = < long > floor(fbin0_max) # <<<<<<<<<<<<<<
* bin1_min = < long > floor(fbin1_min)
* bin1_max = < long > floor(fbin1_max)
*/
__pyx_v_bin0_max = ((long)floor(__pyx_v_fbin0_max));
/* "splitBBox.pyx":296
* bin0_min = < long > floor(fbin0_min)
* bin0_max = < long > floor(fbin0_max)
* bin1_min = < long > floor(fbin1_min) # <<<<<<<<<<<<<<
* bin1_max = < long > floor(fbin1_max)
*
*/
__pyx_v_bin1_min = ((long)floor(__pyx_v_fbin1_min));
/* "splitBBox.pyx":297
* bin0_max = < long > floor(fbin0_max)
* bin1_min = < long > floor(fbin1_min)
* bin1_max = < long > floor(fbin1_max) # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_bin1_max = ((long)floor(__pyx_v_fbin1_max));
/* "splitBBox.pyx":300
*
*
* if bin0_min == bin0_max: # <<<<<<<<<<<<<<
* if bin1_min == bin1_max:
* #All pixel is within a single bin
*/
__pyx_t_27 = (__pyx_v_bin0_min == __pyx_v_bin0_max);
if (__pyx_t_27) {
/* "splitBBox.pyx":301
*
* if bin0_min == bin0_max:
* if bin1_min == bin1_max: # <<<<<<<<<<<<<<
* #All pixel is within a single bin
* outCount[bin0_min, bin1_min] += 1.0
*/
__pyx_t_27 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
if (__pyx_t_27) {
/* "splitBBox.pyx":303
* if bin1_min == bin1_max:
* #All pixel is within a single bin
* outCount[bin0_min, bin1_min] += 1.0 # <<<<<<<<<<<<<<
* outData[bin0_min, bin1_min] += data
* else:
*/
__pyx_t_39 = __pyx_v_bin0_min;
__pyx_t_40 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_outCount.diminfo[1].strides) += 1.0;
/* "splitBBox.pyx":304
* #All pixel is within a single bin
* outCount[bin0_min, bin1_min] += 1.0
* outData[bin0_min, bin1_min] += data # <<<<<<<<<<<<<<
* else:
* #spread on more than 2 bins
*/
__pyx_t_41 = __pyx_v_bin0_min;
__pyx_t_42 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_outData.diminfo[1].strides) += __pyx_v_data;
goto __pyx_L35;
}
/*else*/ {
/* "splitBBox.pyx":307
* else:
* #spread on more than 2 bins
* deltaD = (< float > (bin1_min + 1)) - fbin1_min # <<<<<<<<<<<<<<
* deltaU = fbin1_max - (< double > bin1_max)
* deltaA = 1.0 / (fbin1_max - fbin1_min)
*/
__pyx_v_deltaD = (((float)(__pyx_v_bin1_min + 1)) - __pyx_v_fbin1_min);
/* "splitBBox.pyx":308
* #spread on more than 2 bins
* deltaD = (< float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (< double > bin1_max) # <<<<<<<<<<<<<<
* deltaA = 1.0 / (fbin1_max - fbin1_min)
*
*/
__pyx_v_deltaU = (__pyx_v_fbin1_max - ((double)__pyx_v_bin1_max));
/* "splitBBox.pyx":309
* deltaD = (< float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (< double > bin1_max)
* deltaA = 1.0 / (fbin1_max - fbin1_min) # <<<<<<<<<<<<<<
*
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaD
*/
__pyx_v_deltaA = (1.0 / (__pyx_v_fbin1_max - __pyx_v_fbin1_min));
/* "splitBBox.pyx":311
* deltaA = 1.0 / (fbin1_max - fbin1_min)
*
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaD # <<<<<<<<<<<<<<
* outData[bin0_min, bin1_min] += data * deltaA * deltaD
*
*/
__pyx_t_43 = __pyx_v_bin0_min;
__pyx_t_44 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaD);
/* "splitBBox.pyx":312
*
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaD
* outData[bin0_min, bin1_min] += data * deltaA * deltaD # <<<<<<<<<<<<<<
*
* outCount[bin0_min, bin1_max] += < double > deltaA * deltaU
*/
__pyx_t_45 = __pyx_v_bin0_min;
__pyx_t_46 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaD);
/* "splitBBox.pyx":314
* outData[bin0_min, bin1_min] += data * deltaA * deltaD
*
* outCount[bin0_min, bin1_max] += < double > deltaA * deltaU # <<<<<<<<<<<<<<
* outData[bin0_min, bin1_max] += data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max):
*/
__pyx_t_47 = __pyx_v_bin0_min;
__pyx_t_48 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaU);
/* "splitBBox.pyx":315
*
* outCount[bin0_min, bin1_max] += < double > deltaA * deltaU
* outData[bin0_min, bin1_max] += data * deltaA * deltaU # <<<<<<<<<<<<<<
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += < double > deltaA
*/
__pyx_t_49 = __pyx_v_bin0_min;
__pyx_t_50 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_outData.diminfo[1].strides) += ((__pyx_v_data * __pyx_v_deltaA) * __pyx_v_deltaU);
/* "splitBBox.pyx":316
* outCount[bin0_min, bin1_max] += < double > deltaA * deltaU
* outData[bin0_min, bin1_max] += data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max): # <<<<<<<<<<<<<<
* outCount[bin0_min, j] += < double > deltaA
* outData[bin0_min, j] += data * deltaA
*/
__pyx_t_51 = __pyx_v_bin1_max;
for (__pyx_t_52 = (__pyx_v_bin1_min + 1); __pyx_t_52 < __pyx_t_51; __pyx_t_52+=1) {
__pyx_v_j = __pyx_t_52;
/* "splitBBox.pyx":317
* outData[bin0_min, bin1_max] += data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += < double > deltaA # <<<<<<<<<<<<<<
* outData[bin0_min, j] += data * deltaA
*
*/
__pyx_t_53 = __pyx_v_bin0_min;
__pyx_t_54 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_54, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((double)__pyx_v_deltaA);
/* "splitBBox.pyx":318
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += < double > deltaA
* outData[bin0_min, j] += data * deltaA # <<<<<<<<<<<<<<
*
* else: #spread on more than 2 bins in dim 0
*/
__pyx_t_55 = __pyx_v_bin0_min;
__pyx_t_56 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_outData.diminfo[1].strides) += (__pyx_v_data * __pyx_v_deltaA);
}
}
__pyx_L35:;
goto __pyx_L34;
}
/*else*/ {
/* "splitBBox.pyx":321
*
* else: #spread on more than 2 bins in dim 0
* if bin1_min == bin1_max: # <<<<<<<<<<<<<<
* #All pixel fall on 1 bins in dim 1
* deltaA = 1.0 / (fbin0_max - fbin0_min)
*/
__pyx_t_27 = (__pyx_v_bin1_min == __pyx_v_bin1_max);
if (__pyx_t_27) {
/* "splitBBox.pyx":323
* if bin1_min == bin1_max:
* #All pixel fall on 1 bins in dim 1
* deltaA = 1.0 / (fbin0_max - fbin0_min) # <<<<<<<<<<<<<<
* deltaL = (< float > (bin0_min + 1)) - fbin0_min
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaL
*/
__pyx_v_deltaA = (1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min));
/* "splitBBox.pyx":324
* #All pixel fall on 1 bins in dim 1
* deltaA = 1.0 / (fbin0_max - fbin0_min)
* deltaL = (< float > (bin0_min + 1)) - fbin0_min # <<<<<<<<<<<<<<
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaL
* outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL
*/
__pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);
/* "splitBBox.pyx":325
* deltaA = 1.0 / (fbin0_max - fbin0_min)
* deltaL = (< float > (bin0_min + 1)) - fbin0_min
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaL # <<<<<<<<<<<<<<
* outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL
* deltaR = fbin0_max - (< float > bin0_max)
*/
__pyx_t_51 = __pyx_v_bin0_min;
__pyx_t_52 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaL);
/* "splitBBox.pyx":326
* deltaL = (< float > (bin0_min + 1)) - fbin0_min
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaL
* outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL # <<<<<<<<<<<<<<
* deltaR = fbin0_max - (< float > bin0_max)
* outCount[bin0_max, bin1_min] += < double > deltaA * deltaR
*/
__pyx_t_57 = __pyx_v_bin0_min;
__pyx_t_58 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL);
/* "splitBBox.pyx":327
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaL
* outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL
* deltaR = fbin0_max - (< float > bin0_max) # <<<<<<<<<<<<<<
* outCount[bin0_max, bin1_min] += < double > deltaA * deltaR
* outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR
*/
__pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));
/* "splitBBox.pyx":328
* outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL
* deltaR = fbin0_max - (< float > bin0_max)
* outCount[bin0_max, bin1_min] += < double > deltaA * deltaR # <<<<<<<<<<<<<<
* outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR
* for i in range(bin0_min + 1, bin0_max):
*/
__pyx_t_59 = __pyx_v_bin0_max;
__pyx_t_60 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaR);
/* "splitBBox.pyx":329
* deltaR = fbin0_max - (< float > bin0_max)
* outCount[bin0_max, bin1_min] += < double > deltaA * deltaR
* outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR # <<<<<<<<<<<<<<
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += < double > deltaA
*/
__pyx_t_61 = __pyx_v_bin0_max;
__pyx_t_62 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR);
/* "splitBBox.pyx":330
* outCount[bin0_max, bin1_min] += < double > deltaA * deltaR
* outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR
* for i in range(bin0_min + 1, bin0_max): # <<<<<<<<<<<<<<
* outCount[i, bin1_min] += < double > deltaA
* outData[i, bin1_min] += < double > data * deltaA
*/
__pyx_t_63 = __pyx_v_bin0_max;
for (__pyx_t_64 = (__pyx_v_bin0_min + 1); __pyx_t_64 < __pyx_t_63; __pyx_t_64+=1) {
__pyx_v_i = __pyx_t_64;
/* "splitBBox.pyx":331
* outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += < double > deltaA # <<<<<<<<<<<<<<
* outData[i, bin1_min] += < double > data * deltaA
* else:
*/
__pyx_t_65 = __pyx_v_i;
__pyx_t_66 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_65, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_66, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((double)__pyx_v_deltaA);
/* "splitBBox.pyx":332
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += < double > deltaA
* outData[i, bin1_min] += < double > data * deltaA # <<<<<<<<<<<<<<
* else:
* #spread on n pix in dim0 and m pixel in dim1:
*/
__pyx_t_67 = __pyx_v_i;
__pyx_t_68 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_outData.diminfo[1].strides) += (((double)__pyx_v_data) * __pyx_v_deltaA);
}
goto __pyx_L38;
}
/*else*/ {
/* "splitBBox.pyx":335
* else:
* #spread on n pix in dim0 and m pixel in dim1:
* deltaL = (< float > (bin0_min + 1)) - fbin0_min # <<<<<<<<<<<<<<
* deltaR = fbin0_max - (< float > bin0_max)
* deltaD = (< float > (bin1_min + 1)) - fbin1_min
*/
__pyx_v_deltaL = (((float)(__pyx_v_bin0_min + 1)) - __pyx_v_fbin0_min);
/* "splitBBox.pyx":336
* #spread on n pix in dim0 and m pixel in dim1:
* deltaL = (< float > (bin0_min + 1)) - fbin0_min
* deltaR = fbin0_max - (< float > bin0_max) # <<<<<<<<<<<<<<
* deltaD = (< float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (< float > bin1_max)
*/
__pyx_v_deltaR = (__pyx_v_fbin0_max - ((float)__pyx_v_bin0_max));
/* "splitBBox.pyx":337
* deltaL = (< float > (bin0_min + 1)) - fbin0_min
* deltaR = fbin0_max - (< float > bin0_max)
* deltaD = (< float > (bin1_min + 1)) - fbin1_min # <<<<<<<<<<<<<<
* deltaU = fbin1_max - (< float > bin1_max)
* deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min)
*/
__pyx_v_deltaD = (((float)(__pyx_v_bin1_min + 1)) - __pyx_v_fbin1_min);
/* "splitBBox.pyx":338
* deltaR = fbin0_max - (< float > bin0_max)
* deltaD = (< float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (< float > bin1_max) # <<<<<<<<<<<<<<
* deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min)
*
*/
__pyx_v_deltaU = (__pyx_v_fbin1_max - ((float)__pyx_v_bin1_max));
/* "splitBBox.pyx":339
* deltaD = (< float > (bin1_min + 1)) - fbin1_min
* deltaU = fbin1_max - (< float > bin1_max)
* deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min) # <<<<<<<<<<<<<<
*
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaL * deltaD
*/
__pyx_v_deltaA = ((1.0 / (__pyx_v_fbin0_max - __pyx_v_fbin0_min)) / (__pyx_v_fbin1_max - __pyx_v_fbin1_min));
/* "splitBBox.pyx":341
* deltaA = 1.0 / (fbin0_max - fbin0_min) / (fbin1_max - fbin1_min)
*
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaL * deltaD # <<<<<<<<<<<<<<
* outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL * deltaD
*
*/
__pyx_t_63 = __pyx_v_bin0_min;
__pyx_t_64 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaD);
/* "splitBBox.pyx":342
*
* outCount[bin0_min, bin1_min] += < double > deltaA * deltaL * deltaD
* outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL * deltaD # <<<<<<<<<<<<<<
*
* outCount[bin0_min, bin1_max] += < double > deltaA * deltaL * deltaU
*/
__pyx_t_69 = __pyx_v_bin0_min;
__pyx_t_70 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_69, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_70, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaD);
/* "splitBBox.pyx":344
* outData[bin0_min, bin1_min] += < double > data * deltaA * deltaL * deltaD
*
* outCount[bin0_min, bin1_max] += < double > deltaA * deltaL * deltaU # <<<<<<<<<<<<<<
* outData[bin0_min, bin1_max] += < double > data * deltaA * deltaL * deltaU
*
*/
__pyx_t_71 = __pyx_v_bin0_min;
__pyx_t_72 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_72, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaU);
/* "splitBBox.pyx":345
*
* outCount[bin0_min, bin1_max] += < double > deltaA * deltaL * deltaU
* outData[bin0_min, bin1_max] += < double > data * deltaA * deltaL * deltaU # <<<<<<<<<<<<<<
*
* outCount[bin0_max, bin1_min] += < double > deltaA * deltaR * deltaD
*/
__pyx_t_73 = __pyx_v_bin0_min;
__pyx_t_74 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_73, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_74, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL) * __pyx_v_deltaU);
/* "splitBBox.pyx":347
* outData[bin0_min, bin1_max] += < double > data * deltaA * deltaL * deltaU
*
* outCount[bin0_max, bin1_min] += < double > deltaA * deltaR * deltaD # <<<<<<<<<<<<<<
* outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR * deltaD
*
*/
__pyx_t_75 = __pyx_v_bin0_max;
__pyx_t_76 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_75, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_76, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaD);
/* "splitBBox.pyx":348
*
* outCount[bin0_max, bin1_min] += < double > deltaA * deltaR * deltaD
* outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR * deltaD # <<<<<<<<<<<<<<
*
* outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU
*/
__pyx_t_77 = __pyx_v_bin0_max;
__pyx_t_78 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_77, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_78, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaD);
/* "splitBBox.pyx":350
* outData[bin0_max, bin1_min] += < double > data * deltaA * deltaR * deltaD
*
* outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU # <<<<<<<<<<<<<<
* outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU
* for i in range(bin0_min + 1, bin0_max):
*/
__pyx_t_79 = __pyx_v_bin0_max;
__pyx_t_80 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_80, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((((double)__pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaU);
/* "splitBBox.pyx":351
*
* outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU
* outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU # <<<<<<<<<<<<<<
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += < double > deltaA * deltaD
*/
__pyx_t_81 = __pyx_v_bin0_max;
__pyx_t_82 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_81, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_82, __pyx_pybuffernd_outData.diminfo[1].strides) += (((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR) * __pyx_v_deltaU);
/* "splitBBox.pyx":352
* outCount[bin0_max, bin1_max] += < double > deltaA * deltaR * deltaU
* outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU
* for i in range(bin0_min + 1, bin0_max): # <<<<<<<<<<<<<<
* outCount[i, bin1_min] += < double > deltaA * deltaD
* outData[i, bin1_min] += < double > data * deltaA * deltaD
*/
__pyx_t_83 = __pyx_v_bin0_max;
for (__pyx_t_84 = (__pyx_v_bin0_min + 1); __pyx_t_84 < __pyx_t_83; __pyx_t_84+=1) {
__pyx_v_i = __pyx_t_84;
/* "splitBBox.pyx":353
* outData[bin0_max, bin1_max] += < double > data * deltaA * deltaR * deltaU
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += < double > deltaA * deltaD # <<<<<<<<<<<<<<
* outData[i, bin1_min] += < double > data * deltaA * deltaD
* for j in range(bin1_min + 1, bin1_max):
*/
__pyx_t_85 = __pyx_v_i;
__pyx_t_86 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_85, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_86, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaD);
/* "splitBBox.pyx":354
* for i in range(bin0_min + 1, bin0_max):
* outCount[i, bin1_min] += < double > deltaA * deltaD
* outData[i, bin1_min] += < double > data * deltaA * deltaD # <<<<<<<<<<<<<<
* for j in range(bin1_min + 1, bin1_max):
* outCount[i, j] += < double > deltaA
*/
__pyx_t_87 = __pyx_v_i;
__pyx_t_88 = __pyx_v_bin1_min;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_87, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_88, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaD);
/* "splitBBox.pyx":355
* outCount[i, bin1_min] += < double > deltaA * deltaD
* outData[i, bin1_min] += < double > data * deltaA * deltaD
* for j in range(bin1_min + 1, bin1_max): # <<<<<<<<<<<<<<
* outCount[i, j] += < double > deltaA
* outData[i, j] += < double > data * deltaA
*/
__pyx_t_89 = __pyx_v_bin1_max;
for (__pyx_t_90 = (__pyx_v_bin1_min + 1); __pyx_t_90 < __pyx_t_89; __pyx_t_90+=1) {
__pyx_v_j = __pyx_t_90;
/* "splitBBox.pyx":356
* outData[i, bin1_min] += < double > data * deltaA * deltaD
* for j in range(bin1_min + 1, bin1_max):
* outCount[i, j] += < double > deltaA # <<<<<<<<<<<<<<
* outData[i, j] += < double > data * deltaA
* outCount[i, bin1_max] += < double > deltaA * deltaU
*/
__pyx_t_91 = __pyx_v_i;
__pyx_t_92 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_91, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_92, __pyx_pybuffernd_outCount.diminfo[1].strides) += ((double)__pyx_v_deltaA);
/* "splitBBox.pyx":357
* for j in range(bin1_min + 1, bin1_max):
* outCount[i, j] += < double > deltaA
* outData[i, j] += < double > data * deltaA # <<<<<<<<<<<<<<
* outCount[i, bin1_max] += < double > deltaA * deltaU
* outData[i, bin1_max] += < double > data * deltaA * deltaU
*/
__pyx_t_93 = __pyx_v_i;
__pyx_t_94 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_93, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_94, __pyx_pybuffernd_outData.diminfo[1].strides) += (((double)__pyx_v_data) * __pyx_v_deltaA);
}
/* "splitBBox.pyx":358
* outCount[i, j] += < double > deltaA
* outData[i, j] += < double > data * deltaA
* outCount[i, bin1_max] += < double > deltaA * deltaU # <<<<<<<<<<<<<<
* outData[i, bin1_max] += < double > data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max):
*/
__pyx_t_89 = __pyx_v_i;
__pyx_t_90 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_89, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_90, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaU);
/* "splitBBox.pyx":359
* outData[i, j] += < double > data * deltaA
* outCount[i, bin1_max] += < double > deltaA * deltaU
* outData[i, bin1_max] += < double > data * deltaA * deltaU # <<<<<<<<<<<<<<
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += < double > deltaA * deltaL
*/
__pyx_t_95 = __pyx_v_i;
__pyx_t_96 = __pyx_v_bin1_max;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_95, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_96, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaU);
}
/* "splitBBox.pyx":360
* outCount[i, bin1_max] += < double > deltaA * deltaU
* outData[i, bin1_max] += < double > data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max): # <<<<<<<<<<<<<<
* outCount[bin0_min, j] += < double > deltaA * deltaL
* outData[bin0_min, j] += < double > data * deltaA * deltaL
*/
__pyx_t_83 = __pyx_v_bin1_max;
for (__pyx_t_84 = (__pyx_v_bin1_min + 1); __pyx_t_84 < __pyx_t_83; __pyx_t_84+=1) {
__pyx_v_j = __pyx_t_84;
/* "splitBBox.pyx":361
* outData[i, bin1_max] += < double > data * deltaA * deltaU
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += < double > deltaA * deltaL # <<<<<<<<<<<<<<
* outData[bin0_min, j] += < double > data * deltaA * deltaL
*
*/
__pyx_t_97 = __pyx_v_bin0_min;
__pyx_t_98 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_97, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_98, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaL);
/* "splitBBox.pyx":362
* for j in range(bin1_min + 1, bin1_max):
* outCount[bin0_min, j] += < double > deltaA * deltaL
* outData[bin0_min, j] += < double > data * deltaA * deltaL # <<<<<<<<<<<<<<
*
* outCount[bin0_max, j] += < double > deltaA * deltaR
*/
__pyx_t_99 = __pyx_v_bin0_min;
__pyx_t_100 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_99, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_100, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaL);
/* "splitBBox.pyx":364
* outData[bin0_min, j] += < double > data * deltaA * deltaL
*
* outCount[bin0_max, j] += < double > deltaA * deltaR # <<<<<<<<<<<<<<
* outData[bin0_max, j] += < double > data * deltaA * deltaR
*
*/
__pyx_t_101 = __pyx_v_bin0_max;
__pyx_t_102 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_101, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_102, __pyx_pybuffernd_outCount.diminfo[1].strides) += (((double)__pyx_v_deltaA) * __pyx_v_deltaR);
/* "splitBBox.pyx":365
*
* outCount[bin0_max, j] += < double > deltaA * deltaR
* outData[bin0_max, j] += < double > data * deltaA * deltaR # <<<<<<<<<<<<<<
*
* for i in range(bins0):
*/
__pyx_t_103 = __pyx_v_bin0_max;
__pyx_t_104 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_103, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_104, __pyx_pybuffernd_outData.diminfo[1].strides) += ((((double)__pyx_v_data) * __pyx_v_deltaA) * __pyx_v_deltaR);
}
}
__pyx_L38:;
}
__pyx_L34:;
__pyx_L27_continue:;
}
/* "splitBBox.pyx":367
* outData[bin0_max, j] += < double > data * deltaA * deltaR
*
* for i in range(bins0): # <<<<<<<<<<<<<<
* for j in range(bins1):
* if outCount[i, j] > epsilon:
*/
__pyx_t_9 = __pyx_v_bins0;
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
/* "splitBBox.pyx":368
*
* for i in range(bins0):
* for j in range(bins1): # <<<<<<<<<<<<<<
* if outCount[i, j] > epsilon:
* outMerge[i, j] = outData[i, j] / outCount[i, j]
*/
__pyx_t_83 = __pyx_v_bins1;
for (__pyx_t_84 = 0; __pyx_t_84 < __pyx_t_83; __pyx_t_84+=1) {
__pyx_v_j = __pyx_t_84;
/* "splitBBox.pyx":369
* for i in range(bins0):
* for j in range(bins1):
* if outCount[i, j] > epsilon: # <<<<<<<<<<<<<<
* outMerge[i, j] = outData[i, j] / outCount[i, j]
* else:
*/
__pyx_t_105 = __pyx_v_i;
__pyx_t_106 = __pyx_v_j;
__pyx_t_27 = ((*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_105, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_106, __pyx_pybuffernd_outCount.diminfo[1].strides)) > __pyx_v_epsilon);
if (__pyx_t_27) {
/* "splitBBox.pyx":370
* for j in range(bins1):
* if outCount[i, j] > epsilon:
* outMerge[i, j] = outData[i, j] / outCount[i, j] # <<<<<<<<<<<<<<
* else:
* outMerge[i, j] = dummy
*/
__pyx_t_107 = __pyx_v_i;
__pyx_t_108 = __pyx_v_j;
__pyx_t_109 = __pyx_v_i;
__pyx_t_110 = __pyx_v_j;
__pyx_t_111 = __pyx_v_i;
__pyx_t_112 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_111, __pyx_pybuffernd_outMerge.diminfo[0].strides, __pyx_t_112, __pyx_pybuffernd_outMerge.diminfo[1].strides) = ((*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outData.rcbuffer->pybuffer.buf, __pyx_t_107, __pyx_pybuffernd_outData.diminfo[0].strides, __pyx_t_108, __pyx_pybuffernd_outData.diminfo[1].strides)) / (*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float64_t *, __pyx_pybuffernd_outCount.rcbuffer->pybuffer.buf, __pyx_t_109, __pyx_pybuffernd_outCount.diminfo[0].strides, __pyx_t_110, __pyx_pybuffernd_outCount.diminfo[1].strides)));
goto __pyx_L51;
}
/*else*/ {
/* "splitBBox.pyx":372
* outMerge[i, j] = outData[i, j] / outCount[i, j]
* else:
* outMerge[i, j] = dummy # <<<<<<<<<<<<<<
* return outMerge.T, edges0, edges1, outData.T, outCount.T
*
*/
__pyx_t_113 = __pyx_v_i;
__pyx_t_114 = __pyx_v_j;
*__Pyx_BufPtrStrided2d(__pyx_t_9splitBBox_DTYPE_float32_t *, __pyx_pybuffernd_outMerge.rcbuffer->pybuffer.buf, __pyx_t_113, __pyx_pybuffernd_outMerge.diminfo[0].strides, __pyx_t_114, __pyx_pybuffernd_outMerge.diminfo[1].strides) = __pyx_v_dummy;
}
__pyx_L51:;
}
}
}
/* "splitBBox.pyx":263
* cdef float dpos1 = (pos1_max - pos1_min) / (< float > (bins1))
*
* with nogil: # <<<<<<<<<<<<<<
* for i in range(bins0):
* edges0[i] = pos0_min + (0.5 +< double > i) * dpos0
*/
/*finally:*/ {
Py_BLOCK_THREADS
}
}
/* "splitBBox.pyx":373
* else:
* outMerge[i, j] = dummy
* return outMerge.T, edges0, edges1, outData.T, outCount.T # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_outMerge), __pyx_n_s__T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_outData), __pyx_n_s__T); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_19 = PyObject_GetAttr(((PyObject *)__pyx_v_outCount), __pyx_n_s__T); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_edges0));
PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_edges0));
__Pyx_GIVEREF(((PyObject *)__pyx_v_edges0));
__Pyx_INCREF(((PyObject *)__pyx_v_edges1));
PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_edges1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_edges1));
PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_19);
__Pyx_GIVEREF(__pyx_t_19);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
__pyx_t_19 = 0;
__pyx_r = ((PyObject *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_19);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("splitBBox.histoBBox2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outMerge.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_inf.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdelta_pos0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_sup.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outCount.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cdata.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outData.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cpos1_inf.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_cdata);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0);
__Pyx_XDECREF((PyObject *)__pyx_v_cdelta_pos0);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0_inf);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos0_sup);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1);
__Pyx_XDECREF((PyObject *)__pyx_v_cdelta_pos1);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1_inf);
__Pyx_XDECREF((PyObject *)__pyx_v_cpos1_sup);
__Pyx_XDECREF((PyObject *)__pyx_v_outData);
__Pyx_XDECREF((PyObject *)__pyx_v_outCount);
__Pyx_XDECREF((PyObject *)__pyx_v_outMerge);
__Pyx_XDECREF((PyObject *)__pyx_v_edges0);
__Pyx_XDECREF((PyObject *)__pyx_v_edges1);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "numpy.pxd":190
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
* # This implementation of getbuffer is geared towards Cython
* # requirements, and does not yet fullfill the PEP.
*/
static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
int __pyx_v_copy_shape;
int __pyx_v_i;
int __pyx_v_ndim;
int __pyx_v_endian_detector;
int __pyx_v_little_endian;
int __pyx_v_t;
char *__pyx_v_f;
PyArray_Descr *__pyx_v_descr = 0;
int __pyx_v_offset;
int __pyx_v_hasfields;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
char *__pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getbuffer__");
if (__pyx_v_info != NULL) {
__pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
__Pyx_GIVEREF(__pyx_v_info->obj);
}
/* "numpy.pxd":196
* # of flags
*
* if info == NULL: return # <<<<<<<<<<<<<<
*
* cdef int copy_shape, i, ndim
*/
__pyx_t_1 = (__pyx_v_info == NULL);
if (__pyx_t_1) {
__pyx_r = 0;
goto __pyx_L0;
goto __pyx_L5;
}
__pyx_L5:;
/* "numpy.pxd":199
*
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
* cdef bint little_endian = ((&endian_detector)[0] != 0)
*
*/
__pyx_v_endian_detector = 1;
/* "numpy.pxd":200
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1
* cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
*
* ndim = PyArray_NDIM(self)
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
/* "numpy.pxd":202
* cdef bint little_endian = ((&endian_detector)[0] != 0)
*
* ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
*/
__pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));
/* "numpy.pxd":204
* ndim = PyArray_NDIM(self)
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
* copy_shape = 1
* else:
*/
__pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
if (__pyx_t_1) {
/* "numpy.pxd":205
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* copy_shape = 1 # <<<<<<<<<<<<<<
* else:
* copy_shape = 0
*/
__pyx_v_copy_shape = 1;
goto __pyx_L6;
}
/*else*/ {
/* "numpy.pxd":207
* copy_shape = 1
* else:
* copy_shape = 0 # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
*/
__pyx_v_copy_shape = 0;
}
__pyx_L6:;
/* "numpy.pxd":209
* copy_shape = 0
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
* raise ValueError(u"ndarray is not C contiguous")
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
if (__pyx_t_1) {
/* "numpy.pxd":210
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
* raise ValueError(u"ndarray is not C contiguous")
*
*/
__pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
__pyx_t_3 = __pyx_t_2;
} else {
__pyx_t_3 = __pyx_t_1;
}
if (__pyx_t_3) {
/* "numpy.pxd":211
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
* raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L7;
}
__pyx_L7:;
/* "numpy.pxd":213
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
* raise ValueError(u"ndarray is not Fortran contiguous")
*/
__pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
if (__pyx_t_3) {
/* "numpy.pxd":214
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
* raise ValueError(u"ndarray is not Fortran contiguous")
*
*/
__pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS));
__pyx_t_2 = __pyx_t_1;
} else {
__pyx_t_2 = __pyx_t_3;
}
if (__pyx_t_2) {
/* "numpy.pxd":215
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
* raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
*
* info.buf = PyArray_DATA(self)
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L8;
}
__pyx_L8:;
/* "numpy.pxd":217
* raise ValueError(u"ndarray is not Fortran contiguous")
*
* info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
* info.ndim = ndim
* if copy_shape:
*/
__pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self));
/* "numpy.pxd":218
*
* info.buf = PyArray_DATA(self)
* info.ndim = ndim # <<<<<<<<<<<<<<
* if copy_shape:
* # Allocate new buffer for strides and shape info.
*/
__pyx_v_info->ndim = __pyx_v_ndim;
/* "numpy.pxd":219
* info.buf = PyArray_DATA(self)
* info.ndim = ndim
* if copy_shape: # <<<<<<<<<<<<<<
* # Allocate new buffer for strides and shape info.
* # This is allocated as one block, strides first.
*/
if (__pyx_v_copy_shape) {
/* "numpy.pxd":222
* # Allocate new buffer for strides and shape info.
* # This is allocated as one block, strides first.
* info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<<
* info.shape = info.strides + ndim
* for i in range(ndim):
*/
__pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
/* "numpy.pxd":223
* # This is allocated as one block, strides first.
* info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
* info.shape = info.strides + ndim # <<<<<<<<<<<<<<
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
*/
__pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
/* "numpy.pxd":224
* info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
* info.shape = info.strides + ndim
* for i in range(ndim): # <<<<<<<<<<<<<<
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i]
*/
__pyx_t_5 = __pyx_v_ndim;
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
/* "numpy.pxd":225
* info.shape = info.strides + ndim
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
* info.shape[i] = PyArray_DIMS(self)[i]
* else:
*/
(__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
/* "numpy.pxd":226
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
* else:
* info.strides = PyArray_STRIDES(self)
*/
(__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
}
goto __pyx_L9;
}
/*else*/ {
/* "numpy.pxd":228
* info.shape[i] = PyArray_DIMS(self)[i]
* else:
* info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<<
* info.shape = PyArray_DIMS(self)
* info.suboffsets = NULL
*/
__pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));
/* "numpy.pxd":229
* else:
* info.strides = PyArray_STRIDES(self)
* info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<<
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
*/
__pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self)));
}
__pyx_L9:;
/* "numpy.pxd":230
* info.strides = PyArray_STRIDES(self)
* info.shape = PyArray_DIMS(self)
* info.suboffsets = NULL # <<<<<<<<<<<<<<
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self)
*/
__pyx_v_info->suboffsets = NULL;
/* "numpy.pxd":231
* info.shape = PyArray_DIMS(self)
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
* info.readonly = not PyArray_ISWRITEABLE(self)
*
*/
__pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));
/* "numpy.pxd":232
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
*
* cdef int t
*/
__pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));
/* "numpy.pxd":235
*
* cdef int t
* cdef char* f = NULL # <<<<<<<<<<<<<<
* cdef dtype descr = self.descr
* cdef list stack
*/
__pyx_v_f = NULL;
/* "numpy.pxd":236
* cdef int t
* cdef char* f = NULL
* cdef dtype descr = self.descr # <<<<<<<<<<<<<<
* cdef list stack
* cdef int offset
*/
__Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr));
__pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr;
/* "numpy.pxd":240
* cdef int offset
*
* cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
*
* if not hasfields and not copy_shape:
*/
__pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
/* "numpy.pxd":242
* cdef bint hasfields = PyDataType_HASFIELDS(descr)
*
* if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
* # do not call releasebuffer
* info.obj = None
*/
__pyx_t_2 = (!__pyx_v_hasfields);
if (__pyx_t_2) {
__pyx_t_3 = (!__pyx_v_copy_shape);
__pyx_t_1 = __pyx_t_3;
} else {
__pyx_t_1 = __pyx_t_2;
}
if (__pyx_t_1) {
/* "numpy.pxd":244
* if not hasfields and not copy_shape:
* # do not call releasebuffer
* info.obj = None # <<<<<<<<<<<<<<
* else:
* # need to call releasebuffer
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = Py_None;
goto __pyx_L12;
}
/*else*/ {
/* "numpy.pxd":247
* else:
* # need to call releasebuffer
* info.obj = self # <<<<<<<<<<<<<<
*
* if not hasfields:
*/
__Pyx_INCREF(__pyx_v_self);
__Pyx_GIVEREF(__pyx_v_self);
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = __pyx_v_self;
}
__pyx_L12:;
/* "numpy.pxd":249
* info.obj = self
*
* if not hasfields: # <<<<<<<<<<<<<<
* t = descr.type_num
* if ((descr.byteorder == '>' and little_endian) or
*/
__pyx_t_1 = (!__pyx_v_hasfields);
if (__pyx_t_1) {
/* "numpy.pxd":250
*
* if not hasfields:
* t = descr.type_num # <<<<<<<<<<<<<<
* if ((descr.byteorder == '>' and little_endian) or
* (descr.byteorder == '<' and not little_endian)):
*/
__pyx_v_t = __pyx_v_descr->type_num;
/* "numpy.pxd":251
* if not hasfields:
* t = descr.type_num
* if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<<
* (descr.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
__pyx_t_1 = (__pyx_v_descr->byteorder == '>');
if (__pyx_t_1) {
__pyx_t_2 = __pyx_v_little_endian;
} else {
__pyx_t_2 = __pyx_t_1;
}
if (!__pyx_t_2) {
/* "numpy.pxd":252
* t = descr.type_num
* if ((descr.byteorder == '>' and little_endian) or
* (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<<
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
*/
__pyx_t_1 = (__pyx_v_descr->byteorder == '<');
if (__pyx_t_1) {
__pyx_t_3 = (!__pyx_v_little_endian);
__pyx_t_7 = __pyx_t_3;
} else {
__pyx_t_7 = __pyx_t_1;
}
__pyx_t_1 = __pyx_t_7;
} else {
__pyx_t_1 = __pyx_t_2;
}
if (__pyx_t_1) {
/* "numpy.pxd":253
* if ((descr.byteorder == '>' and little_endian) or
* (descr.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L14;
}
__pyx_L14:;
/* "numpy.pxd":254
* (descr.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
*/
__pyx_t_1 = (__pyx_v_t == NPY_BYTE);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__b;
goto __pyx_L15;
}
/* "numpy.pxd":255
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
*/
__pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__B;
goto __pyx_L15;
}
/* "numpy.pxd":256
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
*/
__pyx_t_1 = (__pyx_v_t == NPY_SHORT);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__h;
goto __pyx_L15;
}
/* "numpy.pxd":257
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
*/
__pyx_t_1 = (__pyx_v_t == NPY_USHORT);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__H;
goto __pyx_L15;
}
/* "numpy.pxd":258
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
*/
__pyx_t_1 = (__pyx_v_t == NPY_INT);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__i;
goto __pyx_L15;
}
/* "numpy.pxd":259
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
*/
__pyx_t_1 = (__pyx_v_t == NPY_UINT);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__I;
goto __pyx_L15;
}
/* "numpy.pxd":260
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
*/
__pyx_t_1 = (__pyx_v_t == NPY_LONG);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__l;
goto __pyx_L15;
}
/* "numpy.pxd":261
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
*/
__pyx_t_1 = (__pyx_v_t == NPY_ULONG);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__L;
goto __pyx_L15;
}
/* "numpy.pxd":262
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
*/
__pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__q;
goto __pyx_L15;
}
/* "numpy.pxd":263
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
*/
__pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__Q;
goto __pyx_L15;
}
/* "numpy.pxd":264
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
*/
__pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__f;
goto __pyx_L15;
}
/* "numpy.pxd":265
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
*/
__pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__d;
goto __pyx_L15;
}
/* "numpy.pxd":266
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
*/
__pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__g;
goto __pyx_L15;
}
/* "numpy.pxd":267
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
*/
__pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__Zf;
goto __pyx_L15;
}
/* "numpy.pxd":268
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O"
*/
__pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__Zd;
goto __pyx_L15;
}
/* "numpy.pxd":269
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
* elif t == NPY_OBJECT: f = "O"
* else:
*/
__pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__Zg;
goto __pyx_L15;
}
/* "numpy.pxd":270
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
__pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
if (__pyx_t_1) {
__pyx_v_f = __pyx_k__O;
goto __pyx_L15;
}
/*else*/ {
/* "numpy.pxd":272
* elif t == NPY_OBJECT: f = "O"
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
* info.format = f
* return
*/
__pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_18), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_8));
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
__Pyx_GIVEREF(((PyObject *)__pyx_t_8));
__pyx_t_8 = 0;
__pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L15:;
/* "numpy.pxd":273
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f # <<<<<<<<<<<<<<
* return
* else:
*/
__pyx_v_info->format = __pyx_v_f;
/* "numpy.pxd":274
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f
* return # <<<<<<<<<<<<<<
* else:
* info.format = stdlib.malloc(_buffer_format_string_len)
*/
__pyx_r = 0;
goto __pyx_L0;
goto __pyx_L13;
}
/*else*/ {
/* "numpy.pxd":276
* return
* else:
* info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
* info.format[0] = '^' # Native data types, manual alignment
* offset = 0
*/
__pyx_v_info->format = ((char *)malloc(255));
/* "numpy.pxd":277
* else:
* info.format = stdlib.malloc(_buffer_format_string_len)
* info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<<
* offset = 0
* f = _util_dtypestring(descr, info.format + 1,
*/
(__pyx_v_info->format[0]) = '^';
/* "numpy.pxd":278
* info.format = stdlib.malloc(_buffer_format_string_len)
* info.format[0] = '^' # Native data types, manual alignment
* offset = 0 # <<<<<<<<<<<<<<
* f = _util_dtypestring(descr, info.format + 1,
* info.format + _buffer_format_string_len,
*/
__pyx_v_offset = 0;
/* "numpy.pxd":281
* f = _util_dtypestring(descr, info.format + 1,
* info.format + _buffer_format_string_len,
* &offset) # <<<<<<<<<<<<<<
* f[0] = 0 # Terminate format string
*
*/
__pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f = __pyx_t_9;
/* "numpy.pxd":282
* info.format + _buffer_format_string_len,
* &offset)
* f[0] = 0 # Terminate format string # <<<<<<<<<<<<<<
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
*/
(__pyx_v_f[0]) = 0;
}
__pyx_L13:;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
}
goto __pyx_L2;
__pyx_L0:;
if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
__Pyx_GOTREF(Py_None);
__Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
}
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_descr);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "numpy.pxd":284
* f[0] = 0 # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format)
*/
static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__releasebuffer__");
/* "numpy.pxd":285
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
*/
__pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self));
if (__pyx_t_1) {
/* "numpy.pxd":286
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format) # <<<<<<<<<<<<<<
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* stdlib.free(info.strides)
*/
free(__pyx_v_info->format);
goto __pyx_L5;
}
__pyx_L5:;
/* "numpy.pxd":287
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
* stdlib.free(info.strides)
* # info.shape was stored after info.strides in the same block
*/
__pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
if (__pyx_t_1) {
/* "numpy.pxd":288
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* stdlib.free(info.strides) # <<<<<<<<<<<<<<
* # info.shape was stored after info.strides in the same block
*
*/
free(__pyx_v_info->strides);
goto __pyx_L6;
}
__pyx_L6:;
__Pyx_RefNannyFinishContext();
}
/* "numpy.pxd":764
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(1, a)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew1");
/* "numpy.pxd":765
*
* cdef inline object PyArray_MultiIterNew1(a):
* return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew2(a, b):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "numpy.pxd":767
* return PyArray_MultiIterNew(1, a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(2, a, b)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew2");
/* "numpy.pxd":768
*
* cdef inline object PyArray_MultiIterNew2(a, b):
* return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "numpy.pxd":770
* return PyArray_MultiIterNew(2, a, b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(3, a, b, c)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew3");
/* "numpy.pxd":771
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
* return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "numpy.pxd":773
* return PyArray_MultiIterNew(3, a, b, c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(4, a, b, c, d)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew4");
/* "numpy.pxd":774
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
* return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<<
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "numpy.pxd":776
* return PyArray_MultiIterNew(4, a, b, c, d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(5, a, b, c, d, e)
*
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("PyArray_MultiIterNew5");
/* "numpy.pxd":777
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
* return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<<
*
* cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "numpy.pxd":779
* return PyArray_MultiIterNew(5, a, b, c, d, e)
*
* cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
* # Recursive utility function used in __getbuffer__ to get format
* # string. The new location in the format string is returned.
*/
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
PyArray_Descr *__pyx_v_child = 0;
int __pyx_v_endian_detector;
int __pyx_v_little_endian;
PyObject *__pyx_v_fields = 0;
PyObject *__pyx_v_childname = NULL;
PyObject *__pyx_v_new_offset = NULL;
PyObject *__pyx_v_t = NULL;
char *__pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
int __pyx_t_8;
int __pyx_t_9;
long __pyx_t_10;
char *__pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_util_dtypestring");
/* "numpy.pxd":786
* cdef int delta_offset
* cdef tuple i
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
* cdef bint little_endian = ((&endian_detector)[0] != 0)
* cdef tuple fields
*/
__pyx_v_endian_detector = 1;
/* "numpy.pxd":787
* cdef tuple i
* cdef int endian_detector = 1
* cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
* cdef tuple fields
*
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
/* "numpy.pxd":790
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
* fields = descr.fields[childname]
* child, new_offset = fields
*/
if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
for (;;) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
__Pyx_XDECREF(__pyx_v_childname);
__pyx_v_childname = __pyx_t_3;
__pyx_t_3 = 0;
/* "numpy.pxd":791
*
* for childname in descr.names:
* fields = descr.fields[childname] # <<<<<<<<<<<<<<
* child, new_offset = fields
*
*/
__pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XDECREF(((PyObject *)__pyx_v_fields));
__pyx_v_fields = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "numpy.pxd":792
* for childname in descr.names:
* fields = descr.fields[childname]
* child, new_offset = fields # <<<<<<<<<<<<<<
*
* if (end - f) - (new_offset - offset[0]) < 15:
*/
if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
PyObject* sequence = ((PyObject *)__pyx_v_fields);
if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
} else {
__Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2);
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XDECREF(((PyObject *)__pyx_v_child));
__pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
__pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_v_new_offset);
__pyx_v_new_offset = __pyx_t_4;
__pyx_t_4 = 0;
/* "numpy.pxd":794
* child, new_offset = fields
*
* if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
*
*/
__pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
/* "numpy.pxd":795
*
* if (end - f) - (new_offset - offset[0]) < 15:
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
*
* if ((child.byteorder == '>' and little_endian) or
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
__pyx_L5:;
/* "numpy.pxd":797
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
*
* if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<<
* (child.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
__pyx_t_6 = (__pyx_v_child->byteorder == '>');
if (__pyx_t_6) {
__pyx_t_7 = __pyx_v_little_endian;
} else {
__pyx_t_7 = __pyx_t_6;
}
if (!__pyx_t_7) {
/* "numpy.pxd":798
*
* if ((child.byteorder == '>' and little_endian) or
* (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<<
* raise ValueError(u"Non-native byte order not supported")
* # One could encode it in the format string and have Cython
*/
__pyx_t_6 = (__pyx_v_child->byteorder == '<');
if (__pyx_t_6) {
__pyx_t_8 = (!__pyx_v_little_endian);
__pyx_t_9 = __pyx_t_8;
} else {
__pyx_t_9 = __pyx_t_6;
}
__pyx_t_6 = __pyx_t_9;
} else {
__pyx_t_6 = __pyx_t_7;
}
if (__pyx_t_6) {
/* "numpy.pxd":799
* if ((child.byteorder == '>' and little_endian) or
* (child.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
* # One could encode it in the format string and have Cython
* # complain instead, BUT: < and > in format strings also imply
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L6;
}
__pyx_L6:;
/* "numpy.pxd":809
*
* # Output padding bytes
* while offset[0] < new_offset: # <<<<<<<<<<<<<<
* f[0] = 120 # "x"; pad byte
* f += 1
*/
while (1) {
__pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!__pyx_t_6) break;
/* "numpy.pxd":810
* # Output padding bytes
* while offset[0] < new_offset:
* f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
* f += 1
* offset[0] += 1
*/
(__pyx_v_f[0]) = 120;
/* "numpy.pxd":811
* while offset[0] < new_offset:
* f[0] = 120 # "x"; pad byte
* f += 1 # <<<<<<<<<<<<<<
* offset[0] += 1
*
*/
__pyx_v_f = (__pyx_v_f + 1);
/* "numpy.pxd":812
* f[0] = 120 # "x"; pad byte
* f += 1
* offset[0] += 1 # <<<<<<<<<<<<<<
*
* offset[0] += child.itemsize
*/
__pyx_t_10 = 0;
(__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
}
/* "numpy.pxd":814
* offset[0] += 1
*
* offset[0] += child.itemsize # <<<<<<<<<<<<<<
*
* if not PyDataType_HASFIELDS(child):
*/
__pyx_t_10 = 0;
(__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);
/* "numpy.pxd":816
* offset[0] += child.itemsize
*
* if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
* t = child.type_num
* if end - f < 5:
*/
__pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child));
if (__pyx_t_6) {
/* "numpy.pxd":817
*
* if not PyDataType_HASFIELDS(child):
* t = child.type_num # <<<<<<<<<<<<<<
* if end - f < 5:
* raise RuntimeError(u"Format string allocated too short.")
*/
__pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_v_t);
__pyx_v_t = __pyx_t_3;
__pyx_t_3 = 0;
/* "numpy.pxd":818
* if not PyDataType_HASFIELDS(child):
* t = child.type_num
* if end - f < 5: # <<<<<<<<<<<<<<
* raise RuntimeError(u"Format string allocated too short.")
*
*/
__pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5);
if (__pyx_t_6) {
/* "numpy.pxd":819
* t = child.type_num
* if end - f < 5:
* raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
*
* # Until ticket #99 is fixed, use integers to avoid warnings
*/
__pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L10;
}
__pyx_L10:;
/* "numpy.pxd":822
*
* # Until ticket #99 is fixed, use integers to avoid warnings
* if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
* elif t == NPY_UBYTE: f[0] = 66 #"B"
* elif t == NPY_SHORT: f[0] = 104 #"h"
*/
__pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 98;
goto __pyx_L11;
}
/* "numpy.pxd":823
* # Until ticket #99 is fixed, use integers to avoid warnings
* if t == NPY_BYTE: f[0] = 98 #"b"
* elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
* elif t == NPY_SHORT: f[0] = 104 #"h"
* elif t == NPY_USHORT: f[0] = 72 #"H"
*/
__pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 66;
goto __pyx_L11;
}
/* "numpy.pxd":824
* if t == NPY_BYTE: f[0] = 98 #"b"
* elif t == NPY_UBYTE: f[0] = 66 #"B"
* elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
* elif t == NPY_USHORT: f[0] = 72 #"H"
* elif t == NPY_INT: f[0] = 105 #"i"
*/
__pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 104;
goto __pyx_L11;
}
/* "numpy.pxd":825
* elif t == NPY_UBYTE: f[0] = 66 #"B"
* elif t == NPY_SHORT: f[0] = 104 #"h"
* elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
* elif t == NPY_INT: f[0] = 105 #"i"
* elif t == NPY_UINT: f[0] = 73 #"I"
*/
__pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 72;
goto __pyx_L11;
}
/* "numpy.pxd":826
* elif t == NPY_SHORT: f[0] = 104 #"h"
* elif t == NPY_USHORT: f[0] = 72 #"H"
* elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
* elif t == NPY_UINT: f[0] = 73 #"I"
* elif t == NPY_LONG: f[0] = 108 #"l"
*/
__pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 105;
goto __pyx_L11;
}
/* "numpy.pxd":827
* elif t == NPY_USHORT: f[0] = 72 #"H"
* elif t == NPY_INT: f[0] = 105 #"i"
* elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
* elif t == NPY_LONG: f[0] = 108 #"l"
* elif t == NPY_ULONG: f[0] = 76 #"L"
*/
__pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 73;
goto __pyx_L11;
}
/* "numpy.pxd":828
* elif t == NPY_INT: f[0] = 105 #"i"
* elif t == NPY_UINT: f[0] = 73 #"I"
* elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
* elif t == NPY_ULONG: f[0] = 76 #"L"
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
*/
__pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 108;
goto __pyx_L11;
}
/* "numpy.pxd":829
* elif t == NPY_UINT: f[0] = 73 #"I"
* elif t == NPY_LONG: f[0] = 108 #"l"
* elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
*/
__pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 76;
goto __pyx_L11;
}
/* "numpy.pxd":830
* elif t == NPY_LONG: f[0] = 108 #"l"
* elif t == NPY_ULONG: f[0] = 76 #"L"
* elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
* elif t == NPY_FLOAT: f[0] = 102 #"f"
*/
__pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 113;
goto __pyx_L11;
}
/* "numpy.pxd":831
* elif t == NPY_ULONG: f[0] = 76 #"L"
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
* elif t == NPY_FLOAT: f[0] = 102 #"f"
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
*/
__pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 81;
goto __pyx_L11;
}
/* "numpy.pxd":832
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
* elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
*/
__pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 102;
goto __pyx_L11;
}
/* "numpy.pxd":833
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
* elif t == NPY_FLOAT: f[0] = 102 #"f"
* elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
*/
__pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 100;
goto __pyx_L11;
}
/* "numpy.pxd":834
* elif t == NPY_FLOAT: f[0] = 102 #"f"
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
*/
__pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 103;
goto __pyx_L11;
}
/* "numpy.pxd":835
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
*/
__pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 90;
(__pyx_v_f[1]) = 102;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L11;
}
/* "numpy.pxd":836
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
* elif t == NPY_OBJECT: f[0] = 79 #"O"
*/
__pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 90;
(__pyx_v_f[1]) = 100;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L11;
}
/* "numpy.pxd":837
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
* elif t == NPY_OBJECT: f[0] = 79 #"O"
* else:
*/
__pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 90;
(__pyx_v_f[1]) = 103;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L11;
}
/* "numpy.pxd":838
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
* elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
__pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 79;
goto __pyx_L11;
}
/*else*/ {
/* "numpy.pxd":840
* elif t == NPY_OBJECT: f[0] = 79 #"O"
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
* f += 1
* else:
*/
__pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_18), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L11:;
/* "numpy.pxd":841
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* f += 1 # <<<<<<<<<<<<<<
* else:
* # Cython ignores struct boundary information ("T{...}"),
*/
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L9;
}
/*else*/ {
/* "numpy.pxd":845
* # Cython ignores struct boundary information ("T{...}"),
* # so don't output it
* f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
* return f
*
*/
__pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f = __pyx_t_11;
}
__pyx_L9:;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "numpy.pxd":846
* # so don't output it
* f = _util_dtypestring(child, f, end, offset)
* return f # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_f;
goto __pyx_L0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_child);
__Pyx_XDECREF(__pyx_v_fields);
__Pyx_XDECREF(__pyx_v_childname);
__Pyx_XDECREF(__pyx_v_new_offset);
__Pyx_XDECREF(__pyx_v_t);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "numpy.pxd":961
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
* cdef PyObject* baseptr
* if base is None:
*/
static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
PyObject *__pyx_v_baseptr;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("set_array_base");
/* "numpy.pxd":963
* cdef inline void set_array_base(ndarray arr, object base):
* cdef PyObject* baseptr
* if base is None: # <<<<<<<<<<<<<<
* baseptr = NULL
* else:
*/
__pyx_t_1 = (__pyx_v_base == Py_None);
if (__pyx_t_1) {
/* "numpy.pxd":964
* cdef PyObject* baseptr
* if base is None:
* baseptr = NULL # <<<<<<<<<<<<<<
* else:
* Py_INCREF(base) # important to do this before decref below!
*/
__pyx_v_baseptr = NULL;
goto __pyx_L3;
}
/*else*/ {
/* "numpy.pxd":966
* baseptr = NULL
* else:
* Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
* baseptr = base
* Py_XDECREF(arr.base)
*/
Py_INCREF(__pyx_v_base);
/* "numpy.pxd":967
* else:
* Py_INCREF(base) # important to do this before decref below!
* baseptr = base # <<<<<<<<<<<<<<
* Py_XDECREF(arr.base)
* arr.base = baseptr
*/
__pyx_v_baseptr = ((PyObject *)__pyx_v_base);
}
__pyx_L3:;
/* "numpy.pxd":968
* Py_INCREF(base) # important to do this before decref below!
* baseptr = base
* Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
* arr.base = baseptr
*
*/
Py_XDECREF(__pyx_v_arr->base);
/* "numpy.pxd":969
* baseptr = base
* Py_XDECREF(arr.base)
* arr.base = baseptr # <<<<<<<<<<<<<<
*
* cdef inline object get_array_base(ndarray arr):
*/
__pyx_v_arr->base = __pyx_v_baseptr;
__Pyx_RefNannyFinishContext();
}
/* "numpy.pxd":971
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
* if arr.base is NULL:
* return None
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_array_base");
/* "numpy.pxd":972
*
* cdef inline object get_array_base(ndarray arr):
* if arr.base is NULL: # <<<<<<<<<<<<<<
* return None
* else:
*/
__pyx_t_1 = (__pyx_v_arr->base == NULL);
if (__pyx_t_1) {
/* "numpy.pxd":973
* cdef inline object get_array_base(ndarray arr):
* if arr.base is NULL:
* return None # <<<<<<<<<<<<<<
* else:
* return