Skip to content

Instantly share code, notes, and snippets.

@ngoldbaum
Created March 19, 2026 18:06
Show Gist options
  • Select an option

  • Save ngoldbaum/9e192ebf2ba2f0387ed23b5c1d5f5bab to your computer and use it in GitHub Desktop.

Select an option

Save ngoldbaum/9e192ebf2ba2f0387ed23b5c1d5f5bab to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
/* Generated by Cython 3.2.4 */
#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
#if !defined(CYTHON_LIMITED_API)
#define CYTHON_LIMITED_API 1
#endif
#elif defined(CYTHON_LIMITED_API)
#ifdef _MSC_VER
#pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
#else
#warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
#endif
#endif
#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 < 0x03080000
#error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_2_4"
#define CYTHON_HEX_VERSION 0x030204F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !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
#define __PYX_COMMA ,
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
#define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
/* For very preliminary testing purposes. Most variables are set the same as PyPy.
The existence of this section does not imply that anything works or is even tested */
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_LIMITED_API 0
#define CYTHON_COMPILING_IN_GRAAL 1
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_TYPE_SPECS
#define CYTHON_USE_TYPE_SPECS 0
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#undef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 1
#undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#undef CYTHON_ASSUME_SAFE_SIZE
#define CYTHON_ASSUME_SAFE_SIZE 0
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_GIL
#define CYTHON_FAST_GIL 0
#undef CYTHON_METH_FASTCALL
#define CYTHON_METH_FASTCALL 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP487_INIT_SUBCLASS
#define CYTHON_PEP487_INIT_SUBCLASS 1
#endif
#undef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#undef CYTHON_USE_MODULE_STATE
#define CYTHON_USE_MODULE_STATE 0
#undef CYTHON_USE_SYS_MONITORING
#define CYTHON_USE_SYS_MONITORING 0
#undef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 0
#undef CYTHON_USE_AM_SEND
#define CYTHON_USE_AM_SEND 0
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 1
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
#endif
#undef CYTHON_USE_FREELISTS
#define CYTHON_USE_FREELISTS 0
#undef CYTHON_IMMORTAL_CONSTANTS
#define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(PYPY_VERSION)
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_LIMITED_API 0
#define CYTHON_COMPILING_IN_GRAAL 0
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#ifndef CYTHON_USE_TYPE_SPECS
#define CYTHON_USE_TYPE_SPECS 0
#endif
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#undef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 1
#undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#ifndef CYTHON_ASSUME_SAFE_SIZE
#define CYTHON_ASSUME_SAFE_SIZE 1
#endif
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_GIL
#define CYTHON_FAST_GIL 0
#undef CYTHON_METH_FASTCALL
#define CYTHON_METH_FASTCALL 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP487_INIT_SUBCLASS
#define CYTHON_PEP487_INIT_SUBCLASS 1
#endif
#if PY_VERSION_HEX < 0x03090000
#undef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
#elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#undef CYTHON_USE_MODULE_STATE
#define CYTHON_USE_MODULE_STATE 0
#undef CYTHON_USE_SYS_MONITORING
#define CYTHON_USE_SYS_MONITORING 0
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
#endif
#undef CYTHON_USE_AM_SEND
#define CYTHON_USE_AM_SEND 0
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
#endif
#undef CYTHON_USE_FREELISTS
#define CYTHON_USE_FREELISTS 0
#undef CYTHON_IMMORTAL_CONSTANTS
#define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(CYTHON_LIMITED_API)
#ifdef Py_LIMITED_API
#undef __PYX_LIMITED_VERSION_HEX
#define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
#endif
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_LIMITED_API 1
#define CYTHON_COMPILING_IN_GRAAL 0
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_TYPE_SPECS
#define CYTHON_USE_TYPE_SPECS 1
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#endif
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
#endif
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#undef CYTHON_ASSUME_SAFE_SIZE
#define CYTHON_ASSUME_SAFE_SIZE 0
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_GIL
#define CYTHON_FAST_GIL 0
#undef CYTHON_METH_FASTCALL
#define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP487_INIT_SUBCLASS
#define CYTHON_PEP487_INIT_SUBCLASS 1
#endif
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#ifndef CYTHON_USE_MODULE_STATE
#define CYTHON_USE_MODULE_STATE 0
#endif
#undef CYTHON_USE_SYS_MONITORING
#define CYTHON_USE_SYS_MONITORING 0
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 0
#endif
#ifndef CYTHON_USE_AM_SEND
#define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
#endif
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
#endif
#ifndef CYTHON_USE_FREELISTS
#define CYTHON_USE_FREELISTS 1
#endif
#undef CYTHON_IMMORTAL_CONSTANTS
#define CYTHON_IMMORTAL_CONSTANTS 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#define CYTHON_COMPILING_IN_LIMITED_API 0
#define CYTHON_COMPILING_IN_GRAAL 0
#ifdef Py_GIL_DISABLED
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
#else
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
#endif
#if PY_VERSION_HEX < 0x030A0000
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#elif !defined(CYTHON_USE_TYPE_SLOTS)
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#ifndef CYTHON_USE_TYPE_SPECS
#define CYTHON_USE_TYPE_SPECS 0
#endif
#ifndef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 1
#endif
#ifndef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#elif !defined(CYTHON_USE_PYLIST_INTERNALS)
#define CYTHON_USE_PYLIST_INTERNALS 1
#endif
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#elif !defined(CYTHON_USE_UNICODE_WRITER)
#define CYTHON_USE_UNICODE_WRITER 1
#endif
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
#elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_ASSUME_SAFE_SIZE
#define CYTHON_ASSUME_SAFE_SIZE 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#ifndef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 1
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#undef CYTHON_FAST_GIL
#define CYTHON_FAST_GIL 0
#elif !defined(CYTHON_FAST_GIL)
#define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
#endif
#ifndef CYTHON_METH_FASTCALL
#define CYTHON_METH_FASTCALL 1
#endif
#ifndef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 1
#endif
#ifndef CYTHON_PEP487_INIT_SUBCLASS
#define CYTHON_PEP487_INIT_SUBCLASS 1
#endif
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#ifndef CYTHON_USE_MODULE_STATE
#define CYTHON_USE_MODULE_STATE 0
#endif
#ifndef CYTHON_USE_SYS_MONITORING
#define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 1
#endif
#ifndef CYTHON_USE_AM_SEND
#define CYTHON_USE_AM_SEND 1
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#elif !defined(CYTHON_USE_DICT_VERSIONS)
#define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
#endif
#ifndef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 1
#endif
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 1
#endif
#ifndef CYTHON_USE_FREELISTS
#define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
#endif
#if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
#undef CYTHON_IMMORTAL_CONSTANTS
#define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
#elif !defined(CYTHON_IMMORTAL_CONSTANTS)
#define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
#endif
#endif
#ifndef CYTHON_COMPRESS_STRINGS
#define CYTHON_COMPRESS_STRINGS 1
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL)
#endif
#endif
#if CYTHON_USE_PYLONG_INTERNALS
#undef SHIFT
#undef BASE
#undef MASK
#ifdef SIZEOF_VOID_P
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
#endif
#endif
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
#define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
#define CYTHON_RESTRICT __restrict__
#elif defined(_MSC_VER) && _MSC_VER >= 1400
#define CYTHON_RESTRICT __restrict
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_RESTRICT restrict
#else
#define CYTHON_RESTRICT
#endif
#endif
#ifndef CYTHON_UNUSED
#if defined(__cplusplus)
/* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
* but leads to warnings with -pedantic, since it is a C++17 feature */
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
#if __has_cpp_attribute(maybe_unused)
#define CYTHON_UNUSED [[maybe_unused]]
#endif
#endif
#endif
#endif
#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
#ifndef CYTHON_UNUSED_VAR
# if defined(__cplusplus)
template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
# else
# define CYTHON_UNUSED_VAR(x) (void)(x)
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
# define CYTHON_NCP_UNUSED
# else
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
#if defined(__cplusplus) && (\
__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
#define CYTHON_USE_CPP_STD_MOVE 1
#else
#define CYTHON_USE_CPP_STD_MOVE 0
#endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#include <stdint.h>
typedef uintptr_t __pyx_uintptr_t;
#ifndef CYTHON_FALLTHROUGH
#if defined(__cplusplus)
/* for clang __has_cpp_attribute(fallthrough) is true even before C++17
* but leads to warnings with -pedantic, since it is a C++17 feature */
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
#if __has_cpp_attribute(fallthrough)
#define CYTHON_FALLTHROUGH [[fallthrough]]
#endif
#endif
#ifndef CYTHON_FALLTHROUGH
#if __has_cpp_attribute(clang::fallthrough)
#define CYTHON_FALLTHROUGH [[clang::fallthrough]]
#elif __has_cpp_attribute(gnu::fallthrough)
#define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
#endif
#endif
#endif
#ifndef CYTHON_FALLTHROUGH
#if __has_attribute(fallthrough)
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
#else
#define CYTHON_FALLTHROUGH
#endif
#endif
#if defined(__clang__) && defined(__apple_build_version__)
#if __apple_build_version__ < 7000000
#undef CYTHON_FALLTHROUGH
#define CYTHON_FALLTHROUGH
#endif
#endif
#endif
#ifndef Py_UNREACHABLE
#define Py_UNREACHABLE() assert(0); abort()
#endif
#ifdef __cplusplus
template <typename T>
struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
#define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
#define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
#define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
#else
#define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
/* CppInitCode */
#ifndef __cplusplus
#error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
#if defined(__clang__)
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
#else
#define CYTHON_INLINE inline
#endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
x.~T();
}
template<typename T>
class __Pyx_FakeReference {
public:
__Pyx_FakeReference() : ptr(NULL) { }
__Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
T *operator->() { return ptr; }
T *operator&() { return ptr; }
operator T&() { return *ptr; }
template<typename U> bool operator ==(const U& other) const { return *ptr == other; }
template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
private:
T *ptr;
};
/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
#ifndef CO_OPTIMIZED
static int CO_OPTIMIZED;
#endif
#ifndef CO_NEWLOCALS
static int CO_NEWLOCALS;
#endif
#ifndef CO_VARARGS
static int CO_VARARGS;
#endif
#ifndef CO_VARKEYWORDS
static int CO_VARKEYWORDS;
#endif
#ifndef CO_ASYNC_GENERATOR
static int CO_ASYNC_GENERATOR;
#endif
#ifndef CO_GENERATOR
static int CO_GENERATOR;
#endif
#ifndef CO_COROUTINE
static int CO_COROUTINE;
#endif
#else
#ifndef CO_COROUTINE
#define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
#define CO_ASYNC_GENERATOR 0x200
#endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
#define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
#define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
#define __Pyx_Py_Is(x, y) Py_Is(x, y)
#else
#define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
#define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
#define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
#define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
#define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
#define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
#define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
#define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
#define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
#define Py_TPFLAGS_MAPPING 0
#endif
#ifndef Py_TPFLAGS_IMMUTABLETYPE
#define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
#define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#endif
#ifndef METH_STACKLESS
#define METH_STACKLESS 0
#endif
#ifndef METH_FASTCALL
#ifndef METH_FASTCALL
#define METH_FASTCALL 0x80
#endif
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
Py_ssize_t nargs, PyObject *kwnames);
#else
#if PY_VERSION_HEX >= 0x030d00A4
# define __Pyx_PyCFunctionFast PyCFunctionFast
# define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
#else
# define __Pyx_PyCFunctionFast _PyCFunctionFast
# define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#endif
#if CYTHON_METH_FASTCALL
#define __Pyx_METH_FASTCALL METH_FASTCALL
#define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
#define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
#define __Pyx_METH_FASTCALL METH_VARARGS
#define __Pyx_PyCFunction_FastCall PyCFunction
#define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
#define __pyx_vectorcallfunc vectorcallfunc
#define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
#define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
#else
#define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
#define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
#define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
#define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
#define __Pyx_PyCMethod PyCMethod
#endif
#ifndef METH_METHOD
#define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
#define PyObject_Malloc(s) PyMem_Malloc(s)
#define PyObject_Free(p) PyMem_Free(p)
#define PyObject_Realloc(p) PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
#elif CYTHON_COMPILING_IN_GRAAL
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
#define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
void *result;
result = PyModule_GetState(op);
if (!result)
Py_FatalError("Couldn't find the module state");
return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
#define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
#define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
#define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
#define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
#define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
(PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
__Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
#define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
#define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
if (res == NULL) PyErr_Clear();
return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
return PyDict_GetItem(dict, name);
#else
PyDictEntry *ep;
PyDictObject *mp = (PyDictObject*) dict;
long hash = ((PyStringObject *) name)->ob_shash;
assert(hash != -1);
ep = (mp->ma_lookup)(mp, name, hash);
if (ep == NULL) {
return NULL;
}
return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
#define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
#define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
#define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS
#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
PyTypeObject *type = Py_TYPE((PyObject*)obj);\
assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
PyObject_GC_Del(obj);\
Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
#define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
#define __Pyx_PyUnicode_DATA(u) ((void*)u)
#define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
#else
#if PY_VERSION_HEX >= 0x030C0000
#define __Pyx_PyUnicode_READY(op) (0)
#else
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#endif
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
#if PY_VERSION_HEX >= 0x030C0000
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
#else
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
#else
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#endif
#endif
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
#else
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
#if !defined(PyUnicode_DecodeUnicodeEscape)
#define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
#endif
#if !defined(PyUnicode_Contains)
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
#endif
#if !defined(PyByteArray_Check)
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if !defined(PyObject_Format)
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_PySequence_ListKeepNew(obj)\
(likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PySequence_ListKeepNew(obj)\
(likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
#define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
#define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
#define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
enum __Pyx_ReferenceSharing {
__Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
__Pyx_ReferenceSharing_OwnStrongReference,
__Pyx_ReferenceSharing_FunctionArgument,
__Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
(sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
(sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
(sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
#else
#define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
#endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
#else
#define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
#endif
#else
#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
__Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
#else
#define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
*result = PyObject_GetItem(dict, key);
if (*result == NULL) {
if (PyErr_ExceptionMatches(PyExc_KeyError)) {
PyErr_Clear();
return 0;
}
return -1;
}
return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
*result = PyDict_GetItemWithError(dict, key);
if (*result == NULL) {
return PyErr_Occurred() ? -1 : 0;
}
Py_INCREF(*result);
return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
#define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
#else
#define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
#define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
#define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
#define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
#define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
#define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
#define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
#define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
#define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
#define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
#define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
#define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
#define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
#define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
#define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
#define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
#define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
#define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
#define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
#define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
#define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
#define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __Pyx_PySendResult PySendResult
#else
typedef enum {
PYGEN_RETURN = 0,
PYGEN_ERROR = -1,
PYGEN_NEXT = 1,
} __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
#define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
typedef struct {
unaryfunc am_await;
unaryfunc am_aiter;
unaryfunc am_anext;
__Pyx_pyiter_sendfunc am_send;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
#define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
#define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
int value;
PyObject *py_value = PyObject_GetAttrString(inspect, name);
if (!py_value) return 0;
value = (int) PyLong_AsLong(py_value);
Py_DECREF(py_value);
*write_to = value;
return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
PyObject *inspect;
int result;
inspect = PyImport_ImportModule("inspect");
result =
#if !defined(CO_OPTIMIZED)
__Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
__Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
__Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
__Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
__Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
__Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
__Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
1;
Py_DECREF(inspect);
return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
return 0; // It's a limited API-only feature
}
#endif
/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#endif
#include <math.h>
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
#ifdef CYTHON_EXTERN_C
#undef __PYX_EXTERN_C
#define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
#ifdef _MSC_VER
#pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
#else
#warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
#endif
#else
#define __PYX_EXTERN_C extern "C++"
#endif
#define __PYX_HAVE__scipy__spatial___ckdtree
#define __PYX_HAVE_API__scipy__spatial___ckdtree
/* Early includes */
#include <string.h>
#include <stdio.h>
/* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
#include "numpy/arrayobject.h"
#include "numpy/ndarrayobject.h"
#include "numpy/ndarraytypes.h"
#include "numpy/arrayscalars.h"
#include "numpy/ufuncobject.h"
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <mutex>
#include <vector>
#include <math.h>
#include <limits.h>
#include "ckdtree_decl.h"
#include "coo_entries.h"
#include "ordered_pair.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */
#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif
#ifdef CYTHON_FREETHREADING_COMPATIBLE
#if CYTHON_FREETHREADING_COMPATIBLE
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#endif
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
(sizeof(type) < sizeof(Py_ssize_t)) ||\
(sizeof(type) > sizeof(Py_ssize_t) &&\
likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX) &&\
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
v == (type)PY_SSIZE_T_MIN))) ||\
(sizeof(type) == sizeof(Py_ssize_t) &&\
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
#include <cstdlib>
#define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
#define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
#define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
return Py_NewRef(obj);
#else
Py_INCREF(obj);
return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
return Py_XNewRef(obj);
#else
Py_XINCREF(obj);
return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
#if PY_VERSION_HEX >= 0x030C00A7
#ifndef _PyLong_SIGN_MASK
#define _PyLong_SIGN_MASK 3
#endif
#ifndef _PyLong_NON_SIZE_BITS
#define _PyLong_NON_SIZE_BITS 3
#endif
#define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
#define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
#define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
#define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
#define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
#define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
#define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
#define __Pyx_PyLong_SignedDigitCount(x)\
((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
#if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
#define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
#define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
#else
#define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
#define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
#endif
typedef Py_ssize_t __Pyx_compact_pylong;
typedef size_t __Pyx_compact_upylong;
#else
#define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
#define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
#define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
#define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
#define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
#define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
#define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
#define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
#define __Pyx_PyLong_CompactValue(x)\
((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
typedef sdigit __Pyx_compact_pylong;
typedef digit __Pyx_compact_upylong;
#endif
#if PY_VERSION_HEX >= 0x030C00A5
#define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
#else
#define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
#endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#endif
/* Test for GCC > 2.95 */
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
if ((std::is_trivially_default_constructible<T>::value))
#endif
*ptr = T();
(void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif
#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;
/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
#if defined(__cplusplus)
#define CYTHON_CCOMPLEX 1
#elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
#define CYTHON_CCOMPLEX 1
#else
#define CYTHON_CCOMPLEX 0
#endif
#endif
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#include <complex>
#else
#include <complex.h>
#endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
#undef _Complex_I
#define _Complex_I 1.0fj
#endif
/* #### Code section: filename_table ### */
static const char* const __pyx_f[] = {
"scipy/spatial/_ckdtree.pyx",
"../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd",
"<stringsource>",
"cpython/type.pxd",
"scipy/_cyutility.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()
/* IncludeStructmemberH.proto (used by FixUpExtensionType) */
#include <structmember.h>
/* Atomics.proto (used by UnpackUnboundCMethod) */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
#define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
(__STDC_VERSION__ >= 201112L) &&\
!defined(__STDC_NO_ATOMICS__))
#include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
(__cplusplus >= 201103L) ||\
(defined(_MSC_VER) && _MSC_VER >= 1700)))
#include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
(__STDC_VERSION__ >= 201112L) &&\
!defined(__STDC_NO_ATOMICS__) &&\
ATOMIC_INT_LOCK_FREE == 2)
#undef __pyx_atomic_int_type
#define __pyx_atomic_int_type atomic_int
#define __pyx_atomic_ptr_type atomic_uintptr_t
#define __pyx_nonatomic_ptr_type uintptr_t
#define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
#define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
#define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
#define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
#define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
#define __pyx_atomic_load(value) atomic_load(value)
#define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
#define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
#define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
#define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
#define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
#if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
#pragma message ("Using standard C atomics")
#elif defined(__PYX_DEBUG_ATOMICS)
#warning "Using standard C atomics"
#endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
(__cplusplus >= 201103L) ||\
\
(defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
ATOMIC_INT_LOCK_FREE == 2)
#undef __pyx_atomic_int_type
#define __pyx_atomic_int_type std::atomic_int
#define __pyx_atomic_ptr_type std::atomic_uintptr_t
#define __pyx_nonatomic_ptr_type uintptr_t
#define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
#define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
#define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
#define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
#define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
#define __pyx_atomic_load(value) std::atomic_load(value)
#define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
#define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
#define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
#define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
#define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
#if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
#pragma message ("Using standard C++ atomics")
#elif defined(__PYX_DEBUG_ATOMICS)
#warning "Using standard C++ atomics"
#endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
(__GNUC_MINOR__ > 1 ||\
(__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
#define __pyx_atomic_ptr_type void*
#define __pyx_nonatomic_ptr_type void*
#define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
#define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
#define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
#define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
__pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
int result = old == *expected;
*expected = old;
return result;
}
#define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
#define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
#define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
#define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
#define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
__pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
int result = old == *expected;
*expected = old;
return result;
}
#ifdef __PYX_DEBUG_ATOMICS
#warning "Using GNU atomics"
#endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
#include <intrin.h>
#undef __pyx_atomic_int_type
#define __pyx_atomic_int_type long
#define __pyx_atomic_ptr_type void*
#undef __pyx_nonatomic_int_type
#define __pyx_nonatomic_int_type long
#define __pyx_nonatomic_ptr_type void*
#pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
#define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
#define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
#define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
#define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
__pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
int result = old == *expected;
*expected = old;
return result;
}
#define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
#define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
#define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
#define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
#define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
__pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
int result = old == *expected;
*expected = old;
return result;
}
#ifdef __PYX_DEBUG_ATOMICS
#pragma message ("Using MSVC atomics")
#endif
#else
#undef CYTHON_ATOMICS
#define CYTHON_ATOMICS 0
#ifdef __PYX_DEBUG_ATOMICS
#warning "Not using atomics"
#endif
#endif
/* CriticalSectionsDefinition.proto (used by CriticalSections) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_End(cs)
#define __Pyx_PyCriticalSection2_End(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_End PyCriticalSection_End
#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
#endif
/* CriticalSections.proto (used by CythonFunctionShared) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
#define __PYX_FORCE_INIT_THREADS 0
#endif
/* BufferFormatStructs.proto */
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
const char* name;
const struct __Pyx_StructField_* fields;
size_t size;
size_t arraysize[8];
int ndim;
char typegroup;
char is_unsigned;
int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
const __Pyx_TypeInfo* type;
const char* name;
size_t offset;
} __Pyx_StructField;
typedef struct {
const __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;
size_t struct_alignment;
int is_complex;
char enc_type;
char new_packmode;
char enc_packmode;
char is_valid_array;
} __Pyx_BufFmt_Context;
/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
char *data;
Py_ssize_t shape[8];
Py_ssize_t strides[8];
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
#define __Pyx_MemoryView_Len(m) (m.shape[0])
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
#define __Pyx_MEMVIEW_FULL 4
#define __Pyx_MEMVIEW_CONTIG 8
#define __Pyx_MEMVIEW_STRIDED 16
#define __Pyx_MEMVIEW_FOLLOW 32
#define __Pyx_IS_C_CONTIG 1
#define __Pyx_IS_F_CONTIG 2
#define __Pyx_MEMSLICE_INIT { 0, 0, { 0 }, { 0 }, { 0 } }
#if CYTHON_ATOMICS
#define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
#define __pyx_sub_acquisition_count(memview)\
__pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
#else
#define __pyx_add_acquisition_count(memview)\
__pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
/* #### Code section: numeric_typedefs ### */
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":744
* # 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;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":745
*
* 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;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":746
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
* ctypedef npy_int64 int64_t
*
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":747
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
*
* ctypedef npy_uint8 uint8_t
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":749
* ctypedef npy_int64 int64_t
*
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":750
*
* 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;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":751
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
* ctypedef npy_uint64 uint64_t
*
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":752
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
*
* ctypedef npy_float32 float32_t
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":754
* ctypedef npy_uint64 uint64_t
*
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
* ctypedef npy_float64 float64_t
* #ctypedef npy_float80 float80_t
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":755
*
* 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;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":762
* ctypedef double complex complex128_t
*
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
* ctypedef npy_ulonglong ulonglong_t
*
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":763
*
* ctypedef npy_longlong longlong_t
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
*
* ctypedef npy_intp intp_t
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":765
* ctypedef npy_ulonglong ulonglong_t
*
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
* ctypedef npy_uintp uintp_t
*
*/
typedef npy_intp __pyx_t_5numpy_intp_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":766
*
* ctypedef npy_intp intp_t
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
*
* ctypedef npy_double float_t
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":768
* 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;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":769
*
* ctypedef npy_double float_t
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
* ctypedef npy_longdouble longdouble_t
*
*/
typedef npy_double __pyx_t_5numpy_double_t;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":770
* ctypedef npy_double float_t
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
*
* ctypedef float complex cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
/* #### Code section: complex_type_declarations ### */
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#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
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#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
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#ifdef __cplusplus
typedef ::std::complex< long double > __pyx_t_long_double_complex;
#else
typedef long double _Complex __pyx_t_long_double_complex;
#endif
#else
typedef struct { long double real, imag; } __pyx_t_long_double_complex;
#endif
static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
/* #### Code section: type_declarations ### */
/*--- Type declarations ---*/
struct __pyx_array_obj;
struct __pyx_memoryview_obj;
struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries;
struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs;
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode;
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree;
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__;
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query;
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point;
/* "scipy/_cyutility.pxd":36
* int ndim, size_t itemsize) nogil
*
* @cname("__pyx_array") # <<<<<<<<<<<<<<
* cdef class array:
*
*/
struct __pyx_array_obj {
PyObject_HEAD
struct __pyx_vtabstruct_5scipy_10_cyutility_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
int ndim;
Py_ssize_t *_shape;
Py_ssize_t *_strides;
Py_ssize_t itemsize;
PyObject *mode;
PyObject *_format;
void (*callback_free_data)(void *);
int free_data;
int dtype_is_object;
};
/* "scipy/_cyutility.pxd":63
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf)
*
* @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
* cdef class memoryview:
*
*/
struct __pyx_memoryview_obj {
PyObject_HEAD
struct __pyx_vtabstruct_5scipy_10_cyutility_memoryview *__pyx_vtab;
PyObject *obj;
PyObject *_size;
void *_unused;
PyThread_type_lock lock;
__pyx_atomic_int_type acquisition_count;
Py_buffer view;
int flags;
int dtype_is_object;
__Pyx_TypeInfo const *typeinfo;
};
/* "scipy/spatial/_ckdtree.pyx":159
* # =================
*
* cdef class coo_entries: # <<<<<<<<<<<<<<
*
* cdef:
*/
struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries {
PyObject_HEAD
PyObject *__pyx___array_interface__;
std::vector<struct coo_entry> *buf;
};
/* "scipy/spatial/_ckdtree.pyx":245
* # ====================
*
* cdef class ordered_pairs: # <<<<<<<<<<<<<<
*
* cdef:
*/
struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs {
PyObject_HEAD
PyObject *__pyx___array_interface__;
std::vector<struct ordered_pair> *buf;
};
/* "scipy/spatial/_ckdtree.pyx":305
* # ================================
*
* cdef class cKDTreeNode: # <<<<<<<<<<<<<<
* """
* class cKDTreeNode
*/
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode {
PyObject_HEAD
struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_vtab;
__pyx_t_5numpy_intp_t level;
__pyx_t_5numpy_intp_t split_dim;
__pyx_t_5numpy_intp_t children;
__pyx_t_5numpy_intp_t start_idx;
__pyx_t_5numpy_intp_t end_idx;
__pyx_t_5numpy_float64_t split;
PyArrayObject *_data;
PyArrayObject *_indices;
PyObject *lesser;
PyObject *greater;
};
/* "scipy/spatial/_ckdtree.pyx":414
* # ==================
*
* cdef class cKDTree: # <<<<<<<<<<<<<<
* """cKDTree(data, leafsize=16, compact_nodes=True, copy_data=False, balanced_tree=True, boxsize=None)\n--
*
*/
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree {
PyObject_HEAD
struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_vtab;
struct ckdtree *cself;
PyObject *_python_tree;
PyArrayObject *data;
PyArrayObject *maxes;
PyArrayObject *mins;
PyArrayObject *indices;
PyObject *boxsize;
PyArrayObject *boxsize_data;
std::once_flag flag;
};
/* "scipy/spatial/_ckdtree.pyx":545
* property tree:
* # make the tree viewable from Python
* def __get__(cKDTree self): # <<<<<<<<<<<<<<
* cdef cKDTreeNode n
* cdef ckdtree *cself = self.cself
*/
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__ {
PyObject_HEAD
struct ckdtree *__pyx_v_cself;
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self;
};
/* "scipy/spatial/_ckdtree.pyx":693
* # -----
*
* @cython.boundscheck(False) # <<<<<<<<<<<<<<
* def query(cKDTree self, object x, object k=1, np.float64_t eps=0.0,
* np.float64_t p=2.0, np.float64_t distance_upper_bound=INFINITY,
*/
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query {
PyObject_HEAD
struct ckdtree *__pyx_v_cself;
__Pyx_memviewslice __pyx_v_dd;
__pyx_t_5numpy_float64_t __pyx_v_distance_upper_bound;
__pyx_t_5numpy_float64_t __pyx_v_eps;
__Pyx_memviewslice __pyx_v_ii;
__Pyx_memviewslice __pyx_v_kk;
__pyx_t_5numpy_intp_t __pyx_v_kmax;
__pyx_t_5numpy_float64_t __pyx_v_p;
__Pyx_memviewslice __pyx_v_xx;
};
/* "scipy/spatial/_ckdtree.pyx":876
* # ----------------
*
* def query_ball_point(cKDTree self, object x, object r, # <<<<<<<<<<<<<<
* np.float64_t p=2.0, np.float64_t eps=0.0,
* object workers=None,
*/
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point {
PyObject_HEAD
struct ckdtree *__pyx_v_cself;
__pyx_t_5numpy_float64_t __pyx_v_eps;
__pyx_t_5numpy_float64_t __pyx_v_p;
bool __pyx_v_rlen;
bool __pyx_v_sort_output;
__Pyx_memviewslice __pyx_v_vlen;
__Pyx_memviewslice __pyx_v_vout;
__pyx_t_5numpy_float64_t const *__pyx_v_vrr;
__pyx_t_5numpy_float64_t const *__pyx_v_vxx;
};
/* "scipy/_cyutility.pxd":36
* int ndim, size_t itemsize) nogil
*
* @cname("__pyx_array") # <<<<<<<<<<<<<<
* cdef class array:
*
*/
struct __pyx_vtabstruct_5scipy_10_cyutility_array {
PyObject *(*get_memview)(struct __pyx_array_obj *);
};
static struct __pyx_vtabstruct_5scipy_10_cyutility_array *__pyx_vtabptr_5scipy_10_cyutility_array;
/* "scipy/_cyutility.pxd":63
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf)
*
* @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
* cdef class memoryview:
*
*/
struct __pyx_vtabstruct_5scipy_10_cyutility_memoryview {
char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
};
static struct __pyx_vtabstruct_5scipy_10_cyutility_memoryview *__pyx_vtabptr_5scipy_10_cyutility_memoryview;
/* "scipy/spatial/_ckdtree.pyx":305
* # ================================
*
* cdef class cKDTreeNode: # <<<<<<<<<<<<<<
* """
* class cKDTreeNode
*/
struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTreeNode {
void (*_setup)(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *, struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *, struct ckdtreenode *, __pyx_t_5numpy_intp_t);
};
static struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_vtabptr_5scipy_7spatial_8_ckdtree_cKDTreeNode;
/* "scipy/spatial/_ckdtree.pyx":414
* # ==================
*
* cdef class cKDTree: # <<<<<<<<<<<<<<
* """cKDTree(data, leafsize=16, compact_nodes=True, copy_data=False, balanced_tree=True, boxsize=None)\n--
*
*/
struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree {
PyObject *(*_pre_init)(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *);
PyObject *(*_post_init)(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *);
PyObject *(*_post_init_traverse)(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *, struct ckdtreenode *);
};
static struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_vtabptr_5scipy_7spatial_8_ckdtree_cKDTree;
/* #### Code section: utility_code_proto ### */
/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, Py_ssize_t);
void (*DECREF)(void*, PyObject*, Py_ssize_t);
void (*GOTREF)(void*, PyObject*, Py_ssize_t);
void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
void* (*SetupContext)(const char*, Py_ssize_t, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
if (acquire_gil) {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
PyGILState_Release(__pyx_gilstate_save);\
} else {\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
}
#define __Pyx_RefNannyFinishContextNogil() {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__Pyx_RefNannyFinishContext();\
PyGILState_Release(__pyx_gilstate_save);\
}
#define __Pyx_RefNannyFinishContextNogil() {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__Pyx_RefNannyFinishContext();\
PyGILState_Release(__pyx_gilstate_save);\
}
#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); else {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name, acquire_gil)
#define __Pyx_RefNannyFinishContextNogil()
#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
#define __Pyx_Py_XDECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; Py_XDECREF(tmp);\
} while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_XDECREF(tmp);\
} while (0)
#define __Pyx_DECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_DECREF(tmp);\
} while (0)
#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)
/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
#endif
/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
#endif
/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
#endif
/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
/* GetTopmostException.proto (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif
/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
#endif
/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif
/* PyImportError_Check.proto */
#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
/* PyObjectCall.proto (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);
/* RaiseException */
static void(*__Pyx_Raise)(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
/* ReleaseUnknownGil.proto */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
typedef struct {
PyThreadState* ts;
PyGILState_STATE gil_state;
} __Pyx_UnknownThreadState;
#else
#define __Pyx_UnknownThreadState PyThreadState*
#endif
static __Pyx_UnknownThreadState __Pyx_SaveUnknownThread(void);
static void __Pyx_RestoreUnknownThread(__Pyx_UnknownThreadState state);
static CYTHON_INLINE int __Pyx_UnknownThreadStateDefinitelyHadGil(__Pyx_UnknownThreadState state);
static CYTHON_INLINE int __Pyx_UnknownThreadStateMayHaveHadGil(__Pyx_UnknownThreadState state);
/* TupleAndListFromArray.proto (used by fastcall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
/* IncludeStringH.proto (used by BytesEquals) */
#include <string.h>
/* BytesEquals.proto (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
/* UnicodeEquals.proto (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
#define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
#define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
#define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
#define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
#define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
#else
#define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
#endif
#else
#define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
#define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
#define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
#define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
#define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif
/* RaiseArgTupleInvalid.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);
/* RejectKeywords */
static void(*__Pyx_RejectKeywords)(const char* function_name, PyObject *kwds); /*proto*/
/* PyDictVersioning.proto (used by GetModuleGlobalName) */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
(version_var) = __PYX_GET_DICT_VERSION(dict);\
(cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
static PY_UINT64_T __pyx_dict_version = 0;\
static PyObject *__pyx_dict_cached_value = NULL;\
if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
(VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
} else {\
(VAR) = __pyx_dict_cached_value = (LOOKUP);\
__pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
}\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict) (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
#endif
/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name) do {\
static PY_UINT64_T __pyx_dict_version = 0;\
static PyObject *__pyx_dict_cached_value = NULL;\
(var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
(likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
__Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
PY_UINT64_T __pyx_dict_version;\
PyObject *__pyx_dict_cached_value;\
(var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif
/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif
/* PyObjectVectorCallMethodKwBuilder.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif
/* ParseKeywordsImpl */
static int(*__Pyx_ParseKeywordsTuple)(PyObject *kwds, PyObject * const *kwvalues, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs); /*proto*/
static int(*__Pyx_ParseKeywordDictToDict)(PyObject *kwds, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
static int(*__Pyx_ParseKeywordDict)(PyObject *kwds, PyObject ** const argnames[], PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs); /*proto*/
/* ParseKeywords.proto */
static CYTHON_INLINE int __Pyx_ParseKeywords(
PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
PyObject *kwds2, PyObject *values[],
Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
const char* function_name,
int ignore_unknown_kwargs
);
/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif
/* DictGetItem.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
(likely(PyDict_CheckExact(obj)) ?\
__Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
#endif
/* PyTypeError_Check.proto */
#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\
(inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
#endif
/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
int full_traceback, int nogil);
/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\
(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck, int unsafe_shared);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck, int unsafe_shared);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck, int unsafe_shared);
/* PyObjectCallOneArg.proto (used by ObjectGetItem) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
#else
#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
#endif
/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
/* PyUnicode_Unicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);
/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_FormatSimple(s, f) (\
likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_FormatSimple(s, f) (\
likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
PyObject_Format(s, f))
#else
#define __Pyx_PyObject_FormatSimple(s, f) (\
likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
PyObject_Format(s, f))
#endif
/* JoinPyUnicode */
static PyObject*(*__Pyx_PyUnicode_Join)(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /*proto*/
/* PyNotImplementedError_Check.proto */
#define __Pyx_PyExc_NotImplementedError_Check(obj) __Pyx_TypeCheck(obj, PyExc_NotImplementedError)
/* PyValueError_Check.proto */
#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
/* RaiseClosureNameError.proto */
static void __Pyx_RaiseClosureNameError(const char *varname);
/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif
/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
/* FixUpExtensionType.proto (used by FetchCommonType) */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
__PYX_LIMITED_VERSION_HEX < 0x030d0000)
static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
#else
#define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#endif
/* FetchSharedCythonModule.proto (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);
/* FetchCommonType.proto (used by CommonTypesMetaclass) */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED
/* CallTypeTraverse.proto (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif
/* PyMethodNew.proto (used by CythonFunctionShared) */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
/* py_dict_items.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
/* CallCFunction.proto (used by CallUnboundCMethod0) */
#define __Pyx_CallCFunction(cfunc, self, args)\
((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
typedef struct {
PyObject *type;
PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
__pyx_atomic_int_type initialized;
#endif
PyCFunction func;
PyObject *method;
int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
return 1;
#else
__pyx_nonatomic_int_type expected = 0;
if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
return 0;
}
return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
__pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif
/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
#endif
/* py_dict_values.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
/* OwnedDictNext.proto (used by PyVectorcallFastCallDict) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
#else
CYTHON_INLINE
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
#endif
/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif
/* CythonFunctionShared.proto (used by CythonFunction) */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
#define __Pyx_CYFUNCTION_COROUTINE 0x08
#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
#define __Pyx_CyFunction_GetClassObj(f)\
((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
__Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject_HEAD
PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
PyCFunctionObject func;
#else
PyCMethodObject func;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL
__pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *func_weakreflist;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
PyObject *func_dict;
#endif
PyObject *func_name;
PyObject *func_qualname;
PyObject *func_doc;
PyObject *func_globals;
PyObject *func_code;
PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
PyObject *func_classobj;
#endif
PyObject *defaults;
int flags;
PyObject *defaults_tuple;
PyObject *defaults_kwdict;
PyObject *(*defaults_getter)(PyObject *);
PyObject *func_annotations;
PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
int flags, PyObject* qualname,
PyObject *closure,
PyObject *module, PyObject *globals,
PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
PyTypeObject *defaults_type);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif
/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
PyObject *closure,
PyObject *module, PyObject *globals,
PyObject* code);
/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#endif
/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
__Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);
/* RaiseClosureNameErrorNogil.proto */
static void __Pyx_RaiseClosureNameErrorNogil(const char *varname);
/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
(inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif
/* pybytes_as_double.proto (used by pynumber_float) */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
char* as_c_string;
Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
as_c_string = PyBytes_AS_STRING(obj);
size = PyBytes_GET_SIZE(obj);
#else
if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
return (double)-1;
}
#endif
return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}
static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
char* as_c_string;
Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
as_c_string = PyByteArray_AS_STRING(obj);
size = PyByteArray_GET_SIZE(obj);
#else
as_c_string = PyByteArray_AsString(obj);
if (as_c_string == NULL) {
return (double)-1;
}
size = PyByteArray_Size(obj);
#endif
return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}
/* pyunicode_as_double.proto (used by pynumber_float) */
#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
int last_was_punctuation;
Py_ssize_t i;
last_was_punctuation = 1;
for (i=start; i <= end; i++) {
Py_UCS4 chr = PyUnicode_READ(kind, data, i);
int is_punctuation = (chr == '_') | (chr == '.');
*buffer = (char)chr;
buffer += (chr != '_');
if (unlikely(chr > 127)) goto parse_failure;
if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
last_was_punctuation = is_punctuation;
}
if (unlikely(last_was_punctuation)) goto parse_failure;
*buffer = '\0';
return buffer;
parse_failure:
return NULL;
}
static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
int matches = 1;
Py_UCS4 chr;
Py_UCS4 sign = PyUnicode_READ(kind, data, start);
int is_signed = (sign == '-') | (sign == '+');
start += is_signed;
length -= is_signed;
switch (PyUnicode_READ(kind, data, start)) {
#ifdef Py_NAN
case 'n':
case 'N':
if (unlikely(length != 3)) goto parse_failure;
chr = PyUnicode_READ(kind, data, start+1);
matches &= (chr == 'a') | (chr == 'A');
chr = PyUnicode_READ(kind, data, start+2);
matches &= (chr == 'n') | (chr == 'N');
if (unlikely(!matches)) goto parse_failure;
return (sign == '-') ? -Py_NAN : Py_NAN;
#endif
case 'i':
case 'I':
if (unlikely(length < 3)) goto parse_failure;
chr = PyUnicode_READ(kind, data, start+1);
matches &= (chr == 'n') | (chr == 'N');
chr = PyUnicode_READ(kind, data, start+2);
matches &= (chr == 'f') | (chr == 'F');
if (likely(length == 3 && matches))
return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
if (unlikely(length != 8)) goto parse_failure;
chr = PyUnicode_READ(kind, data, start+3);
matches &= (chr == 'i') | (chr == 'I');
chr = PyUnicode_READ(kind, data, start+4);
matches &= (chr == 'n') | (chr == 'N');
chr = PyUnicode_READ(kind, data, start+5);
matches &= (chr == 'i') | (chr == 'I');
chr = PyUnicode_READ(kind, data, start+6);
matches &= (chr == 't') | (chr == 'T');
chr = PyUnicode_READ(kind, data, start+7);
matches &= (chr == 'y') | (chr == 'Y');
if (unlikely(!matches)) goto parse_failure;
return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
break;
default:
goto parse_failure;
}
return 0.0;
parse_failure:
return -1.0;
}
static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
double value;
const char *last;
char *end;
Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
const int kind = PyUnicode_KIND(obj);
const void* data = PyUnicode_DATA(obj);
start = 0;
while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
start++;
while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
length--;
length -= start;
if (unlikely(length <= 0)) goto fallback;
value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
if (unlikely(value == -1.0)) goto fallback;
if (value != 0.0) return value;
if (length < 40) {
char number[40];
last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
if (unlikely(!last)) goto fallback;
value = PyOS_string_to_double(number, &end, NULL);
} else {
char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char));
if (unlikely(!number)) goto fallback;
last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
if (unlikely(!last)) {
PyMem_Free(number);
goto fallback;
}
value = PyOS_string_to_double(number, &end, NULL);
PyMem_Free(number);
}
if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
return value;
}
fallback:
return __Pyx_SlowPyString_AsDouble(obj);
}
#endif
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
return (double)-1;
if (likely(PyUnicode_IS_ASCII(obj))) {
const char *s;
Py_ssize_t length;
s = PyUnicode_AsUTF8AndSize(obj, &length);
return __Pyx__PyBytes_AsDouble(obj, s, length);
}
return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
#else
return __Pyx_SlowPyString_AsDouble(obj);
#endif
}
/* pynumber_float.proto */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj);
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))
/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck, unsafe_shared) :\
(is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
__Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
int is_list, int wraparound, int boundscheck, int unsafe_shared);
/* ArgTypeTestFunc */
static int(*__Pyx__ArgTypeTest)(PyObject *obj, PyTypeObject *type, const char *name, int exact); /*proto*/
/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
__Pyx__ArgTypeTest(obj, type, name, exact))
/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
/* RaiseUnboundLocalError.proto */
static void __Pyx_RaiseUnboundLocalError(const char *varname);
/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
if (likely(L->allocated > len)) {
Py_INCREF(x);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
L->ob_item[len] = x;
#else
PyList_SET_ITEM(list, len, x);
#endif
__Pyx_SET_SIZE(list, len + 1);
return 0;
}
return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif
/* DivInt[__pyx_t_5numpy_intp_t].proto */
static CYTHON_INLINE __pyx_t_5numpy_intp_t __Pyx_div___pyx_t_5numpy_intp_t(__pyx_t_5numpy_intp_t, __pyx_t_5numpy_intp_t, int b_is_constant);
/* UnaryNegOverflows.proto */
#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
(((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
/* PyAttributeError_Check.proto */
#define __Pyx_PyExc_AttributeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AttributeError)
/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);
/* DefaultPlacementNew.proto */
#include <new>
template<typename T>
void __Pyx_default_placement_construct(T* x) {
new (static_cast<void*>(x)) T();
}
/* CheckTypeForFreelists.proto */
#if CYTHON_USE_FREELISTS
#if CYTHON_USE_TYPE_SPECS
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS Py_TPFLAGS_IS_ABSTRACT
#else
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)
#endif
#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\
(__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\
(int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS)))
#endif
/* PyObjectCallNoArg.proto (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
/* PyObjectGetMethod.proto (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
#endif
/* PyObjectCallMethod0.proto (used by PyType_Ready) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
/* ValidateBasesTuple.proto (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif
/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
/* DelItemOnTypeDict.proto (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);
/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
/* GetVTable.proto (used by MergeVTables) */
static void* __Pyx_GetVtable(PyTypeObject *type);
/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);
/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_4
#define __PYX_HAVE_RT_ImportType_proto_3_2_4
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_4(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_4(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_4 {
__Pyx_ImportType_CheckSize_Error_3_2_4 = 0,
__Pyx_ImportType_CheckSize_Warn_3_2_4 = 1,
__Pyx_ImportType_CheckSize_Ignore_3_2_4 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_4(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_4 check_size);
#endif
/* FunctionImport.proto */
static int __Pyx_ImportFunction_3_2_4(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
/* ImportImpl */
static PyObject *(*__Pyx__Import)(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level); /*proto*/
/* Import.proto */
static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
/* ListPack.proto */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...);
/* CLineInTraceback.proto (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif
/* CodeObjectCache.proto (used by AddTraceback) */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
__Pyx_CachedCodeObjectType* code_object;
int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
int max_count;
__Pyx_CodeObjectCacheEntry* entries;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
__pyx_atomic_int_type accessor_count;
#endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif
/* CheckUnpickleChecksum.proto */
static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
/* BufferStructDeclare.proto */
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[8];
} __Pyx_LocalBuf_ND;
/* MemviewRefcount.proto */
static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
__pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
__pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
try {
if (PyErr_Occurred())
; // let the latest Python exn pass through and ignore the current one
else
throw;
} catch (const std::bad_alloc& exn) {
PyErr_SetString(PyExc_MemoryError, exn.what());
} catch (const std::bad_cast& exn) {
PyErr_SetString(PyExc_TypeError, exn.what());
} catch (const std::bad_typeid& exn) {
PyErr_SetString(PyExc_TypeError, exn.what());
} catch (const std::domain_error& exn) {
PyErr_SetString(PyExc_ValueError, exn.what());
} catch (const std::invalid_argument& exn) {
PyErr_SetString(PyExc_ValueError, exn.what());
} catch (const std::ios_base::failure& exn) {
PyErr_SetString(PyExc_IOError, exn.what());
} catch (const std::out_of_range& exn) {
PyErr_SetString(PyExc_IndexError, exn.what());
} catch (const std::overflow_error& exn) {
PyErr_SetString(PyExc_OverflowError, exn.what());
} catch (const std::range_error& exn) {
PyErr_SetString(PyExc_ArithmeticError, exn.what());
} catch (const std::underflow_error& exn) {
PyErr_SetString(PyExc_ArithmeticError, exn.what());
} catch (const std::exception& exn) {
PyErr_SetString(PyExc_RuntimeError, exn.what());
}
catch (...)
{
PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
}
}
#endif
/* MemviewSliceValidateAndInit */
static int(*__Pyx_ValidateAndInit_memviewslice)(int *axes_specs, int c_or_f_flag, int buf_flags, int ndim, const __Pyx_TypeInfo *dtype, __Pyx_BufFmt_StackElem stack[], __Pyx_memviewslice *memviewslice, PyObject *original_obj); /*proto*/
/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t__const__(PyObject *, int writable_flag);
/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_intp_t(PyObject *, int writable_flag);
/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(PyObject *, int writable_flag);
/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(char *itemp, PyObject *obj);
/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_intp_t(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_intp_t(char *itemp, PyObject *obj);
/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_object(PyObject *, int writable_flag);
/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_char(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_char(char *itemp, PyObject *obj);
/* RealImag.proto */
#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(__cplusplus) && CYTHON_CCOMPLEX\
&& (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
#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
/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#define __Pyx_c_eq_float(a, b) ((a)==(b))
#define __Pyx_c_sum_float(a, b) ((a)+(b))
#define __Pyx_c_diff_float(a, b) ((a)-(b))
#define __Pyx_c_prod_float(a, b) ((a)*(b))
#define __Pyx_c_quot_float(a, b) ((a)/(b))
#define __Pyx_c_neg_float(a) (-(a))
#ifdef __cplusplus
#define __Pyx_c_is_zero_float(z) ((z)==(float)0)
#define __Pyx_c_conj_float(z) (::std::conj(z))
#if 1
#define __Pyx_c_abs_float(z) (::std::abs(z))
#define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
#endif
#else
#define __Pyx_c_is_zero_float(z) ((z)==0)
#define __Pyx_c_conj_float(z) (conjf(z))
#if 1
#define __Pyx_c_abs_float(z) (cabsf(z))
#define __Pyx_c_pow_float(a, b) (cpowf(a, b))
#endif
#endif
#else
static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
#if 1
static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
#endif
#endif
/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#define __Pyx_c_eq_double(a, b) ((a)==(b))
#define __Pyx_c_sum_double(a, b) ((a)+(b))
#define __Pyx_c_diff_double(a, b) ((a)-(b))
#define __Pyx_c_prod_double(a, b) ((a)*(b))
#define __Pyx_c_quot_double(a, b) ((a)/(b))
#define __Pyx_c_neg_double(a) (-(a))
#ifdef __cplusplus
#define __Pyx_c_is_zero_double(z) ((z)==(double)0)
#define __Pyx_c_conj_double(z) (::std::conj(z))
#if 1
#define __Pyx_c_abs_double(z) (::std::abs(z))
#define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
#endif
#else
#define __Pyx_c_is_zero_double(z) ((z)==0)
#define __Pyx_c_conj_double(z) (conj(z))
#if 1
#define __Pyx_c_abs_double(z) (cabs(z))
#define __Pyx_c_pow_double(a, b) (cpow(a, b))
#endif
#endif
#else
static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
#if 1
static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
#endif
#endif
/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#define __Pyx_c_eq_long__double(a, b) ((a)==(b))
#define __Pyx_c_sum_long__double(a, b) ((a)+(b))
#define __Pyx_c_diff_long__double(a, b) ((a)-(b))
#define __Pyx_c_prod_long__double(a, b) ((a)*(b))
#define __Pyx_c_quot_long__double(a, b) ((a)/(b))
#define __Pyx_c_neg_long__double(a) (-(a))
#ifdef __cplusplus
#define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
#define __Pyx_c_conj_long__double(z) (::std::conj(z))
#if 1
#define __Pyx_c_abs_long__double(z) (::std::abs(z))
#define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
#endif
#else
#define __Pyx_c_is_zero_long__double(z) ((z)==0)
#define __Pyx_c_conj_long__double(z) (conjl(z))
#if 1
#define __Pyx_c_abs_long__double(z) (cabsl(z))
#define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
#endif
#endif
#else
static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
#if 1
static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
#endif
#endif
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_intp(npy_intp value);
/* CIntFromPy.proto */
static CYTHON_INLINE npy_intp __Pyx_PyLong_As_npy_intp(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_uintp(npy_uintp value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_char(char value);
/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);
/* PyObjectCall2Args.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
/* UpdateUnpickledDict.proto */
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif
/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
#define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
#define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif
/* GetRuntimeVersion.proto */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
static unsigned long __Pyx_cached_runtime_version = 0;
static void __Pyx_init_runtime_version(void);
#else
#define __Pyx_init_runtime_version()
#endif
static unsigned long __Pyx_get_runtime_version(void);
/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
/* DecompressString.proto */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif
/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
#if CYTHON_METH_FASTCALL
#define __PYX_FASTCALL_ABI_SUFFIX "_fastcall"
#else
#define __PYX_FASTCALL_ABI_SUFFIX
#endif
#define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
#define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
#define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
#define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
#define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
#define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
#define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
#define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
#define __PYX_FREELISTS_ABI_SUFFIX
#else
#define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
static void __pyx_f_5scipy_7spatial_8_ckdtree_11cKDTreeNode__setup(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self, struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_parent, struct ckdtreenode *__pyx_v_node, __pyx_t_5numpy_intp_t __pyx_v_level); /* proto*/
static PyObject *__pyx_f_5scipy_7spatial_8_ckdtree_7cKDTree__pre_init(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_5scipy_7spatial_8_ckdtree_7cKDTree__post_init(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_5scipy_7spatial_8_ckdtree_7cKDTree__post_init_traverse(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, struct ckdtreenode *__pyx_v_node); /* proto*/
/* Module declarations from "libc.string" */
/* Module declarations from "libc.stdio" */
/* Module declarations from "__builtin__" */
/* Module declarations from "cpython.type" */
/* Module declarations from "cpython" */
/* Module declarations from "cpython.object" */
/* Module declarations from "cpython.ref" */
/* Module declarations from "numpy" */
/* Module declarations from "numpy" */
static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
/* Module declarations from "cpython.mem" */
/* Module declarations from "libcpp" */
/* Module declarations from "libcpp.mutex" */
/* Module declarations from "libcpp.vector" */
/* Module declarations from "libc.math" */
/* Module declarations from "cython.view" */
/* Module declarations from "cython.dataclasses" */
/* Module declarations from "cython" */
/* Module declarations from "scipy._cyutility" */
static int (*__pyx_array_allocate_buffer)(struct __pyx_array_obj *); /*proto*/
static struct __pyx_array_obj *(*__pyx_array_new)(PyObject *, Py_ssize_t, char *, char const *, char *); /*proto*/
static PyObject *(*__pyx_memoryview_new)(PyObject *, int, int, __Pyx_TypeInfo const *); /*proto*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
static struct __pyx_memoryview_obj *(*__pyx_memview_slice)(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static int (*__pyx_memoryview_slice_memviewslice)(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
static char *(*__pyx_pybuffer_index)(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
static int (*__pyx_memslice_transpose)(__Pyx_memviewslice *); /*proto*/
static PyObject *(*__pyx_memoryview_fromslice)(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *(*__pyx_memoryview_get_slice_from_memoryview)(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void (*__pyx_memoryview_slice_copy)(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *(*__pyx_memoryview_copy_object)(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *(*__pyx_memoryview_copy_object_from_slice)(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static char (*__pyx_get_best_slice_order)(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t (*__pyx_memoryview_slice_get_size)(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t (*__pyx_fill_contig_strides_array)(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *(*__pyx_memoryview_copy_data_to_temp)(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int (*__pyx_memoryview_err_extents)(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int (*__pyx_memoryview_err_dim)(PyObject *, PyObject *, int); /*proto*/
static int (*__pyx_memoryview_err)(PyObject *, PyObject *); /*proto*/
static int (*__pyx_memoryview_err_no_memory)(void); /*proto*/
static int (*__pyx_memoryview_copy_contents)(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void (*__pyx_memoryview_broadcast_leading)(__Pyx_memviewslice *, int, int); /*proto*/
static void (*__pyx_memoryview_refcount_copying)(__Pyx_memviewslice *, int, int, int); /*proto*/
static void (*__pyx_memoryview_refcount_objects_in_slice)(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void (*__pyx_memoryview_slice_assign_scalar)(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void (*__pyx_memoryview__slice_assign_scalar)(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static PyObject *(*__pyx_format_from_typeinfo)(__Pyx_TypeInfo const *); /*proto*/
/* Module declarations from "scipy.spatial._ckdtree" */
static __pyx_t_5numpy_intp_t __pyx_f_5scipy_7spatial_8_ckdtree_get_num_workers(PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_5scipy_7spatial_8_ckdtree__run_threads(PyObject *, __pyx_t_5numpy_intp_t, __pyx_t_5numpy_intp_t); /*proto*/
static __pyx_t_5numpy_intp_t __pyx_f_5scipy_7spatial_8_ckdtree_num_points(PyArrayObject *, __pyx_t_5numpy_intp_t); /*proto*/
static PyArrayObject *__pyx_f_5scipy_7spatial_8_ckdtree_broadcast_contiguous(PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_5scipy_7spatial_8_ckdtree___pyx_unpickle_cKDTreeNode__set_state(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
static const __Pyx_TypeInfo __Pyx_TypeInfo_char = { "char", NULL, sizeof(char), { 0 }, 0, 'H', __PYX_IS_UNSIGNED(char), 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t__const__ = { "const float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t const ), { 0 }, 0, 'R', 0, 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t = { "intp_t", NULL, sizeof(__pyx_t_5numpy_intp_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_intp_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_intp_t), 0 };
static const __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 };
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "scipy.spatial._ckdtree"
extern int __pyx_module_is_main_scipy__spatial___ckdtree;
int __pyx_module_is_main_scipy__spatial___ckdtree = 0;
/* Implementation of "scipy.spatial._ckdtree" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_object;
/* #### Code section: string_decls ### */
static const char __pyx_k_data__indices_children_end_idx[] = "_data, _indices, children, end_idx, greater, lesser, level, split, split_dim, start_idx";
/* #### Code section: decls ### */
static int __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries___cinit__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self); /* proto */
static int __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_2__init__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self); /* proto */
static void __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_4__dealloc__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_6ndarray(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_8dict(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_10coo_array(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_12dok_array(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_14coo_matrix(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_16dok_matrix(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_19__array_interface_____get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs___cinit__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self); /* proto */
static int __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_2__init__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self); /* proto */
static void __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_4__dealloc__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_6ndarray(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_8set(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_19__array_interface_____get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_11data_points___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7indices___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5level___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9split_dim___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_8children___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9start_idx___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7end_idx___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5split___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_6lesser___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7greater___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode___reduce_cython__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_2__setstate_cython__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_1n___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_1m___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_8leafsize___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4size___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_7__get___closure(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4tree___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static int __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree___cinit__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static int __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_2__init__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_data, __pyx_t_5numpy_intp_t __pyx_v_leafsize, PyObject *__pyx_v_compact_nodes, PyObject *__pyx_v_copy_data, PyObject *__pyx_v_balanced_tree, PyObject *__pyx_v_boxsize); /* proto */
static void __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4__dealloc__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_5query__thread_func(PyObject *__pyx_self, __pyx_t_5numpy_intp_t __pyx_v_start, __pyx_t_5numpy_intp_t __pyx_v_stop); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_6query(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_k, __pyx_t_5numpy_float64_t __pyx_v_eps, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_distance_upper_bound, PyObject *__pyx_v_workers, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_16query_ball_point__thread_func(PyObject *__pyx_self, __pyx_t_5numpy_intp_t __pyx_v_start, __pyx_t_5numpy_intp_t __pyx_v_stop); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_8query_ball_point(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_r, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_workers, PyObject *__pyx_v_return_sorted, PyObject *__pyx_v_return_length, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_10query_ball_tree(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_other, __pyx_t_5numpy_float64_t __pyx_v_r, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_eps); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_12query_pairs(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_r, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_output_type); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_14_build_weights(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_weights); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_16count_neighbors(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_other, PyObject *__pyx_v_r, __pyx_t_5numpy_float64_t __pyx_v_p, PyObject *__pyx_v_weights, int __pyx_v_cumulative); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_18sparse_distance_matrix(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_other, __pyx_t_5numpy_float64_t __pyx_v_max_distance, __pyx_t_5numpy_float64_t __pyx_v_p, PyObject *__pyx_v_output_type); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_20__getstate__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_22__setstate__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4data___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_5maxes___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4mins___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_7indices___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_7boxsize___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree___pyx_unpickle_cKDTreeNode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_5scipy_7spatial_8_ckdtree_coo_entries(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5scipy_7spatial_8_ckdtree_ordered_pairs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5scipy_7spatial_8_ckdtree_cKDTreeNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5scipy_7spatial_8_ckdtree_cKDTree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
#include <utility>
#include <exception>
namespace {
static PyGILState_STATE __pyx_libcpp_mutex_limited_api_ensure_gil() {
#if CYTHON_COMPILING_IN_LIMITED_API
if ((__PYX_LIMITED_VERSION_HEX < 0x030d0000) && __Pyx_get_runtime_version() < 0x030d0000) {
return PyGILState_Ensure();
}
#endif
return PyGILState_LOCKED; // Unused
}
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __pyx_libcpp_mutex_limited_api_release_gil(PyGILState_STATE gil_state) {
if (__Pyx_get_runtime_version() < 0x030d0000)
PyGILState_Release(gil_state);
}
#else
#define __pyx_libcpp_mutex_limited_api_release_gil(ignore) (void)ignore
#endif
static int __pyx_libcpp_mutex_has_gil() {
#if CYTHON_COMPILING_IN_LIMITED_API
if ((__PYX_LIMITED_VERSION_HEX >= 0x030d0000) || __Pyx_get_runtime_version() >= 0x030d0000) {
// In 3.13+ we can temporarily give up the GIL to find out what the thread state was
PyThreadState *ts = PyThreadState_Swap(NULL);
if (ts) {
PyThreadState_Swap(ts);
return 1;
}
return 0;
}
/* There is no way to know if we have the GIL. Therefore the only
* thing we can safely do is make absolutely sure that we have it
* in (__pyx_libcpp_mutex_limited_api_ensure_gil).
*/
return 1;
#elif PY_VERSION_HEX >= 0x030d0000
return PyThreadState_GetUnchecked() != NULL;
#elif PY_VERSION_HEX >= 0x030C0000
return _PyThreadState_UncheckedGet() != NULL;
#else
return PyGILState_Check();
#endif
}
template <typename F>
class __pyx_libcpp_mutex_cleanup_on_exit {
F on_exit;
bool invoke = true;
public:
explicit __pyx_libcpp_mutex_cleanup_on_exit(F f)
: on_exit(f)
{}
__pyx_libcpp_mutex_cleanup_on_exit(__pyx_libcpp_mutex_cleanup_on_exit &&rhs)
: on_exit(std::move(rhs.on_exit))
, invoke(rhs.invoke)
{
rhs.invoke = false;
}
__pyx_libcpp_mutex_cleanup_on_exit(const __pyx_libcpp_mutex_cleanup_on_exit&) = delete;
__pyx_libcpp_mutex_cleanup_on_exit& operator=(const __pyx_libcpp_mutex_cleanup_on_exit&) = delete;
~__pyx_libcpp_mutex_cleanup_on_exit() {
if (invoke)
on_exit();
}
};
template<typename F>
__pyx_libcpp_mutex_cleanup_on_exit<F> __pyx_make_libcpp_mutex_cleanup_on_exit(F f) {
return __pyx_libcpp_mutex_cleanup_on_exit<F>(std::move(f));
}
template <typename Callable, typename ... Args>
void __pyx_cpp_py_safe_call_once(std::once_flag& flag, Callable& callable, Args&&... args) {
class PyException : public std::exception {
public:
using std::exception::exception;
};
__Pyx_UnknownThreadState thread_state = __Pyx_SaveUnknownThread();
auto on_exit = __pyx_make_libcpp_mutex_cleanup_on_exit(
[&]() {
__Pyx_RestoreUnknownThread(thread_state);
});
try {
std::call_once(flag,
[&](Args& ...args) {
// Make sure we have the GIL
PyGILState_STATE gil_state;
int had_gil_on_call = __Pyx_UnknownThreadStateDefinitelyHadGil(thread_state);
if (had_gil_on_call) {
__Pyx_RestoreUnknownThread(thread_state);
} else {
gil_state = PyGILState_Ensure();
}
auto on_callable_exit = __pyx_make_libcpp_mutex_cleanup_on_exit(
[&]() {
if (had_gil_on_call) {
thread_state = __Pyx_SaveUnknownThread();
} else {
PyGILState_Release(gil_state);
}
});
std::forward<Callable>(callable)(std::forward<Args>(args)...);
if (PyErr_Occurred()) {
throw PyException();
}
},
std::forward<Args>(args)...
);
} catch (const PyException&) {
// Do nothing
}
}
CYTHON_UNUSED void __pyx_cpp_py_safe_call_object_once(std::once_flag& flag, PyObject *py_callable) {
auto callable = [py_callable]() {
auto result = PyObject_CallObject(py_callable, nullptr);
Py_XDECREF(result);
};
__pyx_cpp_py_safe_call_once(flag, callable);
}
template <typename LockableT>
void __pyx_std_lock_wrapper(LockableT& arg0) {
// std::lock only handles 2 or more arguments.
// So create a 1 argument version.
arg0.lock();
}
template <typename Lockable0T, typename Lockable1T, typename ... Lockables>
void __pyx_std_lock_wrapper(Lockable0T& arg0, Lockable1T& arg1, Lockables&... args) {
std::lock(arg0, arg1, args...);
}
inline void __pyx_libcpp_mutex_unlock() {} // no-op
template <typename Lockable0T, typename ... Lockables>
void __pyx_libcpp_mutex_unlock(Lockable0T& arg0, Lockables&... locks) {
arg0.unlock();
__pyx_libcpp_mutex_unlock(locks...);
}
template <typename LockableT>
int __pyx_std_try_lock_wrapper(LockableT& arg0) {
// std::try_lock only handles 2 or more arguments.
// So create a 1 argument version.
if (arg0.try_lock()) {
return -1;
}
return 0;
}
template <typename Lockable0T, typename Lockable1T, typename ...Lockables>
int __pyx_std_try_lock_wrapper(Lockable0T& arg0, Lockable1T& arg1, Lockables&... args) {
return std::try_lock(arg0, arg1, args...);
}
template <typename... LockTs>
void __pyx_py_safe_std_lock_release_lock_reacquire(LockTs& ...locks) {
// Release the GIL, acquire the lock, then reacquire the GIL.
// This is safe provided the user never holds the GIL while trying
// to reacquire the lock (i.e. it's safe provided they always use
// the py-safe wrappers).
PyThreadState *_save;
Py_UNBLOCK_THREADS
try {
__pyx_std_lock_wrapper(locks...);
} catch (...) {
// In this case, we probably can't reason about the state of the locks but we can at least
// make sure the GIL is consistent.
Py_BLOCK_THREADS
throw;
}
Py_BLOCK_THREADS
return;
}
template <typename... LockTs>
void __pyx_py_safe_std_lock(LockTs& ...locks) {
PyGILState_STATE gil_state = __pyx_libcpp_mutex_limited_api_ensure_gil();
int had_gil_on_call = __pyx_libcpp_mutex_has_gil();
auto on_exit = __pyx_make_libcpp_mutex_cleanup_on_exit(
[&]() {
__pyx_libcpp_mutex_limited_api_release_gil(gil_state);
});
if (!had_gil_on_call) {
// Nothing special to do - just lock and quit
__pyx_std_lock_wrapper(locks...);
return;
}
// It's a real shame there's no try_lock for the GIL, otherwise
// we could just defer this whole thing to c++ std::lock.
if (__pyx_std_try_lock_wrapper(locks...) == -1) {
// success!
return;
}
__pyx_py_safe_std_lock_release_lock_reacquire(locks...);
}
template <typename MutexT>
std::unique_lock<MutexT> __pyx_py_safe_construct_unique_lock(MutexT& mutex) {
std::unique_lock<MutexT> l{mutex, std::defer_lock};
__pyx_py_safe_std_lock(l);
return l;
}
} // namespace
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
#define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
#define CYTHON_SMALL_CODE __attribute__((cold))
#else
#define CYTHON_SMALL_CODE
#endif
#endif
typedef struct {
PyObject *__pyx_d;
PyObject *__pyx_b;
PyObject *__pyx_cython_runtime;
PyObject *__pyx_empty_tuple;
PyObject *__pyx_empty_bytes;
PyObject *__pyx_empty_unicode;
PyTypeObject *__pyx_ptype_7cpython_4type_type;
PyTypeObject *__pyx_ptype_5numpy_dtype;
PyTypeObject *__pyx_ptype_5numpy_flatiter;
PyTypeObject *__pyx_ptype_5numpy_broadcast;
PyTypeObject *__pyx_ptype_5numpy_ndarray;
PyTypeObject *__pyx_ptype_5numpy_generic;
PyTypeObject *__pyx_ptype_5numpy_number;
PyTypeObject *__pyx_ptype_5numpy_integer;
PyTypeObject *__pyx_ptype_5numpy_signedinteger;
PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
PyTypeObject *__pyx_ptype_5numpy_inexact;
PyTypeObject *__pyx_ptype_5numpy_floating;
PyTypeObject *__pyx_ptype_5numpy_complexfloating;
PyTypeObject *__pyx_ptype_5numpy_flexible;
PyTypeObject *__pyx_ptype_5numpy_character;
PyTypeObject *__pyx_ptype_5numpy_ufunc;
PyObject *__pyx_type___pyx_array;
PyObject *__pyx_type___pyx_memoryview;
PyTypeObject *__pyx_array_type;
PyTypeObject *__pyx_memoryview_type;
PyObject *__pyx_type_5scipy_7spatial_8_ckdtree_coo_entries;
PyObject *__pyx_type_5scipy_7spatial_8_ckdtree_ordered_pairs;
PyObject *__pyx_type_5scipy_7spatial_8_ckdtree_cKDTreeNode;
PyObject *__pyx_type_5scipy_7spatial_8_ckdtree_cKDTree;
PyObject *__pyx_type_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__;
PyObject *__pyx_type_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query;
PyObject *__pyx_type_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point;
PyTypeObject *__pyx_ptype_5scipy_7spatial_8_ckdtree_coo_entries;
PyTypeObject *__pyx_ptype_5scipy_7spatial_8_ckdtree_ordered_pairs;
PyTypeObject *__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTreeNode;
PyTypeObject *__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTree;
PyTypeObject *__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__;
PyTypeObject *__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query;
PyTypeObject *__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point;
__Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
__Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
__pyx_t_5numpy_float64_t __pyx_k__3;
PyObject *__pyx_slice[2];
PyObject *__pyx_tuple[9];
PyObject *__pyx_codeobj_tab[29];
PyObject *__pyx_string_tab[314];
PyObject *__pyx_number_tab[9];
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;
/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif
/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;
#if CYTHON_USE_FREELISTS
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__ *__pyx_freelist_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__[8];
int __pyx_freecount_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__;
#endif
#if CYTHON_USE_FREELISTS
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query *__pyx_freelist_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query[8];
int __pyx_freecount_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query;
#endif
#if CYTHON_USE_FREELISTS
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point *__pyx_freelist_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point[8];
int __pyx_freecount_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;
/* #### Code section: module_state_end ### */
} __pyx_mstatetype;
#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif
#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
{};
#else
{0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_Cannot_determine_the_number_of_c __pyx_string_tab[1]
#define __pyx_kp_u_Invalid_number_of_workers __pyx_string_tab[2]
#define __pyx_kp_u_Invalid_output_type __pyx_string_tab[3]
#define __pyx_kp_u_Negative_input_data_are_outside __pyx_string_tab[4]
#define __pyx_kp_u_None __pyx_string_tab[5]
#define __pyx_kp_u_Number_of_weights_differ_from_th __pyx_string_tab[6]
#define __pyx_kp_u_Only_p_norms_with_1_p_infinity_p __pyx_string_tab[7]
#define __pyx_kp_u_Some_input_data_are_greater_than __pyx_string_tab[8]
#define __pyx_kp_u_Trees_passed_to_count_neighbors __pyx_string_tab[9]
#define __pyx_kp_u_Trees_passed_to_query_ball_tree __pyx_string_tab[10]
#define __pyx_kp_u_Trees_passed_to_sparse_distance __pyx_string_tab[11]
#define __pyx_kp_u_Two_different_trees_are_used_Spe __pyx_string_tab[12]
#define __pyx_kp_u_Unexpected_keyword_argument __pyx_string_tab[13]
#define __pyx_kp_u__2 __pyx_string_tab[14]
#define __pyx_kp_u__4 __pyx_string_tab[15]
#define __pyx_kp_u__5 __pyx_string_tab[16]
#define __pyx_kp_u_cKDTree_count_neighbors_line_123 __pyx_string_tab[17]
#define __pyx_kp_u_cKDTree_query_ball_point_line_87 __pyx_string_tab[18]
#define __pyx_kp_u_cKDTree_query_ball_tree_line_102 __pyx_string_tab[19]
#define __pyx_kp_u_cKDTree_query_line_693 __pyx_string_tab[20]
#define __pyx_kp_u_cKDTree_query_pairs_line_1121 __pyx_string_tab[21]
#define __pyx_kp_u_cKDTree_sparse_distance_matrix_l __pyx_string_tab[22]
#define __pyx_kp_u_count_neighbors_self_other_r_p __pyx_string_tab[23]
#define __pyx_kp_u_data_must_be_finite_check_for_na __pyx_string_tab[24]
#define __pyx_kp_u_data_must_be_of_shape_n_m_where __pyx_string_tab[25]
#define __pyx_kp_u_disable __pyx_string_tab[26]
#define __pyx_kp_u_enable __pyx_string_tab[27]
#define __pyx_kp_u_gc __pyx_string_tab[28]
#define __pyx_kp_u_isenabled __pyx_string_tab[29]
#define __pyx_kp_u_leafsize_must_be_at_least_1 __pyx_string_tab[30]
#define __pyx_kp_u_must_be_1_or_0 __pyx_string_tab[31]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[32]
#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[33]
#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[34]
#define __pyx_kp_u_query_ball_point_self_x_r_p_2_0 __pyx_string_tab[35]
#define __pyx_kp_u_query_ball_tree_self_other_r_p __pyx_string_tab[36]
#define __pyx_kp_u_query_pairs_self_r_p_2_0_eps_0 __pyx_string_tab[37]
#define __pyx_kp_u_query_self_x_k_1_eps_0_0_p_2_0 __pyx_string_tab[38]
#define __pyx_kp_u_r_must_be_either_a_single_value __pyx_string_tab[39]
#define __pyx_kp_u_r_must_be_non_decreasing_for_non __pyx_string_tab[40]
#define __pyx_kp_u_scipy_spatial__ckdtree_pyx __pyx_string_tab[41]
#define __pyx_kp_u_sparse_distance_matrix_other_ma __pyx_string_tab[42]
#define __pyx_kp_u_stringsource __pyx_string_tab[43]
#define __pyx_kp_u_x_must_be_finite_check_for_nan __pyx_string_tab[44]
#define __pyx_kp_u_x_must_consist_of_vectors_of_len __pyx_string_tab[45]
#define __pyx_n_u_C __pyx_string_tab[46]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[47]
#define __pyx_n_u_Thread __pyx_string_tab[48]
#define __pyx_n_u_align __pyx_string_tab[49]
#define __pyx_n_u_all __pyx_string_tab[50]
#define __pyx_n_u_all_2 __pyx_string_tab[51]
#define __pyx_n_u_amax __pyx_string_tab[52]
#define __pyx_n_u_amin __pyx_string_tab[53]
#define __pyx_n_u_any __pyx_string_tab[54]
#define __pyx_n_u_arange __pyx_string_tab[55]
#define __pyx_n_u_args __pyx_string_tab[56]
#define __pyx_n_u_array __pyx_string_tab[57]
#define __pyx_n_u_asarray __pyx_string_tab[58]
#define __pyx_n_u_ascontiguousarray __pyx_string_tab[59]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[60]
#define __pyx_n_u_axis __pyx_string_tab[61]
#define __pyx_n_u_balanced_tree __pyx_string_tab[62]
#define __pyx_n_u_boxsize __pyx_string_tab[63]
#define __pyx_n_u_build_weights __pyx_string_tab[64]
#define __pyx_n_u_cKDTree __pyx_string_tab[65]
#define __pyx_n_u_cKDTreeNode __pyx_string_tab[66]
#define __pyx_n_u_cKDTreeNode___reduce_cython __pyx_string_tab[67]
#define __pyx_n_u_cKDTreeNode___setstate_cython __pyx_string_tab[68]
#define __pyx_n_u_cKDTree___get___locals_closure __pyx_string_tab[69]
#define __pyx_n_u_cKDTree___getstate __pyx_string_tab[70]
#define __pyx_n_u_cKDTree___reduce_cython __pyx_string_tab[71]
#define __pyx_n_u_cKDTree___setstate __pyx_string_tab[72]
#define __pyx_n_u_cKDTree___setstate_cython __pyx_string_tab[73]
#define __pyx_n_u_cKDTree__build_weights __pyx_string_tab[74]
#define __pyx_n_u_cKDTree_count_neighbors __pyx_string_tab[75]
#define __pyx_n_u_cKDTree_query __pyx_string_tab[76]
#define __pyx_n_u_cKDTree_query_ball_point __pyx_string_tab[77]
#define __pyx_n_u_cKDTree_query_ball_tree __pyx_string_tab[78]
#define __pyx_n_u_cKDTree_query_pairs __pyx_string_tab[79]
#define __pyx_n_u_cKDTree_sparse_distance_matrix __pyx_string_tab[80]
#define __pyx_n_u_class_getitem __pyx_string_tab[81]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[82]
#define __pyx_n_u_closure __pyx_string_tab[83]
#define __pyx_n_u_compact_nodes __pyx_string_tab[84]
#define __pyx_n_u_coo_array __pyx_string_tab[85]
#define __pyx_n_u_coo_entries __pyx_string_tab[86]
#define __pyx_n_u_coo_entries___reduce_cython __pyx_string_tab[87]
#define __pyx_n_u_coo_entries___setstate_cython __pyx_string_tab[88]
#define __pyx_n_u_coo_entries_coo_array __pyx_string_tab[89]
#define __pyx_n_u_coo_entries_coo_matrix __pyx_string_tab[90]
#define __pyx_n_u_coo_entries_dict __pyx_string_tab[91]
#define __pyx_n_u_coo_entries_dok_array __pyx_string_tab[92]
#define __pyx_n_u_coo_entries_dok_matrix __pyx_string_tab[93]
#define __pyx_n_u_coo_entries_ndarray __pyx_string_tab[94]
#define __pyx_n_u_coo_matrix __pyx_string_tab[95]
#define __pyx_n_u_copy __pyx_string_tab[96]
#define __pyx_n_u_copy_data __pyx_string_tab[97]
#define __pyx_n_u_copy_if_needed __pyx_string_tab[98]
#define __pyx_n_u_count_neighbors __pyx_string_tab[99]
#define __pyx_n_u_cpu_count __pyx_string_tab[100]
#define __pyx_n_u_cself __pyx_string_tab[101]
#define __pyx_n_u_cum __pyx_string_tab[102]
#define __pyx_n_u_cumulative __pyx_string_tab[103]
#define __pyx_n_u_cur __pyx_string_tab[104]
#define __pyx_n_u_daemon __pyx_string_tab[105]
#define __pyx_n_u_data __pyx_string_tab[106]
#define __pyx_n_u_dd __pyx_string_tab[107]
#define __pyx_n_u_ddret __pyx_string_tab[108]
#define __pyx_n_u_descr __pyx_string_tab[109]
#define __pyx_n_u_dict __pyx_string_tab[110]
#define __pyx_n_u_dict_2 __pyx_string_tab[111]
#define __pyx_n_u_dict_3 __pyx_string_tab[112]
#define __pyx_n_u_distance_upper_bound __pyx_string_tab[113]
#define __pyx_n_u_dok_array __pyx_string_tab[114]
#define __pyx_n_u_dok_matrix __pyx_string_tab[115]
#define __pyx_n_u_dtype __pyx_string_tab[116]
#define __pyx_n_u_dtype_2 __pyx_string_tab[117]
#define __pyx_n_u_empty __pyx_string_tab[118]
#define __pyx_n_u_eps __pyx_string_tab[119]
#define __pyx_n_u_flags __pyx_string_tab[120]
#define __pyx_n_u_float64 __pyx_string_tab[121]
#define __pyx_n_u_format __pyx_string_tab[122]
#define __pyx_n_u_fresults __pyx_string_tab[123]
#define __pyx_n_u_func __pyx_string_tab[124]
#define __pyx_n_u_getstate __pyx_string_tab[125]
#define __pyx_n_u_i __pyx_string_tab[126]
#define __pyx_n_u_ii __pyx_string_tab[127]
#define __pyx_n_u_iiret __pyx_string_tab[128]
#define __pyx_n_u_index __pyx_string_tab[129]
#define __pyx_n_u_indices __pyx_string_tab[130]
#define __pyx_n_u_int_result __pyx_string_tab[131]
#define __pyx_n_u_intp __pyx_string_tab[132]
#define __pyx_n_u_inverse __pyx_string_tab[133]
#define __pyx_n_u_iresults __pyx_string_tab[134]
#define __pyx_n_u_is_coroutine __pyx_string_tab[135]
#define __pyx_n_u_isfinite __pyx_string_tab[136]
#define __pyx_n_u_isscalar __pyx_string_tab[137]
#define __pyx_n_u_items __pyx_string_tab[138]
#define __pyx_n_u_itemsize __pyx_string_tab[139]
#define __pyx_n_u_j __pyx_string_tab[140]
#define __pyx_n_u_join __pyx_string_tab[141]
#define __pyx_n_u_k __pyx_string_tab[142]
#define __pyx_n_u_kk __pyx_string_tab[143]
#define __pyx_n_u_kmax __pyx_string_tab[144]
#define __pyx_n_u_kwargs __pyx_string_tab[145]
#define __pyx_n_u_leafsize __pyx_string_tab[146]
#define __pyx_n_u_m __pyx_string_tab[147]
#define __pyx_n_u_main __pyx_string_tab[148]
#define __pyx_n_u_max __pyx_string_tab[149]
#define __pyx_n_u_max_distance __pyx_string_tab[150]
#define __pyx_n_u_module __pyx_string_tab[151]
#define __pyx_n_u_mytree __pyx_string_tab[152]
#define __pyx_n_u_n __pyx_string_tab[153]
#define __pyx_n_u_n_queries __pyx_string_tab[154]
#define __pyx_n_u_name __pyx_string_tab[155]
#define __pyx_n_u_ndarray __pyx_string_tab[156]
#define __pyx_n_u_ndim __pyx_string_tab[157]
#define __pyx_n_u_ndmin __pyx_string_tab[158]
#define __pyx_n_u_nearest __pyx_string_tab[159]
#define __pyx_n_u_new __pyx_string_tab[160]
#define __pyx_n_u_node_weights __pyx_string_tab[161]
#define __pyx_n_u_np __pyx_string_tab[162]
#define __pyx_n_u_num_of_nodes __pyx_string_tab[163]
#define __pyx_n_u_num_workers __pyx_string_tab[164]
#define __pyx_n_u_numpy __pyx_string_tab[165]
#define __pyx_n_u_object __pyx_string_tab[166]
#define __pyx_n_u_operator __pyx_string_tab[167]
#define __pyx_n_u_order __pyx_string_tab[168]
#define __pyx_n_u_ordered_pairs __pyx_string_tab[169]
#define __pyx_n_u_ordered_pairs___reduce_cython __pyx_string_tab[170]
#define __pyx_n_u_ordered_pairs___setstate_cython __pyx_string_tab[171]
#define __pyx_n_u_ordered_pairs_ndarray __pyx_string_tab[172]
#define __pyx_n_u_ordered_pairs_set __pyx_string_tab[173]
#define __pyx_n_u_os __pyx_string_tab[174]
#define __pyx_n_u_other __pyx_string_tab[175]
#define __pyx_n_u_other_weights __pyx_string_tab[176]
#define __pyx_n_u_output_type __pyx_string_tab[177]
#define __pyx_n_u_p __pyx_string_tab[178]
#define __pyx_n_u_pair __pyx_string_tab[179]
#define __pyx_n_u_pdd __pyx_string_tab[180]
#define __pyx_n_u_pfr __pyx_string_tab[181]
#define __pyx_n_u_pii __pyx_string_tab[182]
#define __pyx_n_u_pir __pyx_string_tab[183]
#define __pyx_n_u_pkk __pyx_string_tab[184]
#define __pyx_n_u_pnw __pyx_string_tab[185]
#define __pyx_n_u_ppw __pyx_string_tab[186]
#define __pyx_n_u_pr __pyx_string_tab[187]
#define __pyx_n_u_proper_weights __pyx_string_tab[188]
#define __pyx_n_u_prr __pyx_string_tab[189]
#define __pyx_n_u_pvrr __pyx_string_tab[190]
#define __pyx_n_u_pvxx __pyx_string_tab[191]
#define __pyx_n_u_pxx __pyx_string_tab[192]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[193]
#define __pyx_n_u_pyx_result __pyx_string_tab[194]
#define __pyx_n_u_pyx_state __pyx_string_tab[195]
#define __pyx_n_u_pyx_type __pyx_string_tab[196]
#define __pyx_n_u_pyx_unpickle_cKDTreeNode __pyx_string_tab[197]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[198]
#define __pyx_n_u_qualname __pyx_string_tab[199]
#define __pyx_n_u_query __pyx_string_tab[200]
#define __pyx_n_u_query_ball_point __pyx_string_tab[201]
#define __pyx_n_u_query_ball_point_locals__thread __pyx_string_tab[202]
#define __pyx_n_u_query_ball_tree __pyx_string_tab[203]
#define __pyx_n_u_query_locals__thread_func __pyx_string_tab[204]
#define __pyx_n_u_query_pairs __pyx_string_tab[205]
#define __pyx_n_u_r __pyx_string_tab[206]
#define __pyx_n_u_r_arr __pyx_string_tab[207]
#define __pyx_n_u_r_ndim __pyx_string_tab[208]
#define __pyx_n_u_real_r __pyx_string_tab[209]
#define __pyx_n_u_reduce __pyx_string_tab[210]
#define __pyx_n_u_reduce_cython __pyx_string_tab[211]
#define __pyx_n_u_reduce_ex __pyx_string_tab[212]
#define __pyx_n_u_res __pyx_string_tab[213]
#define __pyx_n_u_res_arr __pyx_string_tab[214]
#define __pyx_n_u_res_dict __pyx_string_tab[215]
#define __pyx_n_u_res_dtype __pyx_string_tab[216]
#define __pyx_n_u_reshape __pyx_string_tab[217]
#define __pyx_n_u_result __pyx_string_tab[218]
#define __pyx_n_u_results __pyx_string_tab[219]
#define __pyx_n_u_results2 __pyx_string_tab[220]
#define __pyx_n_u_retshape __pyx_string_tab[221]
#define __pyx_n_u_return_index __pyx_string_tab[222]
#define __pyx_n_u_return_inverse __pyx_string_tab[223]
#define __pyx_n_u_return_length __pyx_string_tab[224]
#define __pyx_n_u_return_sorted __pyx_string_tab[225]
#define __pyx_n_u_rlen __pyx_string_tab[226]
#define __pyx_n_u_s __pyx_string_tab[227]
#define __pyx_n_u_scipy __pyx_string_tab[228]
#define __pyx_n_u_scipy__lib__util __pyx_string_tab[229]
#define __pyx_n_u_scipy_sparse __pyx_string_tab[230]
#define __pyx_n_u_scipy_spatial__ckdtree __pyx_string_tab[231]
#define __pyx_n_u_self __pyx_string_tab[232]
#define __pyx_n_u_self_weights __pyx_string_tab[233]
#define __pyx_n_u_set __pyx_string_tab[234]
#define __pyx_n_u_set_name __pyx_string_tab[235]
#define __pyx_n_u_setdefault __pyx_string_tab[236]
#define __pyx_n_u_setstate __pyx_string_tab[237]
#define __pyx_n_u_setstate_cython __pyx_string_tab[238]
#define __pyx_n_u_shape __pyx_string_tab[239]
#define __pyx_n_u_single __pyx_string_tab[240]
#define __pyx_n_u_size __pyx_string_tab[241]
#define __pyx_n_u_sort_output __pyx_string_tab[242]
#define __pyx_n_u_sparse __pyx_string_tab[243]
#define __pyx_n_u_sparse_distance_matrix __pyx_string_tab[244]
#define __pyx_n_u_start __pyx_string_tab[245]
#define __pyx_n_u_state __pyx_string_tab[246]
#define __pyx_n_u_stop __pyx_string_tab[247]
#define __pyx_n_u_str __pyx_string_tab[248]
#define __pyx_n_u_strides __pyx_string_tab[249]
#define __pyx_n_u_target __pyx_string_tab[250]
#define __pyx_n_u_test __pyx_string_tab[251]
#define __pyx_n_u_thread_func __pyx_string_tab[252]
#define __pyx_n_u_threading __pyx_string_tab[253]
#define __pyx_n_u_tmp __pyx_string_tab[254]
#define __pyx_n_u_todok __pyx_string_tab[255]
#define __pyx_n_u_tree __pyx_string_tab[256]
#define __pyx_n_u_typestr __pyx_string_tab[257]
#define __pyx_n_u_uind __pyx_string_tab[258]
#define __pyx_n_u_uint8 __pyx_string_tab[259]
#define __pyx_n_u_uintptr __pyx_string_tab[260]
#define __pyx_n_u_unique __pyx_string_tab[261]
#define __pyx_n_u_update __pyx_string_tab[262]
#define __pyx_n_u_use_setstate __pyx_string_tab[263]
#define __pyx_n_u_v __pyx_string_tab[264]
#define __pyx_n_u_values __pyx_string_tab[265]
#define __pyx_n_u_version __pyx_string_tab[266]
#define __pyx_n_u_view __pyx_string_tab[267]
#define __pyx_n_u_vlen __pyx_string_tab[268]
#define __pyx_n_u_vout __pyx_string_tab[269]
#define __pyx_n_u_vrr __pyx_string_tab[270]
#define __pyx_n_u_vvres __pyx_string_tab[271]
#define __pyx_n_u_vxx __pyx_string_tab[272]
#define __pyx_n_u_w1 __pyx_string_tab[273]
#define __pyx_n_u_w1n __pyx_string_tab[274]
#define __pyx_n_u_w1np __pyx_string_tab[275]
#define __pyx_n_u_w1p __pyx_string_tab[276]
#define __pyx_n_u_w2 __pyx_string_tab[277]
#define __pyx_n_u_w2n __pyx_string_tab[278]
#define __pyx_n_u_w2np __pyx_string_tab[279]
#define __pyx_n_u_w2p __pyx_string_tab[280]
#define __pyx_n_u_weights __pyx_string_tab[281]
#define __pyx_n_u_workers __pyx_string_tab[282]
#define __pyx_n_u_writeable __pyx_string_tab[283]
#define __pyx_n_u_x __pyx_string_tab[284]
#define __pyx_n_u_x_arr __pyx_string_tab[285]
#define __pyx_n_u_xx __pyx_string_tab[286]
#define __pyx_n_u_zeros __pyx_string_tab[287]
#define __pyx_kp_b_PyObject_PyObject_int_int___Pyx __pyx_string_tab[288]
#define __pyx_kp_b_PyObject_PyObject_name_PyObject __pyx_string_tab[289]
#define __pyx_kp_b_iso88591_1_WA_1 __pyx_string_tab[290]
#define __pyx_kp_b_iso88591_A6_t6_U_r_q_fBa_QivRq_3a_s_a_AQ __pyx_string_tab[291]
#define __pyx_kp_b_iso88591_A7MQx_4s_U_AQ_D_WAQ_1D_XS_5_U_Ba __pyx_string_tab[292]
#define __pyx_kp_b_iso88591_ANO_Aj_4s_U_AQ_ARvQa_7_A_AQ_6_V3 __pyx_string_tab[293]
#define __pyx_kp_b_iso88591_ARq_a_AV1_2QfA_AQ_a_QgU_F_4vU_Q __pyx_string_tab[294]
#define __pyx_kp_b_iso88591_A_4r_Rxt2Q_fAXXQ_L_D_Q_Bb_T_a_nH __pyx_string_tab[295]
#define __pyx_kp_b_iso88591_A_6af_q_q_HCs_wa_s_7_a_A_7_AQ __pyx_string_tab[296]
#define __pyx_kp_b_iso88591_A_C1_DA_j_r_31CvRq_T_O1IQ_Jawe1 __pyx_string_tab[297]
#define __pyx_kp_b_iso88591_A_L_D_Q_Bb_T_a_1_U_1_Bar_Bar_Bar __pyx_string_tab[298]
#define __pyx_kp_b_iso88591_A_L_D_Q_Bb_T_a_nHA_fARq_1_Q_1_1A __pyx_string_tab[299]
#define __pyx_kp_b_iso88591_A_Q_t4uA_L_D_Q_E_aq_4r_T_Q_A_q __pyx_string_tab[300]
#define __pyx_kp_b_iso88591_A_X_4s_U_AQ_k_HE_N_Q_s_3e1_A_3ha __pyx_string_tab[301]
#define __pyx_kp_b_iso88591_A_a_b_r_31CvRq_T_Q_c_d_vRq_O1IQ __pyx_string_tab[302]
#define __pyx_kp_b_iso88591_A_ha_uG_Q_q_wavWAQ_c __pyx_string_tab[303]
#define __pyx_kp_b_iso88591_A_ha_uG_a_q_wavWAQ_c __pyx_string_tab[304]
#define __pyx_kp_b_iso88591_A_t1_e_uCr_r_QVVW_U_d_uD_D_D_A_g __pyx_string_tab[305]
#define __pyx_kp_b_iso88591_A_t1_t7_fD_F_d_G4z_ZtCTTU___31_V __pyx_string_tab[306]
#define __pyx_kp_b_iso88591_A_t_Qb __pyx_string_tab[307]
#define __pyx_kp_b_iso88591_A_t_ar_6 __pyx_string_tab[308]
#define __pyx_kp_b_iso88591_Q __pyx_string_tab[309]
#define __pyx_kp_b_iso88591_T_Kt_T_SWW_ddllppxx_I_I_M_M_N_G __pyx_string_tab[310]
#define __pyx_kp_b_iso88591__6 __pyx_string_tab[311]
#define __pyx_kp_b_iso88591_b_4r_r_a_4r_s_uBgU_q_q_U_5_1_r __pyx_string_tab[312]
#define __pyx_kp_b_iso88591_q_0_kQR_haq_7_QnN_1 __pyx_string_tab[313]
#define __pyx_float_0_0 __pyx_number_tab[0]
#define __pyx_float_0_5 __pyx_number_tab[1]
#define __pyx_float_2_0 __pyx_number_tab[2]
#define __pyx_int_0 __pyx_number_tab[3]
#define __pyx_int_neg_1 __pyx_number_tab[4]
#define __pyx_int_1 __pyx_number_tab[5]
#define __pyx_int_2 __pyx_number_tab[6]
#define __pyx_int_3 __pyx_number_tab[7]
#define __pyx_int_158353030 __pyx_number_tab[8]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
__pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
if (!clear_module_state) return 0;
Py_CLEAR(clear_module_state->__pyx_d);
Py_CLEAR(clear_module_state->__pyx_b);
Py_CLEAR(clear_module_state->__pyx_cython_runtime);
Py_CLEAR(clear_module_state->__pyx_empty_tuple);
Py_CLEAR(clear_module_state->__pyx_empty_bytes);
Py_CLEAR(clear_module_state->__pyx_empty_unicode);
#if CYTHON_PEP489_MULTI_PHASE_INIT
__Pyx_State_RemoveModule(NULL);
#endif
Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
Py_CLEAR(clear_module_state->__pyx_array_type);
Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
Py_CLEAR(clear_module_state->__pyx_memoryview_type);
Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
Py_CLEAR(clear_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree_coo_entries);
Py_CLEAR(clear_module_state->__pyx_type_5scipy_7spatial_8_ckdtree_coo_entries);
Py_CLEAR(clear_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree_ordered_pairs);
Py_CLEAR(clear_module_state->__pyx_type_5scipy_7spatial_8_ckdtree_ordered_pairs);
Py_CLEAR(clear_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTreeNode);
Py_CLEAR(clear_module_state->__pyx_type_5scipy_7spatial_8_ckdtree_cKDTreeNode);
Py_CLEAR(clear_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTree);
Py_CLEAR(clear_module_state->__pyx_type_5scipy_7spatial_8_ckdtree_cKDTree);
Py_CLEAR(clear_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__);
Py_CLEAR(clear_module_state->__pyx_type_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__);
Py_CLEAR(clear_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query);
Py_CLEAR(clear_module_state->__pyx_type_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query);
Py_CLEAR(clear_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point);
Py_CLEAR(clear_module_state->__pyx_type_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point);
for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
for (int i=0; i<9; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
for (int i=0; i<29; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
for (int i=0; i<314; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
for (int i=0; i<9; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
/* CythonFunctionShared.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
/* #### Code section: module_state_clear_end ### */
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
__pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
if (!traverse_module_state) return 0;
Py_VISIT(traverse_module_state->__pyx_d);
Py_VISIT(traverse_module_state->__pyx_b);
Py_VISIT(traverse_module_state->__pyx_cython_runtime);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
Py_VISIT(traverse_module_state->__pyx_array_type);
Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
Py_VISIT(traverse_module_state->__pyx_memoryview_type);
Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
Py_VISIT(traverse_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree_coo_entries);
Py_VISIT(traverse_module_state->__pyx_type_5scipy_7spatial_8_ckdtree_coo_entries);
Py_VISIT(traverse_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree_ordered_pairs);
Py_VISIT(traverse_module_state->__pyx_type_5scipy_7spatial_8_ckdtree_ordered_pairs);
Py_VISIT(traverse_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTreeNode);
Py_VISIT(traverse_module_state->__pyx_type_5scipy_7spatial_8_ckdtree_cKDTreeNode);
Py_VISIT(traverse_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTree);
Py_VISIT(traverse_module_state->__pyx_type_5scipy_7spatial_8_ckdtree_cKDTree);
Py_VISIT(traverse_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__);
Py_VISIT(traverse_module_state->__pyx_type_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__);
Py_VISIT(traverse_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query);
Py_VISIT(traverse_module_state->__pyx_type_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query);
Py_VISIT(traverse_module_state->__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point);
Py_VISIT(traverse_module_state->__pyx_type_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point);
for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
for (int i=0; i<9; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
for (int i=0; i<29; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
for (int i=0; i<314; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
for (int i=0; i<9; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
/* CythonFunctionShared.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":243
* cdef int type_num
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp itemsize(self) noexcept nogil:
* return PyDataType_ELSIZE(self)
*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
npy_intp __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":245
* @property
* cdef inline npy_intp itemsize(self) noexcept nogil:
* return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDataType_ELSIZE(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":243
* cdef int type_num
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp itemsize(self) noexcept nogil:
* return PyDataType_ELSIZE(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":247
* return PyDataType_ELSIZE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp alignment(self) noexcept nogil:
* return PyDataType_ALIGNMENT(self)
*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
npy_intp __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":249
* @property
* cdef inline npy_intp alignment(self) noexcept nogil:
* return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
*
* # Use fields/names with care as they may be NULL. You must check
*/
__pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":247
* return PyDataType_ELSIZE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp alignment(self) noexcept nogil:
* return PyDataType_ALIGNMENT(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":253
* # Use fields/names with care as they may be NULL. You must check
* # for this using PyDataType_HASFIELDS.
* @property # <<<<<<<<<<<<<<
* cdef inline object fields(self):
* return <object>PyDataType_FIELDS(self)
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1;
__Pyx_RefNannySetupContext("fields", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":255
* @property
* cdef inline object fields(self):
* return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
__Pyx_INCREF(((PyObject *)__pyx_t_1));
__pyx_r = ((PyObject *)__pyx_t_1);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":253
* # Use fields/names with care as they may be NULL. You must check
* # for this using PyDataType_HASFIELDS.
* @property # <<<<<<<<<<<<<<
* cdef inline object fields(self):
* return <object>PyDataType_FIELDS(self)
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":257
* return <object>PyDataType_FIELDS(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline tuple names(self):
* return <tuple>PyDataType_NAMES(self)
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1;
__Pyx_RefNannySetupContext("names", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":259
* @property
* cdef inline tuple names(self):
* return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
*
* # Use PyDataType_HASSUBARRAY to test whether this field is
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
__Pyx_INCREF(((PyObject*)__pyx_t_1));
__pyx_r = ((PyObject*)__pyx_t_1);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":257
* return <object>PyDataType_FIELDS(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline tuple names(self):
* return <tuple>PyDataType_NAMES(self)
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":264
* # valid (the pointer can be NULL). Most users should access
* # this field via the inline helper method PyDataType_SHAPE.
* @property # <<<<<<<<<<<<<<
* cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
* return PyDataType_SUBARRAY(self)
*/
static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
PyArray_ArrayDescr *__pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":266
* @property
* cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
* return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":264
* # valid (the pointer can be NULL). Most users should access
* # this field via the inline helper method PyDataType_SHAPE.
* @property # <<<<<<<<<<<<<<
* cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
* return PyDataType_SUBARRAY(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":268
* return PyDataType_SUBARRAY(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_uint64 flags(self) noexcept nogil:
* """The data types flags."""
*/
static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
npy_uint64 __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":271
* cdef inline npy_uint64 flags(self) noexcept nogil:
* """The data types flags."""
* return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PyDataType_FLAGS(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":268
* return PyDataType_SUBARRAY(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_uint64 flags(self) noexcept nogil:
* """The data types flags."""
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":280
* ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
*
* @property # <<<<<<<<<<<<<<
* cdef inline int numiter(self) noexcept nogil:
* """The number of arrays that need to be broadcast to the same shape."""
*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
int __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":283
* cdef inline int numiter(self) noexcept nogil:
* """The number of arrays that need to be broadcast to the same shape."""
* return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":280
* ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
*
* @property # <<<<<<<<<<<<<<
* cdef inline int numiter(self) noexcept nogil:
* """The number of arrays that need to be broadcast to the same shape."""
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":285
* return PyArray_MultiIter_NUMITER(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp size(self) noexcept nogil:
* """The total broadcasted size."""
*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
npy_intp __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":288
* cdef inline npy_intp size(self) noexcept nogil:
* """The total broadcasted size."""
* return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":285
* return PyArray_MultiIter_NUMITER(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp size(self) noexcept nogil:
* """The total broadcasted size."""
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":290
* return PyArray_MultiIter_SIZE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp index(self) noexcept nogil:
* """The current (1-d) index into the broadcasted result."""
*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
npy_intp __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":293
* cdef inline npy_intp index(self) noexcept nogil:
* """The current (1-d) index into the broadcasted result."""
* return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":290
* return PyArray_MultiIter_SIZE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp index(self) noexcept nogil:
* """The current (1-d) index into the broadcasted result."""
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":295
* return PyArray_MultiIter_INDEX(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int nd(self) noexcept nogil:
* """The number of dimensions in the broadcasted result."""
*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
int __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":298
* cdef inline int nd(self) noexcept nogil:
* """The number of dimensions in the broadcasted result."""
* return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":295
* return PyArray_MultiIter_INDEX(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int nd(self) noexcept nogil:
* """The number of dimensions in the broadcasted result."""
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":300
* return PyArray_MultiIter_NDIM(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp* dimensions(self) noexcept nogil:
* """The shape of the broadcasted result."""
*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
npy_intp *__pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":303
* cdef inline npy_intp* dimensions(self) noexcept nogil:
* """The shape of the broadcasted result."""
* return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":300
* return PyArray_MultiIter_NDIM(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp* dimensions(self) noexcept nogil:
* """The shape of the broadcasted result."""
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":305
* return PyArray_MultiIter_DIMS(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline void** iters(self) noexcept nogil:
* """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
*/
static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
void **__pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":309
* """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
* On return, the iterators are adjusted for broadcasting."""
* return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":305
* return PyArray_MultiIter_DIMS(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline void** iters(self) noexcept nogil:
* """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":323
* # Instead, we use properties that map to the corresponding C-API functions.
*
* @property # <<<<<<<<<<<<<<
* cdef inline PyObject* base(self) noexcept nogil:
* """Returns a borrowed reference to the object owning the data/memory.
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
PyObject *__pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":327
* """Returns a borrowed reference to the object owning the data/memory.
* """
* return PyArray_BASE(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_BASE(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":323
* # Instead, we use properties that map to the corresponding C-API functions.
*
* @property # <<<<<<<<<<<<<<
* cdef inline PyObject* base(self) noexcept nogil:
* """Returns a borrowed reference to the object owning the data/memory.
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":329
* return PyArray_BASE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline dtype descr(self):
* """Returns an owned reference to the dtype of the array.
*/
static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
PyArray_Descr *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyArray_Descr *__pyx_t_1;
__Pyx_RefNannySetupContext("descr", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":333
* """Returns an owned reference to the dtype of the array.
* """
* return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF((PyObject *)__pyx_r);
__pyx_t_1 = PyArray_DESCR(__pyx_v_self);
__Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
__pyx_r = ((PyArray_Descr *)__pyx_t_1);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":329
* return PyArray_BASE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline dtype descr(self):
* """Returns an owned reference to the dtype of the array.
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":335
* return <dtype>PyArray_DESCR(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int ndim(self) noexcept nogil:
* """Returns the number of dimensions in the array.
*/
static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
int __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":339
* """Returns the number of dimensions in the array.
* """
* return PyArray_NDIM(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_NDIM(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":335
* return <dtype>PyArray_DESCR(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int ndim(self) noexcept nogil:
* """Returns the number of dimensions in the array.
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":341
* return PyArray_NDIM(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp *shape(self) noexcept nogil:
* """Returns a pointer to the dimensions/shape of the array.
*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
npy_intp *__pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":347
* Can return NULL for 0-dimensional arrays.
* """
* return PyArray_DIMS(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_DIMS(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":341
* return PyArray_NDIM(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp *shape(self) noexcept nogil:
* """Returns a pointer to the dimensions/shape of the array.
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":349
* return PyArray_DIMS(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp *strides(self) noexcept nogil:
* """Returns a pointer to the strides of the array.
*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
npy_intp *__pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":354
* The number of elements matches the number of dimensions of the array (ndim).
* """
* return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_STRIDES(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":349
* return PyArray_DIMS(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp *strides(self) noexcept nogil:
* """Returns a pointer to the strides of the array.
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":356
* return PyArray_STRIDES(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp size(self) noexcept nogil:
* """Returns the total size (in number of elements) of the array.
*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
npy_intp __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":360
* """Returns the total size (in number of elements) of the array.
* """
* return PyArray_SIZE(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_SIZE(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":356
* return PyArray_STRIDES(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline npy_intp size(self) noexcept nogil:
* """Returns the total size (in number of elements) of the array.
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":362
* return PyArray_SIZE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline char* data(self) noexcept nogil:
* """The pointer to the data buffer as a char*.
*/
static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
char *__pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":369
* of `PyArray_DATA()` instead, which returns a 'void*'.
* """
* return PyArray_BYTES(self) # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PyArray_BYTES(__pyx_v_self);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":362
* return PyArray_SIZE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline char* data(self) noexcept nogil:
* """The pointer to the data buffer as a char*.
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":777
* ctypedef long double complex clongdouble_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(1, <void*>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", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":778
*
* cdef inline object PyArray_MultiIterNew1(a):
* return PyArray_MultiIterNew(1, <void*>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_ERR(1, 778, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":777
* ctypedef long double complex clongdouble_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(1, <void*>a)
*
*/
/* function exit code */
__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;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":780
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(2, <void*>a, <void*>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", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":781
*
* cdef inline object PyArray_MultiIterNew2(a, b):
* return PyArray_MultiIterNew(2, <void*>a, <void*>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_ERR(1, 781, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":780
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
*/
/* function exit code */
__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;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":783
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> 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", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":784
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> 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_ERR(1, 784, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":783
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
*/
/* function exit code */
__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;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":786
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> 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", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":787
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> 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_ERR(1, 787, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":786
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
*/
/* function exit code */
__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;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":789
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> 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", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":790
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
*
* cdef inline tuple PyDataType_SHAPE(dtype d):
*/
__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_ERR(1, 790, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":789
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
*
*/
/* function exit code */
__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;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":792
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
*
* cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
* if PyDataType_HASSUBARRAY(d):
* return <tuple>d.subarray.shape
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2;
__Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":793
*
* cdef inline tuple PyDataType_SHAPE(dtype d):
* if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
* return <tuple>d.subarray.shape
* else:
*/
__pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
if (__pyx_t_1) {
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":794
* cdef inline tuple PyDataType_SHAPE(dtype d):
* if PyDataType_HASSUBARRAY(d):
* return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
* else:
* return ()
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
__Pyx_INCREF(((PyObject*)__pyx_t_2));
__pyx_r = ((PyObject*)__pyx_t_2);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":793
*
* cdef inline tuple PyDataType_SHAPE(dtype d):
* if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
* return <tuple>d.subarray.shape
* else:
*/
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":796
* return <tuple>d.subarray.shape
* else:
* return () # <<<<<<<<<<<<<<
*
*
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
__pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
goto __pyx_L0;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":792
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
*
* cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
* if PyDataType_HASSUBARRAY(d):
* return <tuple>d.subarray.shape
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":995
* int _import_umath() except -1
*
* cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
* Py_INCREF(base) # important to do this before stealing the reference below!
* PyArray_SetBaseObject(arr, base)
*/
static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
int __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":996
*
* cdef inline void set_array_base(ndarray arr, object base) except *:
* Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
* PyArray_SetBaseObject(arr, base)
*
*/
Py_INCREF(__pyx_v_base);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":997
* cdef inline void set_array_base(ndarray arr, object base) except *:
* Py_INCREF(base) # important to do this before stealing the reference below!
* PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
*
* cdef inline object get_array_base(ndarray arr):
*/
__pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 997, __pyx_L1_error)
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":995
* int _import_umath() except -1
*
* cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
* Py_INCREF(base) # important to do this before stealing the reference below!
* PyArray_SetBaseObject(arr, base)
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":999
* PyArray_SetBaseObject(arr, base)
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
* base = PyArray_BASE(arr)
* if base is NULL:
*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
PyObject *__pyx_v_base;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_array_base", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1000
*
* cdef inline object get_array_base(ndarray arr):
* base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
* if base is NULL:
* return None
*/
__pyx_v_base = PyArray_BASE(__pyx_v_arr);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1001
* cdef inline object get_array_base(ndarray arr):
* base = PyArray_BASE(arr)
* if base is NULL: # <<<<<<<<<<<<<<
* return None
* return <object>base
*/
__pyx_t_1 = (__pyx_v_base == NULL);
if (__pyx_t_1) {
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1002
* base = PyArray_BASE(arr)
* if base is NULL:
* return None # <<<<<<<<<<<<<<
* return <object>base
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1001
* cdef inline object get_array_base(ndarray arr):
* base = PyArray_BASE(arr)
* if base is NULL: # <<<<<<<<<<<<<<
* return None
* return <object>base
*/
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1003
* if base is NULL:
* return None
* return <object>base # <<<<<<<<<<<<<<
*
* # Versions of the import_* functions which are more suitable for
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_base));
__pyx_r = ((PyObject *)__pyx_v_base);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":999
* PyArray_SetBaseObject(arr, base)
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
* base = PyArray_BASE(arr)
* if base is NULL:
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1007
* # Versions of the import_* functions which are more suitable for
* # Cython code.
* cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
* try:
* __pyx_import_array()
*/
static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
size_t __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("import_array", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1008
* # Cython code.
* cdef inline int import_array() except -1:
* try: # <<<<<<<<<<<<<<
* __pyx_import_array()
* except Exception:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1009
* cdef inline int import_array() except -1:
* try:
* __pyx_import_array() # <<<<<<<<<<<<<<
* except Exception:
* raise ImportError("numpy._core.multiarray failed to import")
*/
__pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1009, __pyx_L3_error)
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1008
* # Cython code.
* cdef inline int import_array() except -1:
* try: # <<<<<<<<<<<<<<
* __pyx_import_array()
* except Exception:
*/
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1010
* try:
* __pyx_import_array()
* except Exception: # <<<<<<<<<<<<<<
* raise ImportError("numpy._core.multiarray failed to import")
*
*/
__pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
if (__pyx_t_4) {
__Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1010, __pyx_L5_except_error)
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1011
* __pyx_import_array()
* except Exception:
* raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
*
* cdef inline int import_umath() except -1:
*/
__pyx_t_9 = NULL;
__pyx_t_10 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
__pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1011, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
}
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(1, 1011, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1008
* # Cython code.
* cdef inline int import_array() except -1:
* try: # <<<<<<<<<<<<<<
* __pyx_import_array()
* except Exception:
*/
__pyx_L5_except_error:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1007
* # Versions of the import_* functions which are more suitable for
* # Cython code.
* cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
* try:
* __pyx_import_array()
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1013
* raise ImportError("numpy._core.multiarray failed to import")
*
* cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
* try:
* _import_umath()
*/
static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
size_t __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("import_umath", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1014
*
* cdef inline int import_umath() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1015
* cdef inline int import_umath() except -1:
* try:
* _import_umath() # <<<<<<<<<<<<<<
* except Exception:
* raise ImportError("numpy._core.umath failed to import")
*/
__pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1015, __pyx_L3_error)
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1014
*
* cdef inline int import_umath() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1016
* try:
* _import_umath()
* except Exception: # <<<<<<<<<<<<<<
* raise ImportError("numpy._core.umath failed to import")
*
*/
__pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
if (__pyx_t_4) {
__Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1016, __pyx_L5_except_error)
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1017
* _import_umath()
* except Exception:
* raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
*
* cdef inline int import_ufunc() except -1:
*/
__pyx_t_9 = NULL;
__pyx_t_10 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
__pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1017, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
}
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(1, 1017, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1014
*
* cdef inline int import_umath() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
__pyx_L5_except_error:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1013
* raise ImportError("numpy._core.multiarray failed to import")
*
* cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
* try:
* _import_umath()
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1019
* raise ImportError("numpy._core.umath failed to import")
*
* cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
* try:
* _import_umath()
*/
static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
size_t __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("import_ufunc", 0);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1020
*
* cdef inline int import_ufunc() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1021
* cdef inline int import_ufunc() except -1:
* try:
* _import_umath() # <<<<<<<<<<<<<<
* except Exception:
* raise ImportError("numpy._core.umath failed to import")
*/
__pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1021, __pyx_L3_error)
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1020
*
* cdef inline int import_ufunc() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1022
* try:
* _import_umath()
* except Exception: # <<<<<<<<<<<<<<
* raise ImportError("numpy._core.umath failed to import")
*
*/
__pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
if (__pyx_t_4) {
__Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1022, __pyx_L5_except_error)
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1023
* _import_umath()
* except Exception:
* raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_9 = NULL;
__pyx_t_10 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
__pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1023, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
}
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(1, 1023, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1020
*
* cdef inline int import_ufunc() except -1:
* try: # <<<<<<<<<<<<<<
* _import_umath()
* except Exception:
*/
__pyx_L5_except_error:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1019
* raise ImportError("numpy._core.umath failed to import")
*
* cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
* try:
* _import_umath()
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1026
*
*
* cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
* """
* Cython equivalent of `isinstance(obj, np.timedelta64)`
*/
static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
int __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1038
* bool
* """
* return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1026
*
*
* cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
* """
* Cython equivalent of `isinstance(obj, np.timedelta64)`
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1041
*
*
* cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
* """
* Cython equivalent of `isinstance(obj, np.datetime64)`
*/
static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
int __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1053
* bool
* """
* return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1041
*
*
* cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
* """
* Cython equivalent of `isinstance(obj, np.datetime64)`
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1056
*
*
* cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
* """
* returns the int64 value underlying scalar numpy datetime64 object
*/
static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
npy_datetime __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1063
* also needed. That can be found using `get_datetime64_unit`.
* """
* return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1056
*
*
* cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
* """
* returns the int64 value underlying scalar numpy datetime64 object
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1066
*
*
* cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
* """
* returns the int64 value underlying scalar numpy timedelta64 object
*/
static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
npy_timedelta __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1070
* returns the int64 value underlying scalar numpy timedelta64 object
* """
* return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1066
*
*
* cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
* """
* returns the int64 value underlying scalar numpy timedelta64 object
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1073
*
*
* cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
* """
* returns the unit part of the dtype for a numpy datetime64 object.
*/
static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
NPY_DATETIMEUNIT __pyx_r;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1077
* returns the unit part of the dtype for a numpy datetime64 object.
* """
* return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
goto __pyx_L0;
/* "../../../.pyenv/versions/3.15t-dev-tsan/lib/python3.15t/site-packages/numpy/__init__.cython-30.pxd":1073
*
*
* cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
* """
* returns the unit part of the dtype for a numpy datetime64 object.
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "libcpp/mutex.pxd":142
*
*
* cdef inline void _dummy_force_utility_code_inclusion() nogil: # <<<<<<<<<<<<<<
* with nogil:
* pass
*/
static CYTHON_INLINE void __pyx_f_6libcpp_5mutex__dummy_force_utility_code_inclusion(void) {
/* "libcpp/mutex.pxd":143
*
* cdef inline void _dummy_force_utility_code_inclusion() nogil:
* with nogil: # <<<<<<<<<<<<<<
* pass
*
*/
{
__Pyx_UnknownThreadState _save;
_save = __Pyx_SaveUnknownThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
}
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
__Pyx_RestoreUnknownThread(_save);
goto __pyx_L5;
}
__pyx_L5:;
}
}
/* "libcpp/mutex.pxd":142
*
*
* cdef inline void _dummy_force_utility_code_inclusion() nogil: # <<<<<<<<<<<<<<
* with nogil:
* pass
*/
/* function exit code */
}
/* "scipy/_cyutility.pxd":89
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo)
*
* @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
* cdef inline bint memoryview_check(object o) noexcept:
* return isinstance(o, memoryview)
*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_r;
int __pyx_t_1;
/* "scipy/_cyutility.pxd":91
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o) noexcept:
* return isinstance(o, memoryview) # <<<<<<<<<<<<<<
*
* @cname('__pyx_memview_slice')
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
/* "scipy/_cyutility.pxd":89
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo)
*
* @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
* cdef inline bint memoryview_check(object o) noexcept:
* return isinstance(o, memoryview)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":165
* vector[coo_entry] *buf
*
* def __cinit__(coo_entries self): # <<<<<<<<<<<<<<
* self.buf = NULL
*
*/
/* Python wrapper */
static int __pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
#endif
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return -1;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries___cinit__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries___cinit__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self) {
int __pyx_r;
/* "scipy/spatial/_ckdtree.pyx":166
*
* def __cinit__(coo_entries self):
* self.buf = NULL # <<<<<<<<<<<<<<
*
* def __init__(coo_entries self):
*/
__pyx_v_self->buf = NULL;
/* "scipy/spatial/_ckdtree.pyx":165
* vector[coo_entry] *buf
*
* def __cinit__(coo_entries self): # <<<<<<<<<<<<<<
* self.buf = NULL
*
*/
/* function exit code */
__pyx_r = 0;
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":168
* self.buf = NULL
*
* def __init__(coo_entries self): # <<<<<<<<<<<<<<
* self.buf = new vector[coo_entry]()
*
*/
/* Python wrapper */
static int __pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
#endif
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return -1;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_2__init__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_2__init__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self) {
int __pyx_r;
std::vector<struct coo_entry> *__pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* "scipy/spatial/_ckdtree.pyx":169
*
* def __init__(coo_entries self):
* self.buf = new vector[coo_entry]() # <<<<<<<<<<<<<<
*
* def __dealloc__(coo_entries self):
*/
try {
__pyx_t_1 = new std::vector<struct coo_entry> ();
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(0, 169, __pyx_L1_error)
}
__pyx_v_self->buf = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":168
* self.buf = NULL
*
* def __init__(coo_entries self): # <<<<<<<<<<<<<<
* self.buf = new vector[coo_entry]()
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":171
* self.buf = new vector[coo_entry]()
*
* def __dealloc__(coo_entries self): # <<<<<<<<<<<<<<
* if self.buf != NULL:
* del self.buf
*/
/* Python wrapper */
static void __pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_5__dealloc__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_4__dealloc__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_4__dealloc__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self) {
int __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":172
*
* def __dealloc__(coo_entries self):
* if self.buf != NULL: # <<<<<<<<<<<<<<
* del self.buf
*
*/
__pyx_t_1 = (__pyx_v_self->buf != NULL);
if (__pyx_t_1) {
/* "scipy/spatial/_ckdtree.pyx":173
* def __dealloc__(coo_entries self):
* if self.buf != NULL:
* del self.buf # <<<<<<<<<<<<<<
*
* # The methods ndarray, dict, coo_array, and dok_array must only
*/
delete __pyx_v_self->buf;
/* "scipy/spatial/_ckdtree.pyx":172
*
* def __dealloc__(coo_entries self):
* if self.buf != NULL: # <<<<<<<<<<<<<<
* del self.buf
*
*/
}
/* "scipy/spatial/_ckdtree.pyx":171
* self.buf = new vector[coo_entry]()
*
* def __dealloc__(coo_entries self): # <<<<<<<<<<<<<<
* if self.buf != NULL:
* del self.buf
*/
/* function exit code */
}
/* "scipy/spatial/_ckdtree.pyx":180
* # push_back is called.
*
* def ndarray(coo_entries self): # <<<<<<<<<<<<<<
* cdef:
* coo_entry *pr
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_7ndarray(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11coo_entries_7ndarray = {"ndarray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_7ndarray, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_7ndarray(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("ndarray (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("ndarray", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("ndarray", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_6ndarray(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_6ndarray(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self) {
struct coo_entry *__pyx_v_pr;
__pyx_t_5numpy_uintp_t __pyx_v_uintptr;
__pyx_t_5numpy_intp_t __pyx_v_n;
PyObject *__pyx_v__dtype = NULL;
PyObject *__pyx_v_res_dtype = NULL;
PyObject *__pyx_v_dtype = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
size_t __pyx_t_5;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ndarray", 0);
/* "scipy/spatial/_ckdtree.pyx":185
* np.uintp_t uintptr
* np.intp_t n
* _dtype = [('i',np.intp),('j',np.intp),('v',np.float64)] # <<<<<<<<<<<<<<
* res_dtype = np.dtype(_dtype, align = True)
* n = <np.intp_t> self.buf.size()
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_i);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_i);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_i) != (0)) __PYX_ERR(0, 185, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 185, __pyx_L1_error);
__pyx_t_2 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_j);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_j);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_n_u_j) != (0)) __PYX_ERR(0, 185, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_3);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 185, __pyx_L1_error);
__pyx_t_3 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_v);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_v);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_n_u_v) != (0)) __PYX_ERR(0, 185, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 185, __pyx_L1_error);
__pyx_t_4 = 0;
__pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 185, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 185, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_3);
if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 185, __pyx_L1_error);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_v__dtype = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":186
* np.intp_t n
* _dtype = [('i',np.intp),('j',np.intp),('v',np.float64)]
* res_dtype = np.dtype(_dtype, align = True) # <<<<<<<<<<<<<<
* n = <np.intp_t> self.buf.size()
* if (n > 0):
*/
__pyx_t_3 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_v__dtype};
__pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_align, Py_True, __pyx_t_2, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 186, __pyx_L1_error)
__pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_5numpy_dtype, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_4);
}
__pyx_v_res_dtype = ((PyObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":187
* _dtype = [('i',np.intp),('j',np.intp),('v',np.float64)]
* res_dtype = np.dtype(_dtype, align = True)
* n = <np.intp_t> self.buf.size() # <<<<<<<<<<<<<<
* if (n > 0):
* pr = self.buf.data()
*/
__pyx_v_n = ((__pyx_t_5numpy_intp_t)__pyx_v_self->buf->size());
/* "scipy/spatial/_ckdtree.pyx":188
* res_dtype = np.dtype(_dtype, align = True)
* n = <np.intp_t> self.buf.size()
* if (n > 0): # <<<<<<<<<<<<<<
* pr = self.buf.data()
* uintptr = <np.uintp_t> (<void*> pr)
*/
__pyx_t_6 = (__pyx_v_n > 0);
if (__pyx_t_6) {
/* "scipy/spatial/_ckdtree.pyx":189
* n = <np.intp_t> self.buf.size()
* if (n > 0):
* pr = self.buf.data() # <<<<<<<<<<<<<<
* uintptr = <np.uintp_t> (<void*> pr)
* dtype = np.dtype(np.uint8)
*/
__pyx_v_pr = __pyx_v_self->buf->data();
/* "scipy/spatial/_ckdtree.pyx":190
* if (n > 0):
* pr = self.buf.data()
* uintptr = <np.uintp_t> (<void*> pr) # <<<<<<<<<<<<<<
* dtype = np.dtype(np.uint8)
* self.__array_interface__ = dict(
*/
__pyx_v_uintptr = ((__pyx_t_5numpy_uintp_t)((void *)__pyx_v_pr));
/* "scipy/spatial/_ckdtree.pyx":191
* pr = self.buf.data()
* uintptr = <np.uintp_t> (<void*> pr)
* dtype = np.dtype(np.uint8) # <<<<<<<<<<<<<<
* self.__array_interface__ = dict(
* data = (uintptr, False),
*/
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_uint8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5numpy_dtype, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_4);
}
__pyx_v_dtype = ((PyObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":193
* dtype = np.dtype(np.uint8)
* self.__array_interface__ = dict(
* data = (uintptr, False), # <<<<<<<<<<<<<<
* descr = dtype.descr,
* shape = (n*sizeof(coo_entry),),
*/
__pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = __Pyx_PyLong_From_npy_uintp(__pyx_v_uintptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 193, __pyx_L1_error);
__Pyx_INCREF(Py_False);
__Pyx_GIVEREF(Py_False);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_False) != (0)) __PYX_ERR(0, 193, __pyx_L1_error);
__pyx_t_1 = 0;
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_data, __pyx_t_2) < (0)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":194
* self.__array_interface__ = dict(
* data = (uintptr, False),
* descr = dtype.descr, # <<<<<<<<<<<<<<
* shape = (n*sizeof(coo_entry),),
* strides = (dtype.itemsize,),
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_descr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_descr, __pyx_t_2) < (0)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":195
* data = (uintptr, False),
* descr = dtype.descr,
* shape = (n*sizeof(coo_entry),), # <<<<<<<<<<<<<<
* strides = (dtype.itemsize,),
* typestr = dtype.str,
*/
__pyx_t_2 = __Pyx_PyLong_FromSize_t((__pyx_v_n * (sizeof(struct coo_entry)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 195, __pyx_L1_error);
__pyx_t_2 = 0;
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_1) < (0)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":196
* descr = dtype.descr,
* shape = (n*sizeof(coo_entry),),
* strides = (dtype.itemsize,), # <<<<<<<<<<<<<<
* typestr = dtype.str,
* version = 3,
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 196, __pyx_L1_error);
__pyx_t_1 = 0;
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_strides, __pyx_t_2) < (0)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":197
* shape = (n*sizeof(coo_entry),),
* strides = (dtype.itemsize,),
* typestr = dtype.str, # <<<<<<<<<<<<<<
* version = 3,
* )
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_typestr, __pyx_t_2) < (0)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_version, __pyx_mstate_global->__pyx_int_3) < (0)) __PYX_ERR(0, 193, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":192
* uintptr = <np.uintp_t> (<void*> pr)
* dtype = np.dtype(np.uint8)
* self.__array_interface__ = dict( # <<<<<<<<<<<<<<
* data = (uintptr, False),
* descr = dtype.descr,
*/
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_v_self->__pyx___array_interface__);
__Pyx_DECREF(__pyx_v_self->__pyx___array_interface__);
__pyx_v_self->__pyx___array_interface__ = __pyx_t_4;
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":200
* version = 3,
* )
* return np.asarray(self).view(dtype=res_dtype) # <<<<<<<<<<<<<<
* else:
* return np.empty(shape=(0,), dtype=res_dtype)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
__pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_res_dtype, __pyx_t_8, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 200, __pyx_L1_error)
__pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_view, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":188
* res_dtype = np.dtype(_dtype, align = True)
* n = <np.intp_t> self.buf.size()
* if (n > 0): # <<<<<<<<<<<<<<
* pr = self.buf.data()
* uintptr = <np.uintp_t> (<void*> pr)
*/
}
/* "scipy/spatial/_ckdtree.pyx":202
* return np.asarray(self).view(dtype=res_dtype)
* else:
* return np.empty(shape=(0,), dtype=res_dtype) # <<<<<<<<<<<<<<
*
* def dict(coo_entries self):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
assert(__pyx_t_1);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_1, NULL};
__pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_mstate_global->__pyx_tuple[0], __pyx_t_8, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 202, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_res_dtype, __pyx_t_8, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 202, __pyx_L1_error)
__pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "scipy/spatial/_ckdtree.pyx":180
* # push_back is called.
*
* def ndarray(coo_entries self): # <<<<<<<<<<<<<<
* cdef:
* coo_entry *pr
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.ndarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v__dtype);
__Pyx_XDECREF(__pyx_v_res_dtype);
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":204
* return np.empty(shape=(0,), dtype=res_dtype)
*
* def dict(coo_entries self): # <<<<<<<<<<<<<<
* cdef:
* np.intp_t i, j, k, n
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_9dict(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11coo_entries_9dict = {"dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_9dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_9dict(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("dict (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("dict", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("dict", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_8dict(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_8dict(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self) {
__pyx_t_5numpy_intp_t __pyx_v_i;
__pyx_t_5numpy_intp_t __pyx_v_j;
__pyx_t_5numpy_intp_t __pyx_v_k;
__pyx_t_5numpy_intp_t __pyx_v_n;
__pyx_t_5numpy_float64_t __pyx_v_v;
struct coo_entry *__pyx_v_pr;
PyObject *__pyx_v_res_dict = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
__pyx_t_5numpy_intp_t __pyx_t_3;
__pyx_t_5numpy_intp_t __pyx_t_4;
__pyx_t_5numpy_intp_t __pyx_t_5;
__pyx_t_5numpy_intp_t __pyx_t_6;
__pyx_t_5numpy_float64_t __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dict", 0);
/* "scipy/spatial/_ckdtree.pyx":210
* coo_entry *pr
* dict res_dict
* n = <np.intp_t> self.buf.size() # <<<<<<<<<<<<<<
* if (n > 0):
* pr = self.buf.data()
*/
__pyx_v_n = ((__pyx_t_5numpy_intp_t)__pyx_v_self->buf->size());
/* "scipy/spatial/_ckdtree.pyx":211
* dict res_dict
* n = <np.intp_t> self.buf.size()
* if (n > 0): # <<<<<<<<<<<<<<
* pr = self.buf.data()
* res_dict = dict()
*/
__pyx_t_1 = (__pyx_v_n > 0);
if (__pyx_t_1) {
/* "scipy/spatial/_ckdtree.pyx":212
* n = <np.intp_t> self.buf.size()
* if (n > 0):
* pr = self.buf.data() # <<<<<<<<<<<<<<
* res_dict = dict()
* for k in range(n):
*/
__pyx_v_pr = __pyx_v_self->buf->data();
/* "scipy/spatial/_ckdtree.pyx":213
* if (n > 0):
* pr = self.buf.data()
* res_dict = dict() # <<<<<<<<<<<<<<
* for k in range(n):
* i = pr[k].i
*/
__pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_res_dict = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":214
* pr = self.buf.data()
* res_dict = dict()
* for k in range(n): # <<<<<<<<<<<<<<
* i = pr[k].i
* j = pr[k].j
*/
__pyx_t_3 = __pyx_v_n;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_k = __pyx_t_5;
/* "scipy/spatial/_ckdtree.pyx":215
* res_dict = dict()
* for k in range(n):
* i = pr[k].i # <<<<<<<<<<<<<<
* j = pr[k].j
* v = pr[k].v
*/
__pyx_t_6 = (__pyx_v_pr[__pyx_v_k]).i;
__pyx_v_i = __pyx_t_6;
/* "scipy/spatial/_ckdtree.pyx":216
* for k in range(n):
* i = pr[k].i
* j = pr[k].j # <<<<<<<<<<<<<<
* v = pr[k].v
* res_dict[(i,j)] = v
*/
__pyx_t_6 = (__pyx_v_pr[__pyx_v_k]).j;
__pyx_v_j = __pyx_t_6;
/* "scipy/spatial/_ckdtree.pyx":217
* i = pr[k].i
* j = pr[k].j
* v = pr[k].v # <<<<<<<<<<<<<<
* res_dict[(i,j)] = v
* return res_dict
*/
__pyx_t_7 = (__pyx_v_pr[__pyx_v_k]).v;
__pyx_v_v = __pyx_t_7;
/* "scipy/spatial/_ckdtree.pyx":218
* j = pr[k].j
* v = pr[k].v
* res_dict[(i,j)] = v # <<<<<<<<<<<<<<
* return res_dict
* else:
*/
__pyx_t_2 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = __Pyx_PyLong_From_npy_intp(__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = __Pyx_PyLong_From_npy_intp(__pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_8);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 218, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_9);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 218, __pyx_L1_error);
__pyx_t_8 = 0;
__pyx_t_9 = 0;
if (unlikely((PyDict_SetItem(__pyx_v_res_dict, __pyx_t_10, __pyx_t_2) < 0))) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
/* "scipy/spatial/_ckdtree.pyx":219
* v = pr[k].v
* res_dict[(i,j)] = v
* return res_dict # <<<<<<<<<<<<<<
* else:
* return {}
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_res_dict);
__pyx_r = __pyx_v_res_dict;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":211
* dict res_dict
* n = <np.intp_t> self.buf.size()
* if (n > 0): # <<<<<<<<<<<<<<
* pr = self.buf.data()
* res_dict = dict()
*/
}
/* "scipy/spatial/_ckdtree.pyx":221
* return res_dict
* else:
* return {} # <<<<<<<<<<<<<<
*
* def coo_array(coo_entries self, m, n):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "scipy/spatial/_ckdtree.pyx":204
* return np.empty(shape=(0,), dtype=res_dtype)
*
* def dict(coo_entries self): # <<<<<<<<<<<<<<
* cdef:
* np.intp_t i, j, k, n
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_res_dict);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":223
* return {}
*
* def coo_array(coo_entries self, m, n): # <<<<<<<<<<<<<<
* res_arr = self.ndarray()
* return scipy.sparse.coo_array(
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_11coo_array(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11coo_entries_11coo_array = {"coo_array", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_11coo_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_11coo_array(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_m = 0;
PyObject *__pyx_v_n = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[2] = {0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("coo_array (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 223, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 223, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 223, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "coo_array", 0) < (0)) __PYX_ERR(0, 223, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("coo_array", 1, 2, 2, i); __PYX_ERR(0, 223, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 2)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 223, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 223, __pyx_L3_error)
}
__pyx_v_m = values[0];
__pyx_v_n = values[1];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("coo_array", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 223, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.coo_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_10coo_array(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self), __pyx_v_m, __pyx_v_n);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_10coo_array(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_n) {
PyObject *__pyx_v_res_arr = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
size_t __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("coo_array", 0);
/* "scipy/spatial/_ckdtree.pyx":224
*
* def coo_array(coo_entries self, m, n):
* res_arr = self.ndarray() # <<<<<<<<<<<<<<
* return scipy.sparse.coo_array(
* (res_arr['v'], (res_arr['i'], res_arr['j'])),
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_ndarray, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_v_res_arr = __pyx_t_1;
__pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":225
* def coo_array(coo_entries self, m, n):
* res_arr = self.ndarray()
* return scipy.sparse.coo_array( # <<<<<<<<<<<<<<
* (res_arr['v'], (res_arr['i'], res_arr['j'])),
* shape=(m, n))
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sparse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __pyx_t_5;
__Pyx_INCREF(__pyx_t_2);
/* "scipy/spatial/_ckdtree.pyx":226
* res_arr = self.ndarray()
* return scipy.sparse.coo_array(
* (res_arr['v'], (res_arr['i'], res_arr['j'])), # <<<<<<<<<<<<<<
* shape=(m, n))
*
*/
__pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_res_arr, __pyx_mstate_global->__pyx_n_u_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_res_arr, __pyx_mstate_global->__pyx_n_u_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_res_arr, __pyx_mstate_global->__pyx_n_u_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 226, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_7);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 226, __pyx_L1_error);
__pyx_t_6 = 0;
__pyx_t_7 = 0;
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 226, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_8);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 226, __pyx_L1_error);
__pyx_t_4 = 0;
__pyx_t_8 = 0;
/* "scipy/spatial/_ckdtree.pyx":227
* return scipy.sparse.coo_array(
* (res_arr['v'], (res_arr['i'], res_arr['j'])),
* shape=(m, n)) # <<<<<<<<<<<<<<
*
* def dok_array(coo_entries self, m, n):
*/
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_m);
__Pyx_GIVEREF(__pyx_v_m);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_m) != (0)) __PYX_ERR(0, 227, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_n);
__Pyx_GIVEREF(__pyx_v_n);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_n) != (0)) __PYX_ERR(0, 227, __pyx_L1_error);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_7};
__pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_t_8, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
__pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_coo_array, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":223
* return {}
*
* def coo_array(coo_entries self, m, n): # <<<<<<<<<<<<<<
* res_arr = self.ndarray()
* return scipy.sparse.coo_array(
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.coo_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_res_arr);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":229
* shape=(m, n))
*
* def dok_array(coo_entries self, m, n): # <<<<<<<<<<<<<<
* return self.coo_array(m,n).todok()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_13dok_array(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11coo_entries_13dok_array = {"dok_array", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_13dok_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_13dok_array(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_m = 0;
PyObject *__pyx_v_n = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[2] = {0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("dok_array (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 229, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 229, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 229, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dok_array", 0) < (0)) __PYX_ERR(0, 229, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dok_array", 1, 2, 2, i); __PYX_ERR(0, 229, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 2)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 229, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 229, __pyx_L3_error)
}
__pyx_v_m = values[0];
__pyx_v_n = values[1];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("dok_array", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 229, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.dok_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_12dok_array(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self), __pyx_v_m, __pyx_v_n);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_12dok_array(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_n) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
size_t __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dok_array", 0);
/* "scipy/spatial/_ckdtree.pyx":230
*
* def dok_array(coo_entries self, m, n):
* return self.coo_array(m,n).todok() # <<<<<<<<<<<<<<
*
* def coo_matrix(coo_entries self, m, n):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_4);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_m, __pyx_v_n};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_coo_array, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_t_2 = __pyx_t_3;
__Pyx_INCREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_todok, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":229
* shape=(m, n))
*
* def dok_array(coo_entries self, m, n): # <<<<<<<<<<<<<<
* return self.coo_array(m,n).todok()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.dok_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":232
* return self.coo_array(m,n).todok()
*
* def coo_matrix(coo_entries self, m, n): # <<<<<<<<<<<<<<
* res_arr = self.ndarray()
* return scipy.sparse.coo_matrix(
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_15coo_matrix(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11coo_entries_15coo_matrix = {"coo_matrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_15coo_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_15coo_matrix(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_m = 0;
PyObject *__pyx_v_n = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[2] = {0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("coo_matrix (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 232, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 232, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 232, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "coo_matrix", 0) < (0)) __PYX_ERR(0, 232, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("coo_matrix", 1, 2, 2, i); __PYX_ERR(0, 232, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 2)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 232, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 232, __pyx_L3_error)
}
__pyx_v_m = values[0];
__pyx_v_n = values[1];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("coo_matrix", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 232, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.coo_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_14coo_matrix(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self), __pyx_v_m, __pyx_v_n);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_14coo_matrix(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_n) {
PyObject *__pyx_v_res_arr = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
size_t __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("coo_matrix", 0);
/* "scipy/spatial/_ckdtree.pyx":233
*
* def coo_matrix(coo_entries self, m, n):
* res_arr = self.ndarray() # <<<<<<<<<<<<<<
* return scipy.sparse.coo_matrix(
* (res_arr['v'], (res_arr['i'], res_arr['j'])),
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_ndarray, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_v_res_arr = __pyx_t_1;
__pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":234
* def coo_matrix(coo_entries self, m, n):
* res_arr = self.ndarray()
* return scipy.sparse.coo_matrix( # <<<<<<<<<<<<<<
* (res_arr['v'], (res_arr['i'], res_arr['j'])),
* shape=(m, n))
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_scipy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sparse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __pyx_t_5;
__Pyx_INCREF(__pyx_t_2);
/* "scipy/spatial/_ckdtree.pyx":235
* res_arr = self.ndarray()
* return scipy.sparse.coo_matrix(
* (res_arr['v'], (res_arr['i'], res_arr['j'])), # <<<<<<<<<<<<<<
* shape=(m, n))
*
*/
__pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_res_arr, __pyx_mstate_global->__pyx_n_u_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_res_arr, __pyx_mstate_global->__pyx_n_u_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_res_arr, __pyx_mstate_global->__pyx_n_u_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 235, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_7);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 235, __pyx_L1_error);
__pyx_t_6 = 0;
__pyx_t_7 = 0;
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 235, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_8);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 235, __pyx_L1_error);
__pyx_t_4 = 0;
__pyx_t_8 = 0;
/* "scipy/spatial/_ckdtree.pyx":236
* return scipy.sparse.coo_matrix(
* (res_arr['v'], (res_arr['i'], res_arr['j'])),
* shape=(m, n)) # <<<<<<<<<<<<<<
*
* def dok_matrix(coo_entries self, m, n):
*/
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_m);
__Pyx_GIVEREF(__pyx_v_m);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_m) != (0)) __PYX_ERR(0, 236, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_n);
__Pyx_GIVEREF(__pyx_v_n);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_n) != (0)) __PYX_ERR(0, 236, __pyx_L1_error);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_7};
__pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_t_8, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 234, __pyx_L1_error)
__pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_coo_matrix, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":232
* return self.coo_array(m,n).todok()
*
* def coo_matrix(coo_entries self, m, n): # <<<<<<<<<<<<<<
* res_arr = self.ndarray()
* return scipy.sparse.coo_matrix(
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.coo_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_res_arr);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":238
* shape=(m, n))
*
* def dok_matrix(coo_entries self, m, n): # <<<<<<<<<<<<<<
* return self.coo_matrix(m,n).todok()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_17dok_matrix(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11coo_entries_17dok_matrix = {"dok_matrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_17dok_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_17dok_matrix(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_m = 0;
PyObject *__pyx_v_n = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[2] = {0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("dok_matrix (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_n,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 238, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 238, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 238, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dok_matrix", 0) < (0)) __PYX_ERR(0, 238, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dok_matrix", 1, 2, 2, i); __PYX_ERR(0, 238, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 2)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 238, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 238, __pyx_L3_error)
}
__pyx_v_m = values[0];
__pyx_v_n = values[1];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("dok_matrix", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 238, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.dok_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_16dok_matrix(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self), __pyx_v_m, __pyx_v_n);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_16dok_matrix(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, PyObject *__pyx_v_m, PyObject *__pyx_v_n) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
size_t __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dok_matrix", 0);
/* "scipy/spatial/_ckdtree.pyx":239
*
* def dok_matrix(coo_entries self, m, n):
* return self.coo_matrix(m,n).todok() # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_4);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_m, __pyx_v_n};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_coo_matrix, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_t_2 = __pyx_t_3;
__Pyx_INCREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_todok, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":238
* shape=(m, n))
*
* def dok_matrix(coo_entries self, m, n): # <<<<<<<<<<<<<<
* return self.coo_matrix(m,n).todok()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.dok_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":162
*
* cdef:
* readonly object __array_interface__ # <<<<<<<<<<<<<<
* vector[coo_entry] *buf
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_19__array_interface___1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_19__array_interface_____get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_19__array_interface_____get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___array_interface__);
__pyx_r = __pyx_v_self->__pyx___array_interface__;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_19__reduce_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11coo_entries_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_19__reduce_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_18__reduce_cython__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
/* "(tree fragment)":2
* def __reduce_cython__(self):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
__Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(2, 2, __pyx_L1_error)
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":3
* def __reduce_cython__(self):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_21__setstate_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11coo_entries_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11coo_entries_21__setstate_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[1] = {0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 3, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 3, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 3, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 3, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 3, __pyx_L3_error)
}
__pyx_v___pyx_state = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_20__setstate_cython__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_v_self), __pyx_v___pyx_state);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11coo_entries_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
/* "(tree fragment)":4
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
*/
__Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(2, 4, __pyx_L1_error)
/* "(tree fragment)":3
* def __reduce_cython__(self):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.spatial._ckdtree.coo_entries.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":251
* vector[ordered_pair] *buf
*
* def __cinit__(ordered_pairs self): # <<<<<<<<<<<<<<
* self.buf = NULL
*
*/
/* Python wrapper */
static int __pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
#endif
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return -1;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs___cinit__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs___cinit__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self) {
int __pyx_r;
/* "scipy/spatial/_ckdtree.pyx":252
*
* def __cinit__(ordered_pairs self):
* self.buf = NULL # <<<<<<<<<<<<<<
*
* def __init__(ordered_pairs self):
*/
__pyx_v_self->buf = NULL;
/* "scipy/spatial/_ckdtree.pyx":251
* vector[ordered_pair] *buf
*
* def __cinit__(ordered_pairs self): # <<<<<<<<<<<<<<
* self.buf = NULL
*
*/
/* function exit code */
__pyx_r = 0;
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":254
* self.buf = NULL
*
* def __init__(ordered_pairs self): # <<<<<<<<<<<<<<
* self.buf = new vector[ordered_pair]()
*
*/
/* Python wrapper */
static int __pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
#endif
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return -1;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_2__init__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_2__init__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self) {
int __pyx_r;
std::vector<struct ordered_pair> *__pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* "scipy/spatial/_ckdtree.pyx":255
*
* def __init__(ordered_pairs self):
* self.buf = new vector[ordered_pair]() # <<<<<<<<<<<<<<
*
* def __dealloc__(ordered_pairs self):
*/
try {
__pyx_t_1 = new std::vector<struct ordered_pair> ();
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(0, 255, __pyx_L1_error)
}
__pyx_v_self->buf = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":254
* self.buf = NULL
*
* def __init__(ordered_pairs self): # <<<<<<<<<<<<<<
* self.buf = new vector[ordered_pair]()
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.spatial._ckdtree.ordered_pairs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":257
* self.buf = new vector[ordered_pair]()
*
* def __dealloc__(ordered_pairs self): # <<<<<<<<<<<<<<
* if self.buf != NULL:
* del self.buf
*/
/* Python wrapper */
static void __pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_5__dealloc__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_4__dealloc__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_4__dealloc__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self) {
int __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":258
*
* def __dealloc__(ordered_pairs self):
* if self.buf != NULL: # <<<<<<<<<<<<<<
* del self.buf
*
*/
__pyx_t_1 = (__pyx_v_self->buf != NULL);
if (__pyx_t_1) {
/* "scipy/spatial/_ckdtree.pyx":259
* def __dealloc__(ordered_pairs self):
* if self.buf != NULL:
* del self.buf # <<<<<<<<<<<<<<
*
* # The methods ndarray and set must only be called after the buffer
*/
delete __pyx_v_self->buf;
/* "scipy/spatial/_ckdtree.pyx":258
*
* def __dealloc__(ordered_pairs self):
* if self.buf != NULL: # <<<<<<<<<<<<<<
* del self.buf
*
*/
}
/* "scipy/spatial/_ckdtree.pyx":257
* self.buf = new vector[ordered_pair]()
*
* def __dealloc__(ordered_pairs self): # <<<<<<<<<<<<<<
* if self.buf != NULL:
* del self.buf
*/
/* function exit code */
}
/* "scipy/spatial/_ckdtree.pyx":264
* # is filled with ordered_pair data.
*
* def ndarray(ordered_pairs self): # <<<<<<<<<<<<<<
* cdef:
* ordered_pair *pr
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_7ndarray(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_13ordered_pairs_7ndarray = {"ndarray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_7ndarray, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_7ndarray(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("ndarray (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("ndarray", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("ndarray", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_6ndarray(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_6ndarray(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self) {
struct ordered_pair *__pyx_v_pr;
__pyx_t_5numpy_uintp_t __pyx_v_uintptr;
__pyx_t_5numpy_intp_t __pyx_v_n;
PyObject *__pyx_v_dtype = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
size_t __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ndarray", 0);
/* "scipy/spatial/_ckdtree.pyx":269
* np.uintp_t uintptr
* np.intp_t n
* n = <np.intp_t> self.buf.size() # <<<<<<<<<<<<<<
* if (n > 0):
* pr = self.buf.data()
*/
__pyx_v_n = ((__pyx_t_5numpy_intp_t)__pyx_v_self->buf->size());
/* "scipy/spatial/_ckdtree.pyx":270
* np.intp_t n
* n = <np.intp_t> self.buf.size()
* if (n > 0): # <<<<<<<<<<<<<<
* pr = self.buf.data()
* uintptr = <np.uintp_t> (<void*> pr)
*/
__pyx_t_1 = (__pyx_v_n > 0);
if (__pyx_t_1) {
/* "scipy/spatial/_ckdtree.pyx":271
* n = <np.intp_t> self.buf.size()
* if (n > 0):
* pr = self.buf.data() # <<<<<<<<<<<<<<
* uintptr = <np.uintp_t> (<void*> pr)
* dtype = np.dtype(np.intp)
*/
__pyx_v_pr = __pyx_v_self->buf->data();
/* "scipy/spatial/_ckdtree.pyx":272
* if (n > 0):
* pr = self.buf.data()
* uintptr = <np.uintp_t> (<void*> pr) # <<<<<<<<<<<<<<
* dtype = np.dtype(np.intp)
* self.__array_interface__ = dict(
*/
__pyx_v_uintptr = ((__pyx_t_5numpy_uintp_t)((void *)__pyx_v_pr));
/* "scipy/spatial/_ckdtree.pyx":273
* pr = self.buf.data()
* uintptr = <np.uintp_t> (<void*> pr)
* dtype = np.dtype(np.intp) # <<<<<<<<<<<<<<
* self.__array_interface__ = dict(
* data = (uintptr, False),
*/
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5numpy_dtype, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_2);
}
__pyx_v_dtype = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":275
* dtype = np.dtype(np.intp)
* self.__array_interface__ = dict(
* data = (uintptr, False), # <<<<<<<<<<<<<<
* descr = dtype.descr,
* shape = (n,2),
*/
__pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __Pyx_PyLong_From_npy_uintp(__pyx_v_uintptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 275, __pyx_L1_error);
__Pyx_INCREF(Py_False);
__Pyx_GIVEREF(Py_False);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, Py_False) != (0)) __PYX_ERR(0, 275, __pyx_L1_error);
__pyx_t_5 = 0;
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_data, __pyx_t_3) < (0)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":276
* self.__array_interface__ = dict(
* data = (uintptr, False),
* descr = dtype.descr, # <<<<<<<<<<<<<<
* shape = (n,2),
* strides = (2*dtype.itemsize,dtype.itemsize),
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_descr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_descr, __pyx_t_3) < (0)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":277
* data = (uintptr, False),
* descr = dtype.descr,
* shape = (n,2), # <<<<<<<<<<<<<<
* strides = (2*dtype.itemsize,dtype.itemsize),
* typestr = dtype.str,
*/
__pyx_t_3 = __Pyx_PyLong_From_npy_intp(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 277, __pyx_L1_error);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_2);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_int_2) != (0)) __PYX_ERR(0, 277, __pyx_L1_error);
__pyx_t_3 = 0;
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_5) < (0)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":278
* descr = dtype.descr,
* shape = (n,2),
* strides = (2*dtype.itemsize,dtype.itemsize), # <<<<<<<<<<<<<<
* typestr = dtype.str,
* version = 3,
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_t_5, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 278, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_5);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 278, __pyx_L1_error);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_strides, __pyx_t_4) < (0)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":279
* shape = (n,2),
* strides = (2*dtype.itemsize,dtype.itemsize),
* typestr = dtype.str, # <<<<<<<<<<<<<<
* version = 3,
* )
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_typestr, __pyx_t_4) < (0)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_version, __pyx_mstate_global->__pyx_int_3) < (0)) __PYX_ERR(0, 275, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":274
* uintptr = <np.uintp_t> (<void*> pr)
* dtype = np.dtype(np.intp)
* self.__array_interface__ = dict( # <<<<<<<<<<<<<<
* data = (uintptr, False),
* descr = dtype.descr,
*/
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___array_interface__);
__Pyx_DECREF(__pyx_v_self->__pyx___array_interface__);
__pyx_v_self->__pyx___array_interface__ = __pyx_t_2;
__pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":282
* version = 3,
* )
* return np.asarray(self) # <<<<<<<<<<<<<<
* else:
* return np.empty(shape=(0,2), dtype=np.intp)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
assert(__pyx_t_4);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":270
* np.intp_t n
* n = <np.intp_t> self.buf.size()
* if (n > 0): # <<<<<<<<<<<<<<
* pr = self.buf.data()
* uintptr = <np.uintp_t> (<void*> pr)
*/
}
/* "scipy/spatial/_ckdtree.pyx":284
* return np.asarray(self)
* else:
* return np.empty(shape=(0,2), dtype=np.intp) # <<<<<<<<<<<<<<
*
* def set(ordered_pairs self):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_3, NULL};
__pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_mstate_global->__pyx_tuple[1], __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 284, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_7, __pyx_t_4, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 284, __pyx_L1_error)
__pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "scipy/spatial/_ckdtree.pyx":264
* # is filled with ordered_pair data.
*
* def ndarray(ordered_pairs self): # <<<<<<<<<<<<<<
* cdef:
* ordered_pair *pr
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("scipy.spatial._ckdtree.ordered_pairs.ndarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":286
* return np.empty(shape=(0,2), dtype=np.intp)
*
* def set(ordered_pairs self): # <<<<<<<<<<<<<<
* cdef:
* ordered_pair *pair
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_9set(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_13ordered_pairs_9set = {"set", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_9set, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_9set(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("set", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("set", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_8set(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_8set(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self) {
struct ordered_pair *__pyx_v_pair;
CYTHON_UNUSED __pyx_t_5numpy_intp_t __pyx_v_i;
__pyx_t_5numpy_intp_t __pyx_v_n;
PyObject *__pyx_v_results = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__pyx_t_5numpy_intp_t __pyx_t_2;
__pyx_t_5numpy_intp_t __pyx_t_3;
__pyx_t_5numpy_intp_t __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set", 0);
/* "scipy/spatial/_ckdtree.pyx":291
* np.intp_t i, n
* set results
* results = set() # <<<<<<<<<<<<<<
* pair = self.buf.data()
* n = <np.intp_t> self.buf.size()
*/
__pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_results = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":292
* set results
* results = set()
* pair = self.buf.data() # <<<<<<<<<<<<<<
* n = <np.intp_t> self.buf.size()
* # other platforms
*/
__pyx_v_pair = __pyx_v_self->buf->data();
/* "scipy/spatial/_ckdtree.pyx":293
* results = set()
* pair = self.buf.data()
* n = <np.intp_t> self.buf.size() # <<<<<<<<<<<<<<
* # other platforms
* for i in range(n):
*/
__pyx_v_n = ((__pyx_t_5numpy_intp_t)__pyx_v_self->buf->size());
/* "scipy/spatial/_ckdtree.pyx":295
* n = <np.intp_t> self.buf.size()
* # other platforms
* for i in range(n): # <<<<<<<<<<<<<<
* results.add((pair.i, pair.j))
* pair += 1
*/
__pyx_t_2 = __pyx_v_n;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
/* "scipy/spatial/_ckdtree.pyx":296
* # other platforms
* for i in range(n):
* results.add((pair.i, pair.j)) # <<<<<<<<<<<<<<
* pair += 1
* return results
*/
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_pair->i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = __Pyx_PyLong_From_npy_intp(__pyx_v_pair->j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_5);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 296, __pyx_L1_error);
__pyx_t_1 = 0;
__pyx_t_5 = 0;
__pyx_t_7 = PySet_Add(__pyx_v_results, __pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "scipy/spatial/_ckdtree.pyx":297
* for i in range(n):
* results.add((pair.i, pair.j))
* pair += 1 # <<<<<<<<<<<<<<
* return results
*
*/
__pyx_v_pair = (__pyx_v_pair + 1);
}
/* "scipy/spatial/_ckdtree.pyx":298
* results.add((pair.i, pair.j))
* pair += 1
* return results # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_results);
__pyx_r = __pyx_v_results;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":286
* return np.empty(shape=(0,2), dtype=np.intp)
*
* def set(ordered_pairs self): # <<<<<<<<<<<<<<
* cdef:
* ordered_pair *pair
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("scipy.spatial._ckdtree.ordered_pairs.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_results);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":248
*
* cdef:
* readonly object __array_interface__ # <<<<<<<<<<<<<<
* vector[ordered_pair] *buf
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_19__array_interface___1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_19__array_interface_____get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_19__array_interface_____get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___array_interface__);
__pyx_r = __pyx_v_self->__pyx___array_interface__;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_11__reduce_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_13ordered_pairs_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_11__reduce_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_10__reduce_cython__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
/* "(tree fragment)":2
* def __reduce_cython__(self):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
__Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(2, 2, __pyx_L1_error)
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.spatial._ckdtree.ordered_pairs.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":3
* def __reduce_cython__(self):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_13__setstate_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_13ordered_pairs_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_13ordered_pairs_13__setstate_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[1] = {0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 3, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 3, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 3, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 3, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 3, __pyx_L3_error)
}
__pyx_v___pyx_state = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.ordered_pairs.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_12__setstate_cython__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *)__pyx_v_self), __pyx_v___pyx_state);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_13ordered_pairs_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
/* "(tree fragment)":4
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
*/
__Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(2, 4, __pyx_L1_error)
/* "(tree fragment)":3
* def __reduce_cython__(self):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.spatial._ckdtree.ordered_pairs.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":353
* readonly object greater
*
* cdef void _setup(cKDTreeNode self, cKDTree parent, ckdtreenode *node, np.intp_t level) noexcept: # <<<<<<<<<<<<<<
* cdef cKDTreeNode n1, n2
* self.level = level
*/
static void __pyx_f_5scipy_7spatial_8_ckdtree_11cKDTreeNode__setup(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self, struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_parent, struct ckdtreenode *__pyx_v_node, __pyx_t_5numpy_intp_t __pyx_v_level) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_n1 = 0;
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_n2 = 0;
__Pyx_RefNannyDeclarations
__pyx_t_5numpy_intp_t __pyx_t_1;
__pyx_t_5numpy_float64_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
size_t __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_setup", 0);
/* "scipy/spatial/_ckdtree.pyx":355
* cdef void _setup(cKDTreeNode self, cKDTree parent, ckdtreenode *node, np.intp_t level) noexcept:
* cdef cKDTreeNode n1, n2
* self.level = level # <<<<<<<<<<<<<<
* self.split_dim = node.split_dim
* self.children = node.children
*/
__pyx_v_self->level = __pyx_v_level;
/* "scipy/spatial/_ckdtree.pyx":356
* cdef cKDTreeNode n1, n2
* self.level = level
* self.split_dim = node.split_dim # <<<<<<<<<<<<<<
* self.children = node.children
* self.split = node.split
*/
__pyx_t_1 = __pyx_v_node->split_dim;
__pyx_v_self->split_dim = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":357
* self.level = level
* self.split_dim = node.split_dim
* self.children = node.children # <<<<<<<<<<<<<<
* self.split = node.split
* self.start_idx = node.start_idx
*/
__pyx_t_1 = __pyx_v_node->children;
__pyx_v_self->children = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":358
* self.split_dim = node.split_dim
* self.children = node.children
* self.split = node.split # <<<<<<<<<<<<<<
* self.start_idx = node.start_idx
* self.end_idx = node.end_idx
*/
__pyx_t_2 = __pyx_v_node->split;
__pyx_v_self->split = __pyx_t_2;
/* "scipy/spatial/_ckdtree.pyx":359
* self.children = node.children
* self.split = node.split
* self.start_idx = node.start_idx # <<<<<<<<<<<<<<
* self.end_idx = node.end_idx
* self._data = parent.data
*/
__pyx_t_1 = __pyx_v_node->start_idx;
__pyx_v_self->start_idx = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":360
* self.split = node.split
* self.start_idx = node.start_idx
* self.end_idx = node.end_idx # <<<<<<<<<<<<<<
* self._data = parent.data
* self._indices = parent.indices
*/
__pyx_t_1 = __pyx_v_node->end_idx;
__pyx_v_self->end_idx = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":361
* self.start_idx = node.start_idx
* self.end_idx = node.end_idx
* self._data = parent.data # <<<<<<<<<<<<<<
* self._indices = parent.indices
* if self.split_dim == -1:
*/
__pyx_t_3 = ((PyObject *)__pyx_v_parent->data);
__Pyx_INCREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF((PyObject *)__pyx_v_self->_data);
__Pyx_DECREF((PyObject *)__pyx_v_self->_data);
__pyx_v_self->_data = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":362
* self.end_idx = node.end_idx
* self._data = parent.data
* self._indices = parent.indices # <<<<<<<<<<<<<<
* if self.split_dim == -1:
* self.lesser = None
*/
__pyx_t_3 = ((PyObject *)__pyx_v_parent->indices);
__Pyx_INCREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF((PyObject *)__pyx_v_self->_indices);
__Pyx_DECREF((PyObject *)__pyx_v_self->_indices);
__pyx_v_self->_indices = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":363
* self._data = parent.data
* self._indices = parent.indices
* if self.split_dim == -1: # <<<<<<<<<<<<<<
* self.lesser = None
* self.greater = None
*/
__pyx_t_4 = (__pyx_v_self->split_dim == -1L);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":364
* self._indices = parent.indices
* if self.split_dim == -1:
* self.lesser = None # <<<<<<<<<<<<<<
* self.greater = None
* else:
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->lesser);
__Pyx_DECREF(__pyx_v_self->lesser);
__pyx_v_self->lesser = Py_None;
/* "scipy/spatial/_ckdtree.pyx":365
* if self.split_dim == -1:
* self.lesser = None
* self.greater = None # <<<<<<<<<<<<<<
* else:
* # setup lesser branch
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->greater);
__Pyx_DECREF(__pyx_v_self->greater);
__pyx_v_self->greater = Py_None;
/* "scipy/spatial/_ckdtree.pyx":363
* self._data = parent.data
* self._indices = parent.indices
* if self.split_dim == -1: # <<<<<<<<<<<<<<
* self.lesser = None
* self.greater = None
*/
goto __pyx_L3;
}
/* "scipy/spatial/_ckdtree.pyx":368
* else:
* # setup lesser branch
* n1 = cKDTreeNode() # <<<<<<<<<<<<<<
* n1._setup(parent, node=node.less, level=level + 1)
* self.lesser = n1
*/
/*else*/ {
__pyx_t_5 = NULL;
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTreeNode, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_3);
}
__pyx_v_n1 = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_t_3);
__pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":369
* # setup lesser branch
* n1 = cKDTreeNode()
* n1._setup(parent, node=node.less, level=level + 1) # <<<<<<<<<<<<<<
* self.lesser = n1
* # setup greater branch
*/
((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_n1->__pyx_vtab)->_setup(__pyx_v_n1, __pyx_v_parent, __pyx_v_node->less, (__pyx_v_level + 1));
/* "scipy/spatial/_ckdtree.pyx":370
* n1 = cKDTreeNode()
* n1._setup(parent, node=node.less, level=level + 1)
* self.lesser = n1 # <<<<<<<<<<<<<<
* # setup greater branch
* n2 = cKDTreeNode()
*/
__Pyx_INCREF((PyObject *)__pyx_v_n1);
__Pyx_GIVEREF((PyObject *)__pyx_v_n1);
__Pyx_GOTREF(__pyx_v_self->lesser);
__Pyx_DECREF(__pyx_v_self->lesser);
__pyx_v_self->lesser = ((PyObject *)__pyx_v_n1);
/* "scipy/spatial/_ckdtree.pyx":372
* self.lesser = n1
* # setup greater branch
* n2 = cKDTreeNode() # <<<<<<<<<<<<<<
* n2._setup(parent, node=node.greater, level=level + 1)
* self.greater = n2
*/
__pyx_t_5 = NULL;
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTreeNode, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_3);
}
__pyx_v_n2 = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_t_3);
__pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":373
* # setup greater branch
* n2 = cKDTreeNode()
* n2._setup(parent, node=node.greater, level=level + 1) # <<<<<<<<<<<<<<
* self.greater = n2
*
*/
((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_n2->__pyx_vtab)->_setup(__pyx_v_n2, __pyx_v_parent, __pyx_v_node->greater, (__pyx_v_level + 1));
/* "scipy/spatial/_ckdtree.pyx":374
* n2 = cKDTreeNode()
* n2._setup(parent, node=node.greater, level=level + 1)
* self.greater = n2 # <<<<<<<<<<<<<<
*
* property data_points:
*/
__Pyx_INCREF((PyObject *)__pyx_v_n2);
__Pyx_GIVEREF((PyObject *)__pyx_v_n2);
__Pyx_GOTREF(__pyx_v_self->greater);
__Pyx_DECREF(__pyx_v_self->greater);
__pyx_v_self->greater = ((PyObject *)__pyx_v_n2);
}
__pyx_L3:;
/* "scipy/spatial/_ckdtree.pyx":353
* readonly object greater
*
* cdef void _setup(cKDTreeNode self, cKDTree parent, ckdtreenode *node, np.intp_t level) noexcept: # <<<<<<<<<<<<<<
* cdef cKDTreeNode n1, n2
* self.level = level
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_WriteUnraisable("scipy.spatial._ckdtree.cKDTreeNode._setup", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_n1);
__Pyx_XDECREF((PyObject *)__pyx_v_n2);
__Pyx_RefNannyFinishContext();
}
/* "scipy/spatial/_ckdtree.pyx":377
*
* property data_points:
* def __get__(cKDTreeNode self): # <<<<<<<<<<<<<<
* return self._data[self.indices,:]
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_11data_points_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_11data_points_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_11data_points___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_11data_points___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "scipy/spatial/_ckdtree.pyx":378
* property data_points:
* def __get__(cKDTreeNode self):
* return self._data[self.indices,:] # <<<<<<<<<<<<<<
*
* property indices:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 378, __pyx_L1_error);
__Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 378, __pyx_L1_error);
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->_data), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":377
*
* property data_points:
* def __get__(cKDTreeNode self): # <<<<<<<<<<<<<<
* return self._data[self.indices,:]
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.data_points.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":381
*
* property indices:
* def __get__(cKDTreeNode self): # <<<<<<<<<<<<<<
* cdef np.intp_t start, stop
* start = self.start_idx
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7indices_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7indices___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7indices___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
__pyx_t_5numpy_intp_t __pyx_v_start;
__pyx_t_5numpy_intp_t __pyx_v_stop;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__pyx_t_5numpy_intp_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "scipy/spatial/_ckdtree.pyx":383
* def __get__(cKDTreeNode self):
* cdef np.intp_t start, stop
* start = self.start_idx # <<<<<<<<<<<<<<
* stop = self.end_idx
* return self._indices[start:stop]
*/
__pyx_t_1 = __pyx_v_self->start_idx;
__pyx_v_start = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":384
* cdef np.intp_t start, stop
* start = self.start_idx
* stop = self.end_idx # <<<<<<<<<<<<<<
* return self._indices[start:stop]
*
*/
__pyx_t_1 = __pyx_v_self->end_idx;
__pyx_v_stop = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":385
* start = self.start_idx
* stop = self.end_idx
* return self._indices[start:stop] # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->_indices), __pyx_v_start, __pyx_v_stop, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":381
*
* property indices:
* def __get__(cKDTreeNode self): # <<<<<<<<<<<<<<
* cdef np.intp_t start, stop
* start = self.start_idx
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":342
* """
* cdef:
* readonly np.intp_t level # <<<<<<<<<<<<<<
* readonly np.intp_t split_dim
* readonly np.intp_t children
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5level_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5level_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5level___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5level___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.level.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":343
* cdef:
* readonly np.intp_t level
* readonly np.intp_t split_dim # <<<<<<<<<<<<<<
* readonly np.intp_t children
* readonly np.intp_t start_idx
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9split_dim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9split_dim_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9split_dim___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9split_dim___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->split_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.split_dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":344
* readonly np.intp_t level
* readonly np.intp_t split_dim
* readonly np.intp_t children # <<<<<<<<<<<<<<
* readonly np.intp_t start_idx
* readonly np.intp_t end_idx
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_8children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_8children_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_8children___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_8children___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.children.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":345
* readonly np.intp_t split_dim
* readonly np.intp_t children
* readonly np.intp_t start_idx # <<<<<<<<<<<<<<
* readonly np.intp_t end_idx
* readonly np.float64_t split
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9start_idx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9start_idx_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9start_idx___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_9start_idx___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->start_idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.start_idx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":346
* readonly np.intp_t children
* readonly np.intp_t start_idx
* readonly np.intp_t end_idx # <<<<<<<<<<<<<<
* readonly np.float64_t split
* np.ndarray _data
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7end_idx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7end_idx_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7end_idx___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7end_idx___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->end_idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.end_idx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":347
* readonly np.intp_t start_idx
* readonly np.intp_t end_idx
* readonly np.float64_t split # <<<<<<<<<<<<<<
* np.ndarray _data
* np.ndarray _indices
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5split_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5split_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5split___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_5split___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.split.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":350
* np.ndarray _data
* np.ndarray _indices
* readonly object lesser # <<<<<<<<<<<<<<
* readonly object greater
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_6lesser_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_6lesser_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_6lesser___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_6lesser___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->lesser);
__pyx_r = __pyx_v_self->lesser;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":351
* np.ndarray _indices
* readonly object lesser
* readonly object greater # <<<<<<<<<<<<<<
*
* cdef void _setup(cKDTreeNode self, cKDTree parent, ckdtreenode *node, np.intp_t level) noexcept:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7greater_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7greater_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7greater___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_7greater___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->greater);
__pyx_r = __pyx_v_self->greater;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_1__reduce_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11cKDTreeNode_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_1__reduce_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode___reduce_cython__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode___reduce_cython__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self) {
PyObject *__pyx_v_state = 0;
PyObject *__pyx_v__dict = 0;
int __pyx_v_use_setstate;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
int __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
/* "(tree fragment)":5
* cdef object _dict
* cdef bint use_setstate
* state = (self._data, self._indices, self.children, self.end_idx, self.greater, self.lesser, self.level, self.split, self.split_dim, self.start_idx) # <<<<<<<<<<<<<<
* _dict = getattr(self, '__dict__', None)
* if _dict is not None and _dict:
*/
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->children); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->end_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->level); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->split); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->split_dim); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->start_idx); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PyTuple_New(10); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF((PyObject *)__pyx_v_self->_data);
__Pyx_GIVEREF((PyObject *)__pyx_v_self->_data);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_self->_data)) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__Pyx_INCREF((PyObject *)__pyx_v_self->_indices);
__Pyx_GIVEREF((PyObject *)__pyx_v_self->_indices);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_self->_indices)) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_1) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_2) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_self->greater);
__Pyx_GIVEREF(__pyx_v_self->greater);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_self->greater) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_self->lesser);
__Pyx_GIVEREF(__pyx_v_self->lesser);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_v_self->lesser) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_3);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_3) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_t_4) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_5);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_t_5) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_6);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 9, __pyx_t_6) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_t_6 = 0;
__pyx_v_state = ((PyObject*)__pyx_t_7);
__pyx_t_7 = 0;
/* "(tree fragment)":6
* cdef bint use_setstate
* state = (self._data, self._indices, self.children, self.end_idx, self.greater, self.lesser, self.level, self.split, self.split_dim, self.start_idx)
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
* if _dict is not None and _dict:
* state += (_dict,)
*/
__pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v__dict = __pyx_t_7;
__pyx_t_7 = 0;
/* "(tree fragment)":7
* state = (self._data, self._indices, self.children, self.end_idx, self.greater, self.lesser, self.level, self.split, self.split_dim, self.start_idx)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None and _dict: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
__pyx_t_9 = (__pyx_v__dict != Py_None);
if (__pyx_t_9) {
} else {
__pyx_t_8 = __pyx_t_9;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(2, 7, __pyx_L1_error)
__pyx_t_8 = __pyx_t_9;
__pyx_L4_bool_binop_done:;
if (__pyx_t_8) {
/* "(tree fragment)":8
* _dict = getattr(self, '__dict__', None)
* if _dict is not None and _dict:
* state += (_dict,) # <<<<<<<<<<<<<<
* use_setstate = True
* else:
*/
__pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v__dict);
__Pyx_GIVEREF(__pyx_v__dict);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict) != (0)) __PYX_ERR(2, 8, __pyx_L1_error);
__pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_6));
__pyx_t_6 = 0;
/* "(tree fragment)":9
* if _dict is not None and _dict:
* state += (_dict,)
* use_setstate = True # <<<<<<<<<<<<<<
* else:
* use_setstate = self._data is not None or self._indices is not None or self.greater is not None or self.lesser is not None
*/
__pyx_v_use_setstate = 1;
/* "(tree fragment)":7
* state = (self._data, self._indices, self.children, self.end_idx, self.greater, self.lesser, self.level, self.split, self.split_dim, self.start_idx)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None and _dict: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
goto __pyx_L3;
}
/* "(tree fragment)":11
* use_setstate = True
* else:
* use_setstate = self._data is not None or self._indices is not None or self.greater is not None or self.lesser is not None # <<<<<<<<<<<<<<
* if use_setstate:
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, None), state
*/
/*else*/ {
__pyx_t_9 = (((PyObject *)__pyx_v_self->_data) != Py_None);
if (!__pyx_t_9) {
} else {
__pyx_t_8 = __pyx_t_9;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_9 = (((PyObject *)__pyx_v_self->_indices) != Py_None);
if (!__pyx_t_9) {
} else {
__pyx_t_8 = __pyx_t_9;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_9 = (__pyx_v_self->greater != Py_None);
if (!__pyx_t_9) {
} else {
__pyx_t_8 = __pyx_t_9;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_9 = (__pyx_v_self->lesser != Py_None);
__pyx_t_8 = __pyx_t_9;
__pyx_L6_bool_binop_done:;
__pyx_v_use_setstate = __pyx_t_8;
}
__pyx_L3:;
/* "(tree fragment)":12
* else:
* use_setstate = self._data is not None or self._indices is not None or self.greater is not None or self.lesser is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, None), state
* else:
*/
if (__pyx_v_use_setstate) {
/* "(tree fragment)":13
* use_setstate = self._data is not None or self._indices is not None or self.greater is not None or self.lesser is not None
* if use_setstate:
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, None), state # <<<<<<<<<<<<<<
* else:
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, state)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_cKDTreeNode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_158353030);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_158353030);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_158353030) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_7);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
__pyx_t_6 = 0;
__pyx_t_7 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "(tree fragment)":12
* else:
* use_setstate = self._data is not None or self._indices is not None or self.greater is not None or self.lesser is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, None), state
* else:
*/
}
/* "(tree fragment)":15
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, None), state
* else:
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, state) # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_cKDTreeNode__set_state(self, __pyx_state)
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_cKDTreeNode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_158353030);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_158353030);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_158353030) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_7);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
__pyx_t_5 = 0;
__pyx_t_7 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_state);
__Pyx_XDECREF(__pyx_v__dict);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_cKDTreeNode__set_state(self, __pyx_state)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_3__setstate_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_11cKDTreeNode_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_11cKDTreeNode_3__setstate_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v___pyx_state = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[1] = {0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 16, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 16, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 16, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 16, __pyx_L3_error)
}
__pyx_v___pyx_state = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_2__setstate_cython__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_self), __pyx_v___pyx_state);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_11cKDTreeNode_2__setstate_cython__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
/* "(tree fragment)":17
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, state)
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_cKDTreeNode__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
*/
__pyx_t_1 = __pyx_v___pyx_state;
__Pyx_INCREF(__pyx_t_1);
if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 17, __pyx_L1_error)
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
__PYX_ERR(2, 17, __pyx_L1_error)
}
__pyx_t_2 = __pyx_f_5scipy_7spatial_8_ckdtree___pyx_unpickle_cKDTreeNode__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_cKDTreeNode, (type(self), 0x9704686, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_cKDTreeNode__set_state(self, __pyx_state)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTreeNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":388
*
*
* cdef np.intp_t get_num_workers(workers: object, kwargs: dict) except -1: # <<<<<<<<<<<<<<
* """Handle the workers argument"""
* if workers is None:
*/
static __pyx_t_5numpy_intp_t __pyx_f_5scipy_7spatial_8_ckdtree_get_num_workers(PyObject *__pyx_v_workers, PyObject *__pyx_v_kwargs) {
__pyx_t_5numpy_intp_t __pyx_v_n;
PyObject *__pyx_v_num = NULL;
__pyx_t_5numpy_intp_t __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7[4];
PyObject *__pyx_t_8 = NULL;
size_t __pyx_t_9;
__pyx_t_5numpy_intp_t __pyx_t_10;
PyObject *__pyx_t_11[3];
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_num_workers", 0);
__Pyx_INCREF(__pyx_v_workers);
/* "scipy/spatial/_ckdtree.pyx":390
* cdef np.intp_t get_num_workers(workers: object, kwargs: dict) except -1:
* """Handle the workers argument"""
* if workers is None: # <<<<<<<<<<<<<<
* workers = 1
*
*/
__pyx_t_1 = (__pyx_v_workers == Py_None);
if (__pyx_t_1) {
/* "scipy/spatial/_ckdtree.pyx":391
* """Handle the workers argument"""
* if workers is None:
* workers = 1 # <<<<<<<<<<<<<<
*
* if len(kwargs) > 0:
*/
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
__Pyx_DECREF_SET(__pyx_v_workers, __pyx_mstate_global->__pyx_int_1);
/* "scipy/spatial/_ckdtree.pyx":390
* cdef np.intp_t get_num_workers(workers: object, kwargs: dict) except -1:
* """Handle the workers argument"""
* if workers is None: # <<<<<<<<<<<<<<
* workers = 1
*
*/
}
/* "scipy/spatial/_ckdtree.pyx":393
* workers = 1
*
* if len(kwargs) > 0: # <<<<<<<<<<<<<<
* raise TypeError(
* f"Unexpected keyword argument{'s' if len(kwargs) > 1 else ''} "
*/
__pyx_t_2 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 393, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 > 0);
if (unlikely(__pyx_t_1)) {
/* "scipy/spatial/_ckdtree.pyx":394
*
* if len(kwargs) > 0:
* raise TypeError( # <<<<<<<<<<<<<<
* f"Unexpected keyword argument{'s' if len(kwargs) > 1 else ''} "
* f"{kwargs}")
*/
__pyx_t_4 = NULL;
/* "scipy/spatial/_ckdtree.pyx":395
* if len(kwargs) > 0:
* raise TypeError(
* f"Unexpected keyword argument{'s' if len(kwargs) > 1 else ''} " # <<<<<<<<<<<<<<
* f"{kwargs}")
*
*/
__pyx_t_2 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 395, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 > 1);
if (__pyx_t_1) {
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_s);
__pyx_t_5 = __pyx_mstate_global->__pyx_n_u_s;
} else {
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_);
__pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_;
}
__pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":396
* raise TypeError(
* f"Unexpected keyword argument{'s' if len(kwargs) > 1 else ''} "
* f"{kwargs}") # <<<<<<<<<<<<<<
*
* cdef np.intp_t n = operator.index(workers)
*/
__pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_kwargs, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Unexpected_keyword_argument;
__pyx_t_7[1] = __pyx_t_6;
__pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__2;
__pyx_t_7[3] = __pyx_t_5;
/* "scipy/spatial/_ckdtree.pyx":395
* if len(kwargs) > 0:
* raise TypeError(
* f"Unexpected keyword argument{'s' if len(kwargs) > 1 else ''} " # <<<<<<<<<<<<<<
* f"{kwargs}")
*
*/
__pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, 27 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 395, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __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_ERR(0, 394, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":393
* workers = 1
*
* if len(kwargs) > 0: # <<<<<<<<<<<<<<
* raise TypeError(
* f"Unexpected keyword argument{'s' if len(kwargs) > 1 else ''} "
*/
}
/* "scipy/spatial/_ckdtree.pyx":398
* f"{kwargs}")
*
* cdef np.intp_t n = operator.index(workers) # <<<<<<<<<<<<<<
* if n == -1:
* num = os.cpu_count()
*/
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_operator); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_8);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_workers};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_t_10 = __Pyx_PyLong_As_npy_intp(__pyx_t_3); if (unlikely((__pyx_t_10 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_n = __pyx_t_10;
/* "scipy/spatial/_ckdtree.pyx":399
*
* cdef np.intp_t n = operator.index(workers)
* if n == -1: # <<<<<<<<<<<<<<
* num = os.cpu_count()
* if num is None:
*/
__pyx_t_1 = (__pyx_v_n == -1L);
if (__pyx_t_1) {
/* "scipy/spatial/_ckdtree.pyx":400
* cdef np.intp_t n = operator.index(workers)
* if n == -1:
* num = os.cpu_count() # <<<<<<<<<<<<<<
* if num is None:
* raise NotImplementedError(
*/
__pyx_t_5 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_cpu_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
assert(__pyx_t_5);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_v_num = __pyx_t_3;
__pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":401
* if n == -1:
* num = os.cpu_count()
* if num is None: # <<<<<<<<<<<<<<
* raise NotImplementedError(
* 'Cannot determine the number of cpus using os.cpu_count(), '
*/
__pyx_t_1 = (__pyx_v_num == Py_None);
if (unlikely(__pyx_t_1)) {
/* "scipy/spatial/_ckdtree.pyx":402
* num = os.cpu_count()
* if num is None:
* raise NotImplementedError( # <<<<<<<<<<<<<<
* 'Cannot determine the number of cpus using os.cpu_count(), '
* 'cannot use -1 for the number of workers')
*/
__pyx_t_4 = NULL;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Cannot_determine_the_number_of_c};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __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_ERR(0, 402, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":401
* if n == -1:
* num = os.cpu_count()
* if num is None: # <<<<<<<<<<<<<<
* raise NotImplementedError(
* 'Cannot determine the number of cpus using os.cpu_count(), '
*/
}
/* "scipy/spatial/_ckdtree.pyx":405
* 'Cannot determine the number of cpus using os.cpu_count(), '
* 'cannot use -1 for the number of workers')
* n = num # <<<<<<<<<<<<<<
* elif n <= 0:
* raise ValueError(f'Invalid number of workers {workers}, must be -1 or > 0')
*/
__pyx_t_10 = __Pyx_PyLong_As_npy_intp(__pyx_v_num); if (unlikely((__pyx_t_10 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L1_error)
__pyx_v_n = __pyx_t_10;
/* "scipy/spatial/_ckdtree.pyx":399
*
* cdef np.intp_t n = operator.index(workers)
* if n == -1: # <<<<<<<<<<<<<<
* num = os.cpu_count()
* if num is None:
*/
goto __pyx_L5;
}
/* "scipy/spatial/_ckdtree.pyx":406
* 'cannot use -1 for the number of workers')
* n = num
* elif n <= 0: # <<<<<<<<<<<<<<
* raise ValueError(f'Invalid number of workers {workers}, must be -1 or > 0')
* return n
*/
__pyx_t_1 = (__pyx_v_n <= 0);
if (unlikely(__pyx_t_1)) {
/* "scipy/spatial/_ckdtree.pyx":407
* n = num
* elif n <= 0:
* raise ValueError(f'Invalid number of workers {workers}, must be -1 or > 0') # <<<<<<<<<<<<<<
* return n
*
*/
__pyx_t_4 = NULL;
__pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_workers, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_number_of_workers;
__pyx_t_11[1] = __pyx_t_5;
__pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_must_be_1_or_0;
__pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_11, 3, 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 19, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __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_ERR(0, 407, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":406
* 'cannot use -1 for the number of workers')
* n = num
* elif n <= 0: # <<<<<<<<<<<<<<
* raise ValueError(f'Invalid number of workers {workers}, must be -1 or > 0')
* return n
*/
}
__pyx_L5:;
/* "scipy/spatial/_ckdtree.pyx":408
* elif n <= 0:
* raise ValueError(f'Invalid number of workers {workers}, must be -1 or > 0')
* return n # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_n;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":388
*
*
* cdef np.intp_t get_num_workers(workers: object, kwargs: dict) except -1: # <<<<<<<<<<<<<<
* """Handle the workers argument"""
* if workers is None:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("scipy.spatial._ckdtree.get_num_workers", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1L;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_num);
__Pyx_XDECREF(__pyx_v_workers);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":532
*
* property n:
* def __get__(self): return self.cself.n # <<<<<<<<<<<<<<
*
* property m:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_1n_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_1n_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_1n___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_1n___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->cself->n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.n.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":535
*
* property m:
* def __get__(self): return self.cself.m # <<<<<<<<<<<<<<
*
* property leafsize:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_1m_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_1m_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_1m___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_1m___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->cself->m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.m.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":538
*
* property leafsize:
* def __get__(self): return self.cself.leafsize # <<<<<<<<<<<<<<
*
* property size:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_8leafsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_8leafsize_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_8leafsize___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_8leafsize___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->cself->leafsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.leafsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":541
*
* property size:
* def __get__(self): return self.cself.size # <<<<<<<<<<<<<<
*
* property tree:
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4size_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4size___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4size___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
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("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_npy_intp(__pyx_v_self->cself->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":545
* property tree:
* # make the tree viewable from Python
* def __get__(cKDTree self): # <<<<<<<<<<<<<<
* cdef cKDTreeNode n
* cdef ckdtree *cself = self.cself
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4tree___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":549
* cdef ckdtree *cself = self.cself
* if self._python_tree is None:
* def closure(): # <<<<<<<<<<<<<<
* n = cKDTreeNode()
* n._setup(self, node=cself.ctree, level=0)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_7__get___1closure(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_7__get___1closure = {"closure", (PyCFunction)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_7__get___1closure, METH_NOARGS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_7__get___1closure(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("closure (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_7__get___closure(__pyx_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_7__get___closure(PyObject *__pyx_self) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__ *__pyx_cur_scope;
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__ *__pyx_outer_scope;
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *__pyx_v_n = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
size_t __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("closure", 0);
__pyx_outer_scope = (struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
/* "scipy/spatial/_ckdtree.pyx":550
* if self._python_tree is None:
* def closure():
* n = cKDTreeNode() # <<<<<<<<<<<<<<
* n._setup(self, node=cself.ctree, level=0)
* self._python_tree = n
*/
__pyx_t_2 = NULL;
__pyx_t_3 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTreeNode, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_1);
}
__pyx_v_n = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_t_1);
__pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":551
* def closure():
* n = cKDTreeNode()
* n._setup(self, node=cself.ctree, level=0) # <<<<<<<<<<<<<<
* self._python_tree = n
* py_safe_call_object_once(self.flag, closure)
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 551, __pyx_L1_error) }
__pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_INCREF(__pyx_t_1);
((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTreeNode *)__pyx_v_n->__pyx_vtab)->_setup(__pyx_v_n, ((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_t_1), __pyx_cur_scope->__pyx_v_cself->ctree, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":552
* n = cKDTreeNode()
* n._setup(self, node=cself.ctree, level=0)
* self._python_tree = n # <<<<<<<<<<<<<<
* py_safe_call_object_once(self.flag, closure)
* return self._python_tree
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 552, __pyx_L1_error) }
__Pyx_INCREF((PyObject *)__pyx_v_n);
__Pyx_GIVEREF((PyObject *)__pyx_v_n);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->_python_tree);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->_python_tree);
__pyx_cur_scope->__pyx_v_self->_python_tree = ((PyObject *)__pyx_v_n);
/* "scipy/spatial/_ckdtree.pyx":549
* cdef ckdtree *cself = self.cself
* if self._python_tree is None:
* def closure(): # <<<<<<<<<<<<<<
* n = cKDTreeNode()
* n._setup(self, node=cself.ctree, level=0)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.tree.__get__.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_n);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":545
* property tree:
* # make the tree viewable from Python
* def __get__(cKDTree self): # <<<<<<<<<<<<<<
* cdef cKDTreeNode n
* cdef ckdtree *cself = self.cself
*/
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4tree___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__ *__pyx_cur_scope;
PyObject *__pyx_v_closure = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct ckdtree *__pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
__pyx_cur_scope = (struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__ *)__pyx_tp_new_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__(__pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__, __pyx_mstate_global->__pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct____get__ *)Py_None);
__Pyx_INCREF(Py_None);
__PYX_ERR(0, 545, __pyx_L1_error)
} else {
__Pyx_GOTREF((PyObject *)__pyx_cur_scope);
}
__pyx_cur_scope->__pyx_v_self = __pyx_v_self;
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
/* "scipy/spatial/_ckdtree.pyx":547
* def __get__(cKDTree self):
* cdef cKDTreeNode n
* cdef ckdtree *cself = self.cself # <<<<<<<<<<<<<<
* if self._python_tree is None:
* def closure():
*/
__pyx_t_1 = __pyx_cur_scope->__pyx_v_self->cself;
__pyx_cur_scope->__pyx_v_cself = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":548
* cdef cKDTreeNode n
* cdef ckdtree *cself = self.cself
* if self._python_tree is None: # <<<<<<<<<<<<<<
* def closure():
* n = cKDTreeNode()
*/
__pyx_t_2 = (__pyx_cur_scope->__pyx_v_self->_python_tree == Py_None);
if (__pyx_t_2) {
/* "scipy/spatial/_ckdtree.pyx":549
* cdef ckdtree *cself = self.cself
* if self._python_tree is None:
* def closure(): # <<<<<<<<<<<<<<
* n = cKDTreeNode()
* n._setup(self, node=cself.ctree, level=0)
*/
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_4tree_7__get___1closure, 0, __pyx_mstate_global->__pyx_n_u_cKDTree___get___locals_closure, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_scipy_spatial__ckdtree, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_closure = __pyx_t_3;
__pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":553
* n._setup(self, node=cself.ctree, level=0)
* self._python_tree = n
* py_safe_call_object_once(self.flag, closure) # <<<<<<<<<<<<<<
* return self._python_tree
*
*/
try {
__pyx_cpp_py_safe_call_object_once(__pyx_cur_scope->__pyx_v_self->flag, __pyx_v_closure);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L1_error)
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(0, 553, __pyx_L1_error)
}
/* "scipy/spatial/_ckdtree.pyx":548
* cdef cKDTreeNode n
* cdef ckdtree *cself = self.cself
* if self._python_tree is None: # <<<<<<<<<<<<<<
* def closure():
* n = cKDTreeNode()
*/
}
/* "scipy/spatial/_ckdtree.pyx":554
* self._python_tree = n
* py_safe_call_object_once(self.flag, closure)
* return self._python_tree # <<<<<<<<<<<<<<
*
* def __cinit__(cKDTree self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->_python_tree);
__pyx_r = __pyx_cur_scope->__pyx_v_self->_python_tree;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":545
* property tree:
* # make the tree viewable from Python
* def __get__(cKDTree self): # <<<<<<<<<<<<<<
* cdef cKDTreeNode n
* cdef ckdtree *cself = self.cself
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.tree.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_closure);
__Pyx_DECREF((PyObject *)__pyx_cur_scope);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":556
* return self._python_tree
*
* def __cinit__(cKDTree self): # <<<<<<<<<<<<<<
* self.cself = <ckdtree * > PyMem_Malloc(sizeof(ckdtree))
* self.cself.tree_buffer = NULL
*/
/* Python wrapper */
static int __pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
#endif
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return -1;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree___cinit__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree___cinit__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
int __pyx_r;
/* "scipy/spatial/_ckdtree.pyx":557
*
* def __cinit__(cKDTree self):
* self.cself = <ckdtree * > PyMem_Malloc(sizeof(ckdtree)) # <<<<<<<<<<<<<<
* self.cself.tree_buffer = NULL
*
*/
__pyx_v_self->cself = ((struct ckdtree *)PyMem_Malloc((sizeof(struct ckdtree))));
/* "scipy/spatial/_ckdtree.pyx":558
* def __cinit__(cKDTree self):
* self.cself = <ckdtree * > PyMem_Malloc(sizeof(ckdtree))
* self.cself.tree_buffer = NULL # <<<<<<<<<<<<<<
*
* def __init__(cKDTree self, data, np.intp_t leafsize=16, compact_nodes=True,
*/
__pyx_v_self->cself->tree_buffer = NULL;
/* "scipy/spatial/_ckdtree.pyx":556
* return self._python_tree
*
* def __cinit__(cKDTree self): # <<<<<<<<<<<<<<
* self.cself = <ckdtree * > PyMem_Malloc(sizeof(ckdtree))
* self.cself.tree_buffer = NULL
*/
/* function exit code */
__pyx_r = 0;
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":560
* self.cself.tree_buffer = NULL
*
* def __init__(cKDTree self, data, np.intp_t leafsize=16, compact_nodes=True, # <<<<<<<<<<<<<<
* copy_data=False, balanced_tree=True, boxsize=None):
*
*/
/* Python wrapper */
static int __pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
__pyx_t_5numpy_intp_t __pyx_v_leafsize;
PyObject *__pyx_v_compact_nodes = 0;
PyObject *__pyx_v_copy_data = 0;
PyObject *__pyx_v_balanced_tree = 0;
PyObject *__pyx_v_boxsize = 0;
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[6] = {0,0,0,0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
#endif
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_leafsize,&__pyx_mstate_global->__pyx_n_u_compact_nodes,&__pyx_mstate_global->__pyx_n_u_copy_data,&__pyx_mstate_global->__pyx_n_u_balanced_tree,&__pyx_mstate_global->__pyx_n_u_boxsize,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 560, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 6:
values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 5:
values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 4:
values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 560, __pyx_L3_error)
if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
/* "scipy/spatial/_ckdtree.pyx":561
*
* def __init__(cKDTree self, data, np.intp_t leafsize=16, compact_nodes=True,
* copy_data=False, balanced_tree=True, boxsize=None): # <<<<<<<<<<<<<<
*
* cdef:
*/
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, i); __PYX_ERR(0, 560, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 6:
values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 5:
values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 4:
values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 560, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 560, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
/* "scipy/spatial/_ckdtree.pyx":560
* self.cself.tree_buffer = NULL
*
* def __init__(cKDTree self, data, np.intp_t leafsize=16, compact_nodes=True, # <<<<<<<<<<<<<<
* copy_data=False, balanced_tree=True, boxsize=None):
*
*/
if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
/* "scipy/spatial/_ckdtree.pyx":561
*
* def __init__(cKDTree self, data, np.intp_t leafsize=16, compact_nodes=True,
* copy_data=False, balanced_tree=True, boxsize=None): # <<<<<<<<<<<<<<
*
* cdef:
*/
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
}
__pyx_v_data = values[0];
if (values[1]) {
__pyx_v_leafsize = __Pyx_PyLong_As_npy_intp(values[1]); if (unlikely((__pyx_v_leafsize == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L3_error)
} else {
__pyx_v_leafsize = ((__pyx_t_5numpy_intp_t)16);
}
__pyx_v_compact_nodes = values[2];
__pyx_v_copy_data = values[3];
__pyx_v_balanced_tree = values[4];
__pyx_v_boxsize = values[5];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 560, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_2__init__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v_data, __pyx_v_leafsize, __pyx_v_compact_nodes, __pyx_v_copy_data, __pyx_v_balanced_tree, __pyx_v_boxsize);
/* "scipy/spatial/_ckdtree.pyx":560
* self.cself.tree_buffer = NULL
*
* def __init__(cKDTree self, data, np.intp_t leafsize=16, compact_nodes=True, # <<<<<<<<<<<<<<
* copy_data=False, balanced_tree=True, boxsize=None):
*
*/
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_2__init__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_data, __pyx_t_5numpy_intp_t __pyx_v_leafsize, PyObject *__pyx_v_compact_nodes, PyObject *__pyx_v_copy_data, PyObject *__pyx_v_balanced_tree, PyObject *__pyx_v_boxsize) {
__Pyx_memviewslice __pyx_v_tmpmaxes = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_tmpmins = { 0, 0, { 0 }, { 0 }, { 0 } };
__pyx_t_5numpy_float64_t *__pyx_v_ptmpmaxes;
__pyx_t_5numpy_float64_t *__pyx_v_ptmpmins;
struct ckdtree *__pyx_v_cself;
int __pyx_v_compact;
int __pyx_v_median;
PyObject *__pyx_v_periodic_mask = NULL;
int __pyx_r;
__Pyx_RefNannyDeclarations
struct ckdtree *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
size_t __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
__pyx_t_5numpy_intp_t __pyx_t_11;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
int __pyx_t_15;
std::vector<struct ckdtreenode> *__pyx_t_16;
__Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
Py_ssize_t __pyx_t_18;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
__Pyx_INCREF(__pyx_v_data);
__Pyx_INCREF(__pyx_v_copy_data);
__Pyx_INCREF(__pyx_v_boxsize);
/* "scipy/spatial/_ckdtree.pyx":567
* np.float64_t *ptmpmaxes
* np.float64_t *ptmpmins
* ckdtree *cself = self.cself # <<<<<<<<<<<<<<
* int compact, median
*
*/
__pyx_t_1 = __pyx_v_self->cself;
__pyx_v_cself = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":570
* int compact, median
*
* self._python_tree = None # <<<<<<<<<<<<<<
*
* if not copy_data:
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->_python_tree);
__Pyx_DECREF(__pyx_v_self->_python_tree);
__pyx_v_self->_python_tree = Py_None;
/* "scipy/spatial/_ckdtree.pyx":572
* self._python_tree = None
*
* if not copy_data: # <<<<<<<<<<<<<<
* copy_data = copy_if_needed
* data = np.array(data, order='C', copy=copy_data, dtype=np.float64)
*/
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_copy_data); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 572, __pyx_L1_error)
__pyx_t_3 = (!__pyx_t_2);
if (__pyx_t_3) {
/* "scipy/spatial/_ckdtree.pyx":573
*
* if not copy_data:
* copy_data = copy_if_needed # <<<<<<<<<<<<<<
* data = np.array(data, order='C', copy=copy_data, dtype=np.float64)
*
*/
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_copy_if_needed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_copy_data, __pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":572
* self._python_tree = None
*
* if not copy_data: # <<<<<<<<<<<<<<
* copy_data = copy_if_needed
* data = np.array(data, order='C', copy=copy_data, dtype=np.float64)
*/
}
/* "scipy/spatial/_ckdtree.pyx":574
* if not copy_data:
* copy_data = copy_if_needed
* data = np.array(data, order='C', copy=copy_data, dtype=np.float64) # <<<<<<<<<<<<<<
*
* # read-only view so ban people modifying tree.data after the tree is
*/
__pyx_t_5 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
assert(__pyx_t_5);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_5, __pyx_v_data};
__pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_n_u_C, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 574, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, __pyx_v_copy_data, __pyx_t_6, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 574, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_6, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 574, __pyx_L1_error)
__pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":578
* # read-only view so ban people modifying tree.data after the tree is
* # constructed
* data = data.view(np.ndarray) # <<<<<<<<<<<<<<
* data.flags.writeable = False
*
*/
__pyx_t_7 = __pyx_v_data;
__Pyx_INCREF(__pyx_t_7);
__pyx_t_9 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_mstate_global->__pyx_ptype_5numpy_ndarray)};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_view, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":579
* # constructed
* data = data.view(np.ndarray)
* data.flags.writeable = False # <<<<<<<<<<<<<<
*
* if data.ndim != 2:
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_writeable, Py_False) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":581
* data.flags.writeable = False
*
* if data.ndim != 2: # <<<<<<<<<<<<<<
* raise ValueError("data must be of shape (n, m), where there are "
* "n points of dimension m")
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = (__Pyx_PyLong_BoolNeObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_2, 2, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 581, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(__pyx_t_3)) {
/* "scipy/spatial/_ckdtree.pyx":582
*
* if data.ndim != 2:
* raise ValueError("data must be of shape (n, m), where there are " # <<<<<<<<<<<<<<
* "n points of dimension m")
*
*/
__pyx_t_7 = NULL;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_data_must_be_of_shape_n_m_where};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __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_ERR(0, 582, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":581
* data.flags.writeable = False
*
* if data.ndim != 2: # <<<<<<<<<<<<<<
* raise ValueError("data must be of shape (n, m), where there are "
* "n points of dimension m")
*/
}
/* "scipy/spatial/_ckdtree.pyx":585
* "n points of dimension m")
*
* if not np.isfinite(data).all(): # <<<<<<<<<<<<<<
* raise ValueError("data must be finite, check for nan or inf values")
*
*/
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_isfinite); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
assert(__pyx_t_8);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_data};
__pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_7 = __pyx_t_6;
__Pyx_INCREF(__pyx_t_7);
__pyx_t_9 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_all, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 585, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = (!__pyx_t_3);
if (unlikely(__pyx_t_2)) {
/* "scipy/spatial/_ckdtree.pyx":586
*
* if not np.isfinite(data).all():
* raise ValueError("data must be finite, check for nan or inf values") # <<<<<<<<<<<<<<
*
* self.data = data
*/
__pyx_t_6 = NULL;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_data_must_be_finite_check_for_na};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __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_ERR(0, 586, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":585
* "n points of dimension m")
*
* if not np.isfinite(data).all(): # <<<<<<<<<<<<<<
* raise ValueError("data must be finite, check for nan or inf values")
*
*/
}
/* "scipy/spatial/_ckdtree.pyx":588
* raise ValueError("data must be finite, check for nan or inf values")
*
* self.data = data # <<<<<<<<<<<<<<
* cself.n = data.shape[0]
* cself.m = data.shape[1]
*/
__pyx_t_4 = __pyx_v_data;
__Pyx_INCREF(__pyx_t_4);
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 588, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF((PyObject *)__pyx_v_self->data);
__Pyx_DECREF((PyObject *)__pyx_v_self->data);
__pyx_v_self->data = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":589
*
* self.data = data
* cself.n = data.shape[0] # <<<<<<<<<<<<<<
* cself.m = data.shape[1]
* cself.leafsize = leafsize
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_11 = __Pyx_PyLong_As_npy_intp(__pyx_t_6); if (unlikely((__pyx_t_11 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_cself->n = __pyx_t_11;
/* "scipy/spatial/_ckdtree.pyx":590
* self.data = data
* cself.n = data.shape[0]
* cself.m = data.shape[1] # <<<<<<<<<<<<<<
* cself.leafsize = leafsize
*
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = __Pyx_PyLong_As_npy_intp(__pyx_t_4); if (unlikely((__pyx_t_11 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_cself->m = __pyx_t_11;
/* "scipy/spatial/_ckdtree.pyx":591
* cself.n = data.shape[0]
* cself.m = data.shape[1]
* cself.leafsize = leafsize # <<<<<<<<<<<<<<
*
* if leafsize<1:
*/
__pyx_v_cself->leafsize = __pyx_v_leafsize;
/* "scipy/spatial/_ckdtree.pyx":593
* cself.leafsize = leafsize
*
* if leafsize<1: # <<<<<<<<<<<<<<
* raise ValueError("leafsize must be at least 1")
*
*/
__pyx_t_2 = (__pyx_v_leafsize < 1);
if (unlikely(__pyx_t_2)) {
/* "scipy/spatial/_ckdtree.pyx":594
*
* if leafsize<1:
* raise ValueError("leafsize must be at least 1") # <<<<<<<<<<<<<<
*
* if boxsize is None:
*/
__pyx_t_6 = NULL;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_leafsize_must_be_at_least_1};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __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_ERR(0, 594, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":593
* cself.leafsize = leafsize
*
* if leafsize<1: # <<<<<<<<<<<<<<
* raise ValueError("leafsize must be at least 1")
*
*/
}
/* "scipy/spatial/_ckdtree.pyx":596
* raise ValueError("leafsize must be at least 1")
*
* if boxsize is None: # <<<<<<<<<<<<<<
* self.boxsize = None
* self.boxsize_data = None
*/
__pyx_t_2 = (__pyx_v_boxsize == Py_None);
if (__pyx_t_2) {
/* "scipy/spatial/_ckdtree.pyx":597
*
* if boxsize is None:
* self.boxsize = None # <<<<<<<<<<<<<<
* self.boxsize_data = None
* else:
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->boxsize);
__Pyx_DECREF(__pyx_v_self->boxsize);
__pyx_v_self->boxsize = Py_None;
/* "scipy/spatial/_ckdtree.pyx":598
* if boxsize is None:
* self.boxsize = None
* self.boxsize_data = None # <<<<<<<<<<<<<<
* else:
* self.boxsize_data = np.empty(2 * self.m, dtype=np.float64)
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF((PyObject *)__pyx_v_self->boxsize_data);
__Pyx_DECREF((PyObject *)__pyx_v_self->boxsize_data);
__pyx_v_self->boxsize_data = ((PyArrayObject *)Py_None);
/* "scipy/spatial/_ckdtree.pyx":596
* raise ValueError("leafsize must be at least 1")
*
* if boxsize is None: # <<<<<<<<<<<<<<
* self.boxsize = None
* self.boxsize_data = None
*/
goto __pyx_L7;
}
/* "scipy/spatial/_ckdtree.pyx":600
* self.boxsize_data = None
* else:
* self.boxsize_data = np.empty(2 * self.m, dtype=np.float64) # <<<<<<<<<<<<<<
* boxsize = broadcast_contiguous(boxsize, shape=(self.m,),
* dtype=np.float64)
*/
/*else*/ {
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_t_7, 2, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
assert(__pyx_t_6);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_8};
__pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_7, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 600, __pyx_L1_error)
__pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF((PyObject *)__pyx_v_self->boxsize_data);
__Pyx_DECREF((PyObject *)__pyx_v_self->boxsize_data);
__pyx_v_self->boxsize_data = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":601
* else:
* self.boxsize_data = np.empty(2 * self.m, dtype=np.float64)
* boxsize = broadcast_contiguous(boxsize, shape=(self.m,), # <<<<<<<<<<<<<<
* dtype=np.float64)
* self.boxsize_data[:self.m] = boxsize
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 601, __pyx_L1_error);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":602
* self.boxsize_data = np.empty(2 * self.m, dtype=np.float64)
* boxsize = broadcast_contiguous(boxsize, shape=(self.m,),
* dtype=np.float64) # <<<<<<<<<<<<<<
* self.boxsize_data[:self.m] = boxsize
* self.boxsize_data[self.m:] = 0.5 * boxsize
*/
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":601
* else:
* self.boxsize_data = np.empty(2 * self.m, dtype=np.float64)
* boxsize = broadcast_contiguous(boxsize, shape=(self.m,), # <<<<<<<<<<<<<<
* dtype=np.float64)
* self.boxsize_data[:self.m] = boxsize
*/
__pyx_t_4 = ((PyObject *)__pyx_f_5scipy_7spatial_8_ckdtree_broadcast_contiguous(__pyx_v_boxsize, ((PyObject*)__pyx_t_10), __pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF_SET(__pyx_v_boxsize, __pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":603
* boxsize = broadcast_contiguous(boxsize, shape=(self.m,),
* dtype=np.float64)
* self.boxsize_data[:self.m] = boxsize # <<<<<<<<<<<<<<
* self.boxsize_data[self.m:] = 0.5 * boxsize
*
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->boxsize_data), __pyx_v_boxsize, 0, 0, NULL, &__pyx_t_4, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":604
* dtype=np.float64)
* self.boxsize_data[:self.m] = boxsize
* self.boxsize_data[self.m:] = 0.5 * boxsize # <<<<<<<<<<<<<<
*
* self.boxsize = np.array(boxsize, copy=True)
*/
__pyx_t_4 = PyNumber_Multiply(__pyx_mstate_global->__pyx_float_0_5, __pyx_v_boxsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->boxsize_data), __pyx_t_4, 0, 0, &__pyx_t_7, NULL, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":606
* self.boxsize_data[self.m:] = 0.5 * boxsize
*
* self.boxsize = np.array(boxsize, copy=True) # <<<<<<<<<<<<<<
* self.boxsize.flags.writeable = False
* periodic_mask = self.boxsize > 0
*/
__pyx_t_7 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_7);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_v_boxsize};
__pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_True, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 606, __pyx_L1_error)
__pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_v_self->boxsize);
__Pyx_DECREF(__pyx_v_self->boxsize);
__pyx_v_self->boxsize = __pyx_t_4;
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":607
*
* self.boxsize = np.array(boxsize, copy=True)
* self.boxsize.flags.writeable = False # <<<<<<<<<<<<<<
* periodic_mask = self.boxsize > 0
* if ((self.data >= self.boxsize[None, :])[:, periodic_mask]).any():
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->boxsize, __pyx_mstate_global->__pyx_n_u_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_writeable, Py_False) < (0)) __PYX_ERR(0, 607, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":608
* self.boxsize = np.array(boxsize, copy=True)
* self.boxsize.flags.writeable = False
* periodic_mask = self.boxsize > 0 # <<<<<<<<<<<<<<
* if ((self.data >= self.boxsize[None, :])[:, periodic_mask]).any():
* raise ValueError("Some input data are greater than the size of the periodic box.")
*/
__pyx_t_4 = PyObject_RichCompare(__pyx_v_self->boxsize, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error)
__pyx_v_periodic_mask = __pyx_t_4;
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":609
* self.boxsize.flags.writeable = False
* periodic_mask = self.boxsize > 0
* if ((self.data >= self.boxsize[None, :])[:, periodic_mask]).any(): # <<<<<<<<<<<<<<
* raise ValueError("Some input data are greater than the size of the periodic box.")
* if ((self.data < 0)[:, periodic_mask]).any():
*/
__pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_self->boxsize, __pyx_mstate_global->__pyx_tuple[2]); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_self->data), __pyx_t_10, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 609, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_periodic_mask);
__Pyx_GIVEREF(__pyx_v_periodic_mask);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_periodic_mask) != (0)) __PYX_ERR(0, 609, __pyx_L1_error);
__pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_5 = __pyx_t_8;
__Pyx_INCREF(__pyx_t_5);
__pyx_t_9 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_any, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(__pyx_t_2)) {
/* "scipy/spatial/_ckdtree.pyx":610
* periodic_mask = self.boxsize > 0
* if ((self.data >= self.boxsize[None, :])[:, periodic_mask]).any():
* raise ValueError("Some input data are greater than the size of the periodic box.") # <<<<<<<<<<<<<<
* if ((self.data < 0)[:, periodic_mask]).any():
* raise ValueError("Negative input data are outside of the periodic box.")
*/
__pyx_t_8 = NULL;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Some_input_data_are_greater_than};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __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_ERR(0, 610, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":609
* self.boxsize.flags.writeable = False
* periodic_mask = self.boxsize > 0
* if ((self.data >= self.boxsize[None, :])[:, periodic_mask]).any(): # <<<<<<<<<<<<<<
* raise ValueError("Some input data are greater than the size of the periodic box.")
* if ((self.data < 0)[:, periodic_mask]).any():
*/
}
/* "scipy/spatial/_ckdtree.pyx":611
* if ((self.data >= self.boxsize[None, :])[:, periodic_mask]).any():
* raise ValueError("Some input data are greater than the size of the periodic box.")
* if ((self.data < 0)[:, periodic_mask]).any(): # <<<<<<<<<<<<<<
* raise ValueError("Negative input data are outside of the periodic box.")
*
*/
__pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_self->data), __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error)
__pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 611, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_periodic_mask);
__Pyx_GIVEREF(__pyx_v_periodic_mask);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_periodic_mask) != (0)) __PYX_ERR(0, 611, __pyx_L1_error);
__pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_8 = __pyx_t_7;
__Pyx_INCREF(__pyx_t_8);
__pyx_t_9 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_any, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 611, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(__pyx_t_2)) {
/* "scipy/spatial/_ckdtree.pyx":612
* raise ValueError("Some input data are greater than the size of the periodic box.")
* if ((self.data < 0)[:, periodic_mask]).any():
* raise ValueError("Negative input data are outside of the periodic box.") # <<<<<<<<<<<<<<
*
* self.maxes = np.ascontiguousarray(
*/
__pyx_t_7 = NULL;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_Negative_input_data_are_outside};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __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_ERR(0, 612, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":611
* if ((self.data >= self.boxsize[None, :])[:, periodic_mask]).any():
* raise ValueError("Some input data are greater than the size of the periodic box.")
* if ((self.data < 0)[:, periodic_mask]).any(): # <<<<<<<<<<<<<<
* raise ValueError("Negative input data are outside of the periodic box.")
*
*/
}
}
__pyx_L7:;
/* "scipy/spatial/_ckdtree.pyx":614
* raise ValueError("Negative input data are outside of the periodic box.")
*
* self.maxes = np.ascontiguousarray( # <<<<<<<<<<<<<<
* np.amax(self.data, axis=0) if self.n > 0 else np.zeros(self.m),
* dtype=np.float64)
*/
__pyx_t_7 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 614, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 614, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "scipy/spatial/_ckdtree.pyx":615
*
* self.maxes = np.ascontiguousarray(
* np.amax(self.data, axis=0) if self.n > 0 else np.zeros(self.m), # <<<<<<<<<<<<<<
* dtype=np.float64)
* self.maxes.flags.writeable = False
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_2) {
__pyx_t_5 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_amax); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_13))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_13);
assert(__pyx_t_5);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, ((PyObject *)__pyx_v_self->data)};
__pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_0, __pyx_t_12, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 615, __pyx_L1_error)
__pyx_t_6 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_8 = __pyx_t_6;
__pyx_t_6 = 0;
} else {
__pyx_t_13 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_13);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
__pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_8 = __pyx_t_6;
__pyx_t_6 = 0;
}
/* "scipy/spatial/_ckdtree.pyx":616
* self.maxes = np.ascontiguousarray(
* np.amax(self.data, axis=0) if self.n > 0 else np.zeros(self.m),
* dtype=np.float64) # <<<<<<<<<<<<<<
* self.maxes.flags.writeable = False
* self.mins = np.ascontiguousarray(
*/
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
assert(__pyx_t_7);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_t_8};
__pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 614, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 614, __pyx_L1_error)
__pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
/* "scipy/spatial/_ckdtree.pyx":614
* raise ValueError("Negative input data are outside of the periodic box.")
*
* self.maxes = np.ascontiguousarray( # <<<<<<<<<<<<<<
* np.amax(self.data, axis=0) if self.n > 0 else np.zeros(self.m),
* dtype=np.float64)
*/
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 614, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF((PyObject *)__pyx_v_self->maxes);
__Pyx_DECREF((PyObject *)__pyx_v_self->maxes);
__pyx_v_self->maxes = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":617
* np.amax(self.data, axis=0) if self.n > 0 else np.zeros(self.m),
* dtype=np.float64)
* self.maxes.flags.writeable = False # <<<<<<<<<<<<<<
* self.mins = np.ascontiguousarray(
* np.amin(self.data,axis=0) if self.n > 0 else np.zeros(self.m),
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->maxes), __pyx_mstate_global->__pyx_n_u_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_writeable, Py_False) < (0)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":618
* dtype=np.float64)
* self.maxes.flags.writeable = False
* self.mins = np.ascontiguousarray( # <<<<<<<<<<<<<<
* np.amin(self.data,axis=0) if self.n > 0 else np.zeros(self.m),
* dtype=np.float64)
*/
__pyx_t_10 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "scipy/spatial/_ckdtree.pyx":619
* self.maxes.flags.writeable = False
* self.mins = np.ascontiguousarray(
* np.amin(self.data,axis=0) if self.n > 0 else np.zeros(self.m), # <<<<<<<<<<<<<<
* dtype=np.float64)
* self.mins.flags.writeable = False
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_2) {
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_amin); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_13))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_13);
assert(__pyx_t_8);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, ((PyObject *)__pyx_v_self->data)};
__pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_axis, __pyx_mstate_global->__pyx_int_0, __pyx_t_12, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 619, __pyx_L1_error)
__pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
}
__pyx_t_6 = __pyx_t_7;
__pyx_t_7 = 0;
} else {
__pyx_t_13 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
assert(__pyx_t_13);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
__pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
}
__pyx_t_6 = __pyx_t_7;
__pyx_t_7 = 0;
}
/* "scipy/spatial/_ckdtree.pyx":620
* self.mins = np.ascontiguousarray(
* np.amin(self.data,axis=0) if self.n > 0 else np.zeros(self.m),
* dtype=np.float64) # <<<<<<<<<<<<<<
* self.mins.flags.writeable = False
* self.indices = np.ascontiguousarray(np.arange(self.n,dtype=np.intp))
*/
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 620, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 620, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_10);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, __pyx_t_6};
__pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_7, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 618, __pyx_L1_error)
__pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
/* "scipy/spatial/_ckdtree.pyx":618
* dtype=np.float64)
* self.maxes.flags.writeable = False
* self.mins = np.ascontiguousarray( # <<<<<<<<<<<<<<
* np.amin(self.data,axis=0) if self.n > 0 else np.zeros(self.m),
* dtype=np.float64)
*/
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 618, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF((PyObject *)__pyx_v_self->mins);
__Pyx_DECREF((PyObject *)__pyx_v_self->mins);
__pyx_v_self->mins = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":621
* np.amin(self.data,axis=0) if self.n > 0 else np.zeros(self.m),
* dtype=np.float64)
* self.mins.flags.writeable = False # <<<<<<<<<<<<<<
* self.indices = np.ascontiguousarray(np.arange(self.n,dtype=np.intp))
* self.indices.flags.writeable = False
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->mins), __pyx_mstate_global->__pyx_n_u_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_writeable, Py_False) < (0)) __PYX_ERR(0, 621, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":622
* dtype=np.float64)
* self.mins.flags.writeable = False
* self.indices = np.ascontiguousarray(np.arange(self.n,dtype=np.intp)) # <<<<<<<<<<<<<<
* self.indices.flags.writeable = False
*
*/
__pyx_t_5 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_12))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
assert(__pyx_t_6);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_10};
__pyx_t_13 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_14, __pyx_t_13, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 622, __pyx_L1_error)
__pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_13);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
}
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
assert(__pyx_t_5);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF((PyObject *)__pyx_v_self->indices);
__Pyx_DECREF((PyObject *)__pyx_v_self->indices);
__pyx_v_self->indices = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":623
* self.mins.flags.writeable = False
* self.indices = np.ascontiguousarray(np.arange(self.n,dtype=np.intp))
* self.indices.flags.writeable = False # <<<<<<<<<<<<<<
*
* self._pre_init()
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->indices), __pyx_mstate_global->__pyx_n_u_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_writeable, Py_False) < (0)) __PYX_ERR(0, 623, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":625
* self.indices.flags.writeable = False
*
* self._pre_init() # <<<<<<<<<<<<<<
*
* compact = 1 if compact_nodes else 0
*/
__pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->_pre_init(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":627
* self._pre_init()
*
* compact = 1 if compact_nodes else 0 # <<<<<<<<<<<<<<
* median = 1 if balanced_tree else 0
*
*/
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compact_nodes); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 627, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_t_15 = 1;
} else {
__pyx_t_15 = 0;
}
__pyx_v_compact = __pyx_t_15;
/* "scipy/spatial/_ckdtree.pyx":628
*
* compact = 1 if compact_nodes else 0
* median = 1 if balanced_tree else 0 # <<<<<<<<<<<<<<
*
* cself.tree_buffer = new vector[ckdtreenode]()
*/
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_balanced_tree); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 628, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_t_15 = 1;
} else {
__pyx_t_15 = 0;
}
__pyx_v_median = __pyx_t_15;
/* "scipy/spatial/_ckdtree.pyx":630
* median = 1 if balanced_tree else 0
*
* cself.tree_buffer = new vector[ckdtreenode]() # <<<<<<<<<<<<<<
*
* tmpmaxes = np.copy(self.maxes)
*/
try {
__pyx_t_16 = new std::vector<struct ckdtreenode> ();
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(0, 630, __pyx_L1_error)
}
__pyx_v_cself->tree_buffer = __pyx_t_16;
/* "scipy/spatial/_ckdtree.pyx":632
* cself.tree_buffer = new vector[ckdtreenode]()
*
* tmpmaxes = np.copy(self.maxes) # <<<<<<<<<<<<<<
* tmpmins = np.copy(self.mins)
*
*/
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_8);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_8, ((PyObject *)__pyx_v_self->maxes)};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_tmpmaxes = __pyx_t_17;
__pyx_t_17.memview = NULL;
__pyx_t_17.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":633
*
* tmpmaxes = np.copy(self.maxes)
* tmpmins = np.copy(self.mins) # <<<<<<<<<<<<<<
*
* ptmpmaxes = &tmpmaxes[0]
*/
__pyx_t_5 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
assert(__pyx_t_5);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
__pyx_t_9 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->mins)};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 633, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_tmpmins = __pyx_t_17;
__pyx_t_17.memview = NULL;
__pyx_t_17.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":635
* tmpmins = np.copy(self.mins)
*
* ptmpmaxes = &tmpmaxes[0] # <<<<<<<<<<<<<<
* ptmpmins = &tmpmins[0]
* with nogil:
*/
__pyx_t_18 = 0;
__pyx_t_15 = -1;
if (__pyx_t_18 < 0) {
__pyx_t_18 += __pyx_v_tmpmaxes.shape[0];
if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0;
} else if (unlikely(__pyx_t_18 >= __pyx_v_tmpmaxes.shape[0])) __pyx_t_15 = 0;
if (unlikely(__pyx_t_15 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_15);
__PYX_ERR(0, 635, __pyx_L1_error)
}
__pyx_v_ptmpmaxes = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_tmpmaxes.data) + __pyx_t_18)) ))));
/* "scipy/spatial/_ckdtree.pyx":636
*
* ptmpmaxes = &tmpmaxes[0]
* ptmpmins = &tmpmins[0] # <<<<<<<<<<<<<<
* with nogil:
* build_ckdtree(cself, 0, cself.n, ptmpmaxes, ptmpmins, median, compact)
*/
__pyx_t_18 = 0;
__pyx_t_15 = -1;
if (__pyx_t_18 < 0) {
__pyx_t_18 += __pyx_v_tmpmins.shape[0];
if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0;
} else if (unlikely(__pyx_t_18 >= __pyx_v_tmpmins.shape[0])) __pyx_t_15 = 0;
if (unlikely(__pyx_t_15 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_15);
__PYX_ERR(0, 636, __pyx_L1_error)
}
__pyx_v_ptmpmins = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_tmpmins.data) + __pyx_t_18)) ))));
/* "scipy/spatial/_ckdtree.pyx":637
* ptmpmaxes = &tmpmaxes[0]
* ptmpmins = &tmpmins[0]
* with nogil: # <<<<<<<<<<<<<<
* build_ckdtree(cself, 0, cself.n, ptmpmaxes, ptmpmins, median, compact)
*
*/
{
PyThreadState * _save;
_save = PyEval_SaveThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
/* "scipy/spatial/_ckdtree.pyx":638
* ptmpmins = &tmpmins[0]
* with nogil:
* build_ckdtree(cself, 0, cself.n, ptmpmaxes, ptmpmins, median, compact) # <<<<<<<<<<<<<<
*
* # set up the tree structure pointers
*/
try {
build_ckdtree(__pyx_v_cself, 0, __pyx_v_cself->n, __pyx_v_ptmpmaxes, __pyx_v_ptmpmins, __pyx_v_median, __pyx_v_compact);
} catch(...) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_CppExn2PyErr();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__PYX_ERR(0, 638, __pyx_L11_error)
}
}
/* "scipy/spatial/_ckdtree.pyx":637
* ptmpmaxes = &tmpmaxes[0]
* ptmpmins = &tmpmins[0]
* with nogil: # <<<<<<<<<<<<<<
* build_ckdtree(cself, 0, cself.n, ptmpmaxes, ptmpmins, median, compact)
*
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L12;
}
__pyx_L11_error: {
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L1_error;
}
__pyx_L12:;
}
}
/* "scipy/spatial/_ckdtree.pyx":641
*
* # set up the tree structure pointers
* self._post_init() # <<<<<<<<<<<<<<
*
* cdef _pre_init(cKDTree self):
*/
__pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->_post_init(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "scipy/spatial/_ckdtree.pyx":560
* self.cself.tree_buffer = NULL
*
* def __init__(cKDTree self, data, np.intp_t leafsize=16, compact_nodes=True, # <<<<<<<<<<<<<<
* copy_data=False, balanced_tree=True, boxsize=None):
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_14);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__PYX_XCLEAR_MEMVIEW(&__pyx_v_tmpmaxes, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_v_tmpmins, 1);
__Pyx_XDECREF(__pyx_v_periodic_mask);
__Pyx_XDECREF(__pyx_v_data);
__Pyx_XDECREF(__pyx_v_copy_data);
__Pyx_XDECREF(__pyx_v_boxsize);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":643
* self._post_init()
*
* cdef _pre_init(cKDTree self): # <<<<<<<<<<<<<<
* cself = self.cself
*
*/
static PyObject *__pyx_f_5scipy_7spatial_8_ckdtree_7cKDTree__pre_init(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
struct ckdtree *__pyx_v_cself;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct ckdtree *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
__Pyx_RefNannySetupContext("_pre_init", 0);
/* "scipy/spatial/_ckdtree.pyx":644
*
* cdef _pre_init(cKDTree self):
* cself = self.cself # <<<<<<<<<<<<<<
*
* # finalize the pointers from array attributes
*/
__pyx_t_1 = __pyx_v_self->cself;
__pyx_v_cself = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":648
* # finalize the pointers from array attributes
*
* cself.raw_data = <np.float64_t*> np.PyArray_DATA(self.data) # <<<<<<<<<<<<<<
* cself.raw_maxes = <np.float64_t*> np.PyArray_DATA(self.maxes)
* cself.raw_mins = <np.float64_t*> np.PyArray_DATA(self.mins)
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->data);
__Pyx_INCREF(__pyx_t_2);
__pyx_v_cself->raw_data = ((__pyx_t_5numpy_float64_t *)PyArray_DATA(((PyArrayObject *)__pyx_t_2)));
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":649
*
* cself.raw_data = <np.float64_t*> np.PyArray_DATA(self.data)
* cself.raw_maxes = <np.float64_t*> np.PyArray_DATA(self.maxes) # <<<<<<<<<<<<<<
* cself.raw_mins = <np.float64_t*> np.PyArray_DATA(self.mins)
* cself.raw_indices = <np.intp_t*> np.PyArray_DATA(self.indices)
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->maxes);
__Pyx_INCREF(__pyx_t_2);
__pyx_v_cself->raw_maxes = ((__pyx_t_5numpy_float64_t *)PyArray_DATA(((PyArrayObject *)__pyx_t_2)));
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":650
* cself.raw_data = <np.float64_t*> np.PyArray_DATA(self.data)
* cself.raw_maxes = <np.float64_t*> np.PyArray_DATA(self.maxes)
* cself.raw_mins = <np.float64_t*> np.PyArray_DATA(self.mins) # <<<<<<<<<<<<<<
* cself.raw_indices = <np.intp_t*> np.PyArray_DATA(self.indices)
*
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->mins);
__Pyx_INCREF(__pyx_t_2);
__pyx_v_cself->raw_mins = ((__pyx_t_5numpy_float64_t *)PyArray_DATA(((PyArrayObject *)__pyx_t_2)));
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":651
* cself.raw_maxes = <np.float64_t*> np.PyArray_DATA(self.maxes)
* cself.raw_mins = <np.float64_t*> np.PyArray_DATA(self.mins)
* cself.raw_indices = <np.intp_t*> np.PyArray_DATA(self.indices) # <<<<<<<<<<<<<<
*
* if self.boxsize_data is not None:
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->indices);
__Pyx_INCREF(__pyx_t_2);
__pyx_v_cself->raw_indices = ((__pyx_t_5numpy_intp_t *)PyArray_DATA(((PyArrayObject *)__pyx_t_2)));
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":653
* cself.raw_indices = <np.intp_t*> np.PyArray_DATA(self.indices)
*
* if self.boxsize_data is not None: # <<<<<<<<<<<<<<
* cself.raw_boxsize_data = <np.float64_t*>np.PyArray_DATA(self.boxsize_data)
* else:
*/
__pyx_t_3 = (((PyObject *)__pyx_v_self->boxsize_data) != Py_None);
if (__pyx_t_3) {
/* "scipy/spatial/_ckdtree.pyx":654
*
* if self.boxsize_data is not None:
* cself.raw_boxsize_data = <np.float64_t*>np.PyArray_DATA(self.boxsize_data) # <<<<<<<<<<<<<<
* else:
* cself.raw_boxsize_data = NULL
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->boxsize_data);
__Pyx_INCREF(__pyx_t_2);
__pyx_v_cself->raw_boxsize_data = ((__pyx_t_5numpy_float64_t *)PyArray_DATA(((PyArrayObject *)__pyx_t_2)));
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":653
* cself.raw_indices = <np.intp_t*> np.PyArray_DATA(self.indices)
*
* if self.boxsize_data is not None: # <<<<<<<<<<<<<<
* cself.raw_boxsize_data = <np.float64_t*>np.PyArray_DATA(self.boxsize_data)
* else:
*/
goto __pyx_L3;
}
/* "scipy/spatial/_ckdtree.pyx":656
* cself.raw_boxsize_data = <np.float64_t*>np.PyArray_DATA(self.boxsize_data)
* else:
* cself.raw_boxsize_data = NULL # <<<<<<<<<<<<<<
*
* cdef _post_init(cKDTree self):
*/
/*else*/ {
__pyx_v_cself->raw_boxsize_data = NULL;
}
__pyx_L3:;
/* "scipy/spatial/_ckdtree.pyx":643
* self._post_init()
*
* cdef _pre_init(cKDTree self): # <<<<<<<<<<<<<<
* cself = self.cself
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":658
* cself.raw_boxsize_data = NULL
*
* cdef _post_init(cKDTree self): # <<<<<<<<<<<<<<
* cself = self.cself
* # finalize the tree points, this calls _post_init_traverse
*/
static PyObject *__pyx_f_5scipy_7spatial_8_ckdtree_7cKDTree__post_init(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
struct ckdtree *__pyx_v_cself;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct ckdtree *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_post_init", 0);
/* "scipy/spatial/_ckdtree.pyx":659
*
* cdef _post_init(cKDTree self):
* cself = self.cself # <<<<<<<<<<<<<<
* # finalize the tree points, this calls _post_init_traverse
*
*/
__pyx_t_1 = __pyx_v_self->cself;
__pyx_v_cself = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":662
* # finalize the tree points, this calls _post_init_traverse
*
* cself.ctree = cself.tree_buffer.data() # <<<<<<<<<<<<<<
*
* # set the size attribute after tree_buffer is built
*/
__pyx_v_cself->ctree = __pyx_v_cself->tree_buffer->data();
/* "scipy/spatial/_ckdtree.pyx":665
*
* # set the size attribute after tree_buffer is built
* cself.size = cself.tree_buffer.size() # <<<<<<<<<<<<<<
*
* self._post_init_traverse(cself.ctree)
*/
__pyx_v_cself->size = __pyx_v_cself->tree_buffer->size();
/* "scipy/spatial/_ckdtree.pyx":667
* cself.size = cself.tree_buffer.size()
*
* self._post_init_traverse(cself.ctree) # <<<<<<<<<<<<<<
*
* cdef _post_init_traverse(cKDTree self, ckdtreenode *node):
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->_post_init_traverse(__pyx_v_self, __pyx_v_cself->ctree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":658
* cself.raw_boxsize_data = NULL
*
* cdef _post_init(cKDTree self): # <<<<<<<<<<<<<<
* cself = self.cself
* # finalize the tree points, this calls _post_init_traverse
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree._post_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":669
* self._post_init_traverse(cself.ctree)
*
* cdef _post_init_traverse(cKDTree self, ckdtreenode *node): # <<<<<<<<<<<<<<
* cself = self.cself
* # recurse the tree and re-initialize
*/
static PyObject *__pyx_f_5scipy_7spatial_8_ckdtree_7cKDTree__post_init_traverse(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, struct ckdtreenode *__pyx_v_node) {
struct ckdtree *__pyx_v_cself;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct ckdtree *__pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_post_init_traverse", 0);
/* "scipy/spatial/_ckdtree.pyx":670
*
* cdef _post_init_traverse(cKDTree self, ckdtreenode *node):
* cself = self.cself # <<<<<<<<<<<<<<
* # recurse the tree and re-initialize
* # "less" and "greater" fields
*/
__pyx_t_1 = __pyx_v_self->cself;
__pyx_v_cself = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":673
* # recurse the tree and re-initialize
* # "less" and "greater" fields
* if node.split_dim == -1: # <<<<<<<<<<<<<<
* # leafnode
* node.less = NULL
*/
__pyx_t_2 = (__pyx_v_node->split_dim == -1L);
if (__pyx_t_2) {
/* "scipy/spatial/_ckdtree.pyx":675
* if node.split_dim == -1:
* # leafnode
* node.less = NULL # <<<<<<<<<<<<<<
* node.greater = NULL
* else:
*/
__pyx_v_node->less = NULL;
/* "scipy/spatial/_ckdtree.pyx":676
* # leafnode
* node.less = NULL
* node.greater = NULL # <<<<<<<<<<<<<<
* else:
* node.less = cself.ctree + node._less
*/
__pyx_v_node->greater = NULL;
/* "scipy/spatial/_ckdtree.pyx":673
* # recurse the tree and re-initialize
* # "less" and "greater" fields
* if node.split_dim == -1: # <<<<<<<<<<<<<<
* # leafnode
* node.less = NULL
*/
goto __pyx_L3;
}
/* "scipy/spatial/_ckdtree.pyx":678
* node.greater = NULL
* else:
* node.less = cself.ctree + node._less # <<<<<<<<<<<<<<
* node.greater = cself.ctree + node._greater
* self._post_init_traverse(node.less)
*/
/*else*/ {
__pyx_v_node->less = (__pyx_v_cself->ctree + __pyx_v_node->_less);
/* "scipy/spatial/_ckdtree.pyx":679
* else:
* node.less = cself.ctree + node._less
* node.greater = cself.ctree + node._greater # <<<<<<<<<<<<<<
* self._post_init_traverse(node.less)
* self._post_init_traverse(node.greater)
*/
__pyx_v_node->greater = (__pyx_v_cself->ctree + __pyx_v_node->_greater);
/* "scipy/spatial/_ckdtree.pyx":680
* node.less = cself.ctree + node._less
* node.greater = cself.ctree + node._greater
* self._post_init_traverse(node.less) # <<<<<<<<<<<<<<
* self._post_init_traverse(node.greater)
*
*/
__pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->_post_init_traverse(__pyx_v_self, __pyx_v_node->less); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":681
* node.greater = cself.ctree + node._greater
* self._post_init_traverse(node.less)
* self._post_init_traverse(node.greater) # <<<<<<<<<<<<<<
*
* def __dealloc__(cKDTree self):
*/
__pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->_post_init_traverse(__pyx_v_self, __pyx_v_node->greater); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
/* "scipy/spatial/_ckdtree.pyx":669
* self._post_init_traverse(cself.ctree)
*
* cdef _post_init_traverse(cKDTree self, ckdtreenode *node): # <<<<<<<<<<<<<<
* cself = self.cself
* # recurse the tree and re-initialize
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree._post_init_traverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":683
* self._post_init_traverse(node.greater)
*
* def __dealloc__(cKDTree self): # <<<<<<<<<<<<<<
* cself = self.cself
* if cself.tree_buffer != NULL:
*/
/* Python wrapper */
static void __pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_5__dealloc__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4__dealloc__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4__dealloc__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
struct ckdtree *__pyx_v_cself;
struct ckdtree *__pyx_t_1;
int __pyx_t_2;
/* "scipy/spatial/_ckdtree.pyx":684
*
* def __dealloc__(cKDTree self):
* cself = self.cself # <<<<<<<<<<<<<<
* if cself.tree_buffer != NULL:
* del cself.tree_buffer
*/
__pyx_t_1 = __pyx_v_self->cself;
__pyx_v_cself = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":685
* def __dealloc__(cKDTree self):
* cself = self.cself
* if cself.tree_buffer != NULL: # <<<<<<<<<<<<<<
* del cself.tree_buffer
* PyMem_Free(cself)
*/
__pyx_t_2 = (__pyx_v_cself->tree_buffer != NULL);
if (__pyx_t_2) {
/* "scipy/spatial/_ckdtree.pyx":686
* cself = self.cself
* if cself.tree_buffer != NULL:
* del cself.tree_buffer # <<<<<<<<<<<<<<
* PyMem_Free(cself)
*
*/
delete __pyx_v_cself->tree_buffer;
/* "scipy/spatial/_ckdtree.pyx":685
* def __dealloc__(cKDTree self):
* cself = self.cself
* if cself.tree_buffer != NULL: # <<<<<<<<<<<<<<
* del cself.tree_buffer
* PyMem_Free(cself)
*/
}
/* "scipy/spatial/_ckdtree.pyx":687
* if cself.tree_buffer != NULL:
* del cself.tree_buffer
* PyMem_Free(cself) # <<<<<<<<<<<<<<
*
* # -----
*/
PyMem_Free(__pyx_v_cself);
/* "scipy/spatial/_ckdtree.pyx":683
* self._post_init_traverse(node.greater)
*
* def __dealloc__(cKDTree self): # <<<<<<<<<<<<<<
* cself = self.cself
* if cself.tree_buffer != NULL:
*/
/* function exit code */
}
/* "scipy/spatial/_ckdtree.pyx":693
* # -----
*
* @cython.boundscheck(False) # <<<<<<<<<<<<<<
* def query(cKDTree self, object x, object k=1, np.float64_t eps=0.0,
* np.float64_t p=2.0, np.float64_t distance_upper_bound=INFINITY,
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_7query(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_6query, "\n query(self, x, k=1, eps=0.0, p=2.0, distance_upper_bound=np.inf, workers=1)\n\n Query the kd-tree for nearest neighbors\n\n Parameters\n ----------\n x : array_like, last dimension self.m\n An array of points to query.\n k : list of integer or integer\n The list of k-th nearest neighbors to return. If k is an\n integer it is treated as a list of [1, ... k] (range(1, k+1)).\n Note that the counting starts from 1.\n eps : non-negative float\n Return approximate nearest neighbors; the k-th returned value\n is guaranteed to be no further than (1+eps) times the\n distance to the real k-th nearest neighbor.\n p : float, 1<=p<=infinity\n Which Minkowski p-norm to use.\n 1 is the sum-of-absolute-values \"Manhattan\" distance\n 2 is the usual Euclidean distance\n infinity is the maximum-coordinate-difference distance\n A finite large p may cause a ValueError if overflow can occur.\n distance_upper_bound : nonnegative float\n Return only neighbors within this distance. This is used to prune\n tree searches, so if you are doing a series of nearest-neighbor\n queries, it may help to supply the distance to the nearest neighbor\n of the most recent point.\n workers : int, optional\n Number of workers to use for parallel processing. If -1 is given\n all CPU threads are used. Default: 1.\n\n .. versionchanged:: 1.9.0\n The \"n_jobs\" argument was renamed \"workers\". The old name\n \"n_jobs\" was deprecated in SciPy 1.6.0 and was removed in\n SciPy 1.9.0.\n\n Returns\n -------\n d : array of floats\n The distances to the nearest neighbors.\n If ``x`` has shape ``tuple+(self.m,)``, then ``d`` has shape ``tuple+(k,)``.""\n When k == 1, the last dimension of the output is squeezed.\n Missing neighbors are indicated with infinite distances.\n i : ndarray of ints\n The index of each neighbor in ``self.data``.\n If ``x`` has shape ``tuple+(self.m,)``, then ``i`` has shape ``tuple+(k,)``.\n When k == 1, the last dimension of the output is squeezed.\n Missing neighbors are indicated with ``self.n``.\n\n Notes\n -----\n If the KD-Tree is periodic, the position ``x`` is wrapped into the\n box.\n\n When the input k is a list, a query for arange(max(k)) is performed, but\n only columns that store the requested values of k are preserved. This is\n implemented in a manner that reduces memory usage.\n\n Examples\n --------\n\n >>> import numpy as np\n >>> from scipy.spatial import cKDTree\n >>> x, y = np.mgrid[0:5, 2:8]\n >>> tree = cKDTree(np.c_[x.ravel(), y.ravel()])\n\n To query the nearest neighbours and return squeezed result, use\n\n >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=1)\n >>> print(dd, ii, sep='\\n')\n [2. 0.2236068]\n [ 0 13]\n\n To query the nearest neighbours and return unsqueezed result, use\n\n >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=[1])\n >>> print(dd, ii, sep='\\n')\n [[2. ]\n [0.2236068]]\n [[ 0]\n [13]]\n\n To query the second nearest neighbours and return unsqueezed result,\n use\n\n >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=[2])\n >>> print(dd, ii, sep='\\n')\n [[2.23606798]\n [0.80622577]]\n [[ 6]\n [19]]\n\n To query the first and second nearest neighbours, use\n\n >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=2)\n >>> print(dd, ii, sep='\\n')\n [[2. 2.23606798]\n [0.2236068 0.8062257""7]]\n [[ 0 6]\n [13 19]]\n\n or, be more specific\n\n >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=[1, 2])\n >>> print(dd, ii, sep='\\n')\n [[2. 2.23606798]\n [0.2236068 0.80622577]]\n [[ 0 6]\n [13 19]]\n\n ");
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_7query = {"query", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_7query, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_6query};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_7query(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_k = 0;
__pyx_t_5numpy_float64_t __pyx_v_eps;
__pyx_t_5numpy_float64_t __pyx_v_p;
__pyx_t_5numpy_float64_t __pyx_v_distance_upper_bound;
PyObject *__pyx_v_workers = 0;
PyObject *__pyx_v_kwargs = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[6] = {0,0,0,0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("query (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_eps,&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_distance_upper_bound,&__pyx_mstate_global->__pyx_n_u_workers,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 693, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 6:
values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 5:
values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "query", 1) < (0)) __PYX_ERR(0, 693, __pyx_L3_error)
if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
/* "scipy/spatial/_ckdtree.pyx":696
* def query(cKDTree self, object x, object k=1, np.float64_t eps=0.0,
* np.float64_t p=2.0, np.float64_t distance_upper_bound=INFINITY,
* object workers=None, **kwargs): # <<<<<<<<<<<<<<
* r"""
* query(self, x, k=1, eps=0.0, p=2.0, distance_upper_bound=np.inf, workers=1)
*/
if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("query", 0, 1, 6, i); __PYX_ERR(0, 693, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 6:
values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 5:
values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 693, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 693, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
}
__pyx_v_x = values[0];
__pyx_v_k = values[1];
if (values[2]) {
__pyx_v_eps = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 694, __pyx_L3_error)
} else {
__pyx_v_eps = ((__pyx_t_5numpy_float64_t)0.0);
}
if (values[3]) {
__pyx_v_p = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_p == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 695, __pyx_L3_error)
} else {
__pyx_v_p = ((__pyx_t_5numpy_float64_t)2.0);
}
if (values[4]) {
__pyx_v_distance_upper_bound = __Pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_distance_upper_bound == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 695, __pyx_L3_error)
} else {
__pyx_v_distance_upper_bound = __pyx_mstate_global->__pyx_k__3;
}
__pyx_v_workers = values[5];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("query", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 693, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_6query(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v_x, __pyx_v_k, __pyx_v_eps, __pyx_v_p, __pyx_v_distance_upper_bound, __pyx_v_workers, __pyx_v_kwargs);
/* "scipy/spatial/_ckdtree.pyx":693
* # -----
*
* @cython.boundscheck(False) # <<<<<<<<<<<<<<
* def query(cKDTree self, object x, object k=1, np.float64_t eps=0.0,
* np.float64_t p=2.0, np.float64_t distance_upper_bound=INFINITY,
*/
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_DECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":847
*
* # Do the query in an external C++ function.
* def _thread_func(np.intp_t start, np.intp_t stop): # <<<<<<<<<<<<<<
* cdef:
* np.float64_t *pdd = &dd[start,0]
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_5query_1_thread_func(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_5query_1_thread_func = {"_thread_func", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_5query_1_thread_func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_5query_1_thread_func(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
__pyx_t_5numpy_intp_t __pyx_v_start;
__pyx_t_5numpy_intp_t __pyx_v_stop;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[2] = {0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_thread_func (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_start,&__pyx_mstate_global->__pyx_n_u_stop,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 847, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 847, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 847, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_thread_func", 0) < (0)) __PYX_ERR(0, 847, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_thread_func", 1, 2, 2, i); __PYX_ERR(0, 847, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 2)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 847, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 847, __pyx_L3_error)
}
__pyx_v_start = __Pyx_PyLong_As_npy_intp(values[0]); if (unlikely((__pyx_v_start == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 847, __pyx_L3_error)
__pyx_v_stop = __Pyx_PyLong_As_npy_intp(values[1]); if (unlikely((__pyx_v_stop == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 847, __pyx_L3_error)
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_thread_func", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 847, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query._thread_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_5query__thread_func(__pyx_self, __pyx_v_start, __pyx_v_stop);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_5query__thread_func(PyObject *__pyx_self, __pyx_t_5numpy_intp_t __pyx_v_start, __pyx_t_5numpy_intp_t __pyx_v_stop) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query *__pyx_cur_scope;
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query *__pyx_outer_scope;
__pyx_t_5numpy_float64_t *__pyx_v_pdd;
__pyx_t_5numpy_intp_t *__pyx_v_pii;
__pyx_t_5numpy_float64_t const *__pyx_v_pxx;
__pyx_t_5numpy_intp_t *__pyx_v_pkk;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_thread_func", 0);
__pyx_outer_scope = (struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
/* "scipy/spatial/_ckdtree.pyx":849
* def _thread_func(np.intp_t start, np.intp_t stop):
* cdef:
* np.float64_t *pdd = &dd[start,0] # <<<<<<<<<<<<<<
* np.intp_t *pii = &ii[start,0]
* const np.float64_t *pxx = &xx[start,0]
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_dd.memview)) { __Pyx_RaiseClosureNameError("dd"); __PYX_ERR(0, 849, __pyx_L1_error) }
__pyx_t_1 = __pyx_v_start;
__pyx_t_2 = 0;
if (__pyx_t_1 < 0) __pyx_t_1 += __pyx_cur_scope->__pyx_v_dd.shape[0];
if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_cur_scope->__pyx_v_dd.shape[1];
__pyx_v_pdd = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_dd.data + __pyx_t_1 * __pyx_cur_scope->__pyx_v_dd.strides[0]) )) + __pyx_t_2)) ))));
/* "scipy/spatial/_ckdtree.pyx":850
* cdef:
* np.float64_t *pdd = &dd[start,0]
* np.intp_t *pii = &ii[start,0] # <<<<<<<<<<<<<<
* const np.float64_t *pxx = &xx[start,0]
* np.intp_t *pkk = &kk[0]
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_ii.memview)) { __Pyx_RaiseClosureNameError("ii"); __PYX_ERR(0, 850, __pyx_L1_error) }
__pyx_t_2 = __pyx_v_start;
__pyx_t_1 = 0;
if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_cur_scope->__pyx_v_ii.shape[0];
if (__pyx_t_1 < 0) __pyx_t_1 += __pyx_cur_scope->__pyx_v_ii.shape[1];
__pyx_v_pii = (&(*((__pyx_t_5numpy_intp_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_ii.data + __pyx_t_2 * __pyx_cur_scope->__pyx_v_ii.strides[0]) )) + __pyx_t_1)) ))));
/* "scipy/spatial/_ckdtree.pyx":851
* np.float64_t *pdd = &dd[start,0]
* np.intp_t *pii = &ii[start,0]
* const np.float64_t *pxx = &xx[start,0] # <<<<<<<<<<<<<<
* np.intp_t *pkk = &kk[0]
* with nogil:
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_xx.memview)) { __Pyx_RaiseClosureNameError("xx"); __PYX_ERR(0, 851, __pyx_L1_error) }
__pyx_t_1 = __pyx_v_start;
__pyx_t_2 = 0;
if (__pyx_t_1 < 0) __pyx_t_1 += __pyx_cur_scope->__pyx_v_xx.shape[0];
if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_cur_scope->__pyx_v_xx.shape[1];
__pyx_v_pxx = (&(*((__pyx_t_5numpy_float64_t const *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_xx.data + __pyx_t_1 * __pyx_cur_scope->__pyx_v_xx.strides[0]) )) + __pyx_t_2)) ))));
/* "scipy/spatial/_ckdtree.pyx":852
* np.intp_t *pii = &ii[start,0]
* const np.float64_t *pxx = &xx[start,0]
* np.intp_t *pkk = &kk[0] # <<<<<<<<<<<<<<
* with nogil:
* query_knn(cself, pdd, pii,
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_kk.memview)) { __Pyx_RaiseClosureNameError("kk"); __PYX_ERR(0, 852, __pyx_L1_error) }
__pyx_t_2 = 0;
if (__pyx_t_2 < 0) __pyx_t_2 += __pyx_cur_scope->__pyx_v_kk.shape[0];
__pyx_v_pkk = (&(*((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_cur_scope->__pyx_v_kk.data) + __pyx_t_2)) ))));
/* "scipy/spatial/_ckdtree.pyx":853
* const np.float64_t *pxx = &xx[start,0]
* np.intp_t *pkk = &kk[0]
* with nogil: # <<<<<<<<<<<<<<
* query_knn(cself, pdd, pii,
* pxx, stop-start, pkk, kk.shape[0], kmax, eps, p, distance_upper_bound)
*/
{
PyThreadState * _save;
_save = PyEval_SaveThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
/* "scipy/spatial/_ckdtree.pyx":855
* with nogil:
* query_knn(cself, pdd, pii,
* pxx, stop-start, pkk, kk.shape[0], kmax, eps, p, distance_upper_bound) # <<<<<<<<<<<<<<
*
* _run_threads(_thread_func, n, num_workers)
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_kk.memview)) { __Pyx_RaiseClosureNameErrorNogil("kk"); __PYX_ERR(0, 855, __pyx_L4_error) }
/* "scipy/spatial/_ckdtree.pyx":854
* np.intp_t *pkk = &kk[0]
* with nogil:
* query_knn(cself, pdd, pii, # <<<<<<<<<<<<<<
* pxx, stop-start, pkk, kk.shape[0], kmax, eps, p, distance_upper_bound)
*
*/
try {
query_knn(__pyx_cur_scope->__pyx_v_cself, __pyx_v_pdd, __pyx_v_pii, __pyx_v_pxx, (__pyx_v_stop - __pyx_v_start), __pyx_v_pkk, (__pyx_cur_scope->__pyx_v_kk.shape[0]), __pyx_cur_scope->__pyx_v_kmax, __pyx_cur_scope->__pyx_v_eps, __pyx_cur_scope->__pyx_v_p, __pyx_cur_scope->__pyx_v_distance_upper_bound);
} catch(...) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_CppExn2PyErr();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__PYX_ERR(0, 854, __pyx_L4_error)
}
}
/* "scipy/spatial/_ckdtree.pyx":853
* const np.float64_t *pxx = &xx[start,0]
* np.intp_t *pkk = &kk[0]
* with nogil: # <<<<<<<<<<<<<<
* query_knn(cself, pdd, pii,
* pxx, stop-start, pkk, kk.shape[0], kmax, eps, p, distance_upper_bound)
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L5;
}
__pyx_L4_error: {
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L1_error;
}
__pyx_L5:;
}
}
/* "scipy/spatial/_ckdtree.pyx":847
*
* # Do the query in an external C++ function.
* def _thread_func(np.intp_t start, np.intp_t stop): # <<<<<<<<<<<<<<
* cdef:
* np.float64_t *pdd = &dd[start,0]
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query._thread_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":693
* # -----
*
* @cython.boundscheck(False) # <<<<<<<<<<<<<<
* def query(cKDTree self, object x, object k=1, np.float64_t eps=0.0,
* np.float64_t p=2.0, np.float64_t distance_upper_bound=INFINITY,
*/
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_6query(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_k, __pyx_t_5numpy_float64_t __pyx_v_eps, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_distance_upper_bound, PyObject *__pyx_v_workers, PyObject *__pyx_v_kwargs) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query *__pyx_cur_scope;
__pyx_t_5numpy_intp_t __pyx_v_n;
PyArrayObject *__pyx_v_x_arr = 0;
__pyx_t_5numpy_intp_t __pyx_v_num_workers;
bool __pyx_v_single;
bool __pyx_v_nearest;
PyObject *__pyx_v_retshape = NULL;
PyObject *__pyx_v__thread_func = 0;
PyObject *__pyx_v_ddret = NULL;
PyObject *__pyx_v_iiret = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
size_t __pyx_t_6;
struct ckdtree *__pyx_t_7;
__pyx_t_5numpy_intp_t __pyx_t_8;
__Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
int __pyx_t_12;
Py_ssize_t __pyx_t_13;
__Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("query", 0);
__pyx_cur_scope = (struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query *)__pyx_tp_new_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query(__pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query, __pyx_mstate_global->__pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_1_query *)Py_None);
__Pyx_INCREF(Py_None);
__PYX_ERR(0, 693, __pyx_L1_error)
} else {
__Pyx_GOTREF((PyObject *)__pyx_cur_scope);
}
__pyx_cur_scope->__pyx_v_eps = __pyx_v_eps;
__pyx_cur_scope->__pyx_v_p = __pyx_v_p;
__pyx_cur_scope->__pyx_v_distance_upper_bound = __pyx_v_distance_upper_bound;
__Pyx_INCREF(__pyx_v_k);
/* "scipy/spatial/_ckdtree.pyx":813
* np.intp_t n
* const np.float64_t [:, ::1] xx
* np.ndarray x_arr = np.ascontiguousarray(x, dtype=np.float64) # <<<<<<<<<<<<<<
* ckdtree *cself = self.cself
* np.intp_t num_workers = get_num_workers(workers, kwargs)
*/
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 813, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 813, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
assert(__pyx_t_2);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_x};
__pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_3, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 813, __pyx_L1_error)
__pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 813, __pyx_L1_error)
__pyx_v_x_arr = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":814
* const np.float64_t [:, ::1] xx
* np.ndarray x_arr = np.ascontiguousarray(x, dtype=np.float64)
* ckdtree *cself = self.cself # <<<<<<<<<<<<<<
* np.intp_t num_workers = get_num_workers(workers, kwargs)
*
*/
__pyx_t_7 = __pyx_v_self->cself;
__pyx_cur_scope->__pyx_v_cself = __pyx_t_7;
/* "scipy/spatial/_ckdtree.pyx":815
* np.ndarray x_arr = np.ascontiguousarray(x, dtype=np.float64)
* ckdtree *cself = self.cself
* np.intp_t num_workers = get_num_workers(workers, kwargs) # <<<<<<<<<<<<<<
*
* n = num_points(x_arr, cself.m)
*/
__pyx_t_8 = __pyx_f_5scipy_7spatial_8_ckdtree_get_num_workers(__pyx_v_workers, __pyx_v_kwargs); if (unlikely(__pyx_t_8 == ((__pyx_t_5numpy_intp_t)-1L))) __PYX_ERR(0, 815, __pyx_L1_error)
__pyx_v_num_workers = __pyx_t_8;
/* "scipy/spatial/_ckdtree.pyx":817
* np.intp_t num_workers = get_num_workers(workers, kwargs)
*
* n = num_points(x_arr, cself.m) # <<<<<<<<<<<<<<
* xx = x_arr.reshape(n, cself.m)
*
*/
__pyx_t_8 = __pyx_f_5scipy_7spatial_8_ckdtree_num_points(__pyx_v_x_arr, __pyx_cur_scope->__pyx_v_cself->m); if (unlikely(__pyx_t_8 == ((__pyx_t_5numpy_intp_t)-1L))) __PYX_ERR(0, 817, __pyx_L1_error)
__pyx_v_n = __pyx_t_8;
/* "scipy/spatial/_ckdtree.pyx":818
*
* n = num_points(x_arr, cself.m)
* xx = x_arr.reshape(n, cself.m) # <<<<<<<<<<<<<<
*
* if p < 1:
*/
__pyx_t_4 = ((PyObject *)__pyx_v_x_arr);
__Pyx_INCREF(__pyx_t_4);
__pyx_t_3 = __Pyx_PyLong_From_npy_intp(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyLong_From_npy_intp(__pyx_cur_scope->__pyx_v_cself->m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_cur_scope->__pyx_v_xx = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":820
* xx = x_arr.reshape(n, cself.m)
*
* if p < 1: # <<<<<<<<<<<<<<
* raise ValueError("Only p-norms with 1<=p<=infinity permitted")
*
*/
__pyx_t_10 = (__pyx_cur_scope->__pyx_v_p < 1.0);
if (unlikely(__pyx_t_10)) {
/* "scipy/spatial/_ckdtree.pyx":821
*
* if p < 1:
* raise ValueError("Only p-norms with 1<=p<=infinity permitted") # <<<<<<<<<<<<<<
*
* if not np.isfinite(x_arr).all():
*/
__pyx_t_5 = NULL;
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Only_p_norms_with_1_p_infinity_p};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(0, 821, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":820
* xx = x_arr.reshape(n, cself.m)
*
* if p < 1: # <<<<<<<<<<<<<<
* raise ValueError("Only p-norms with 1<=p<=infinity permitted")
*
*/
}
/* "scipy/spatial/_ckdtree.pyx":823
* raise ValueError("Only p-norms with 1<=p<=infinity permitted")
*
* if not np.isfinite(x_arr).all(): # <<<<<<<<<<<<<<
* raise ValueError("'x' must be finite, check for nan or inf values")
*
*/
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_isfinite); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 823, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_11))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11);
assert(__pyx_t_4);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_x_arr)};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_t_5 = __pyx_t_3;
__Pyx_INCREF(__pyx_t_5);
__pyx_t_6 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_all, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 823, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_12 = (!__pyx_t_10);
if (unlikely(__pyx_t_12)) {
/* "scipy/spatial/_ckdtree.pyx":824
*
* if not np.isfinite(x_arr).all():
* raise ValueError("'x' must be finite, check for nan or inf values") # <<<<<<<<<<<<<<
*
* cdef:
*/
__pyx_t_3 = NULL;
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_x_must_be_finite_check_for_nan};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(0, 824, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":823
* raise ValueError("Only p-norms with 1<=p<=infinity permitted")
*
* if not np.isfinite(x_arr).all(): # <<<<<<<<<<<<<<
* raise ValueError("'x' must be finite, check for nan or inf values")
*
*/
}
/* "scipy/spatial/_ckdtree.pyx":827
*
* cdef:
* bool single = (x_arr.ndim == 1) # <<<<<<<<<<<<<<
* bool nearest = False
*
*/
__pyx_v_single = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x_arr) == 1);
/* "scipy/spatial/_ckdtree.pyx":828
* cdef:
* bool single = (x_arr.ndim == 1)
* bool nearest = False # <<<<<<<<<<<<<<
*
* if np.isscalar(k):
*/
__pyx_v_nearest = 0;
/* "scipy/spatial/_ckdtree.pyx":830
* bool nearest = False
*
* if np.isscalar(k): # <<<<<<<<<<<<<<
* if k == 1:
* nearest = True
*/
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 830, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_isscalar); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 830, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_11))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_k};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 830, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_12) {
/* "scipy/spatial/_ckdtree.pyx":831
*
* if np.isscalar(k):
* if k == 1: # <<<<<<<<<<<<<<
* nearest = True
* k = np.arange(1, k + 1)
*/
__pyx_t_12 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_k, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 831, __pyx_L1_error)
if (__pyx_t_12) {
/* "scipy/spatial/_ckdtree.pyx":832
* if np.isscalar(k):
* if k == 1:
* nearest = True # <<<<<<<<<<<<<<
* k = np.arange(1, k + 1)
*
*/
__pyx_v_nearest = 1;
/* "scipy/spatial/_ckdtree.pyx":831
*
* if np.isscalar(k):
* if k == 1: # <<<<<<<<<<<<<<
* nearest = True
* k = np.arange(1, k + 1)
*/
}
/* "scipy/spatial/_ckdtree.pyx":833
* if k == 1:
* nearest = True
* k = np.arange(1, k + 1) # <<<<<<<<<<<<<<
*
* retshape = np.shape(x_arr)[:-1]
*/
__pyx_t_11 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_v_k, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_11);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_int_1, __pyx_t_3};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1);
__pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":830
* bool nearest = False
*
* if np.isscalar(k): # <<<<<<<<<<<<<<
* if k == 1:
* nearest = True
*/
}
/* "scipy/spatial/_ckdtree.pyx":835
* k = np.arange(1, k + 1)
*
* retshape = np.shape(x_arr)[:-1] # <<<<<<<<<<<<<<
*
* # The C++ function touches all dd and ii entries,
*/
__pyx_t_5 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 835, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_11))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
assert(__pyx_t_5);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_x_arr)};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 835, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_retshape = __pyx_t_11;
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":841
*
* cdef:
* np.float64_t [:, ::1] dd = np.empty((n,len(k)),dtype=np.float64) # <<<<<<<<<<<<<<
* np.intp_t [:, ::1] ii = np.empty((n,len(k)),dtype=np.intp)
* np.intp_t [::1] kk = np.array(k, dtype=np.intp)
*/
__pyx_t_1 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyLong_From_npy_intp(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_13 = PyObject_Length(__pyx_v_k); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 841, __pyx_L1_error)
__pyx_t_4 = PyLong_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_5);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 841, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 841, __pyx_L1_error);
__pyx_t_5 = 0;
__pyx_t_4 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
assert(__pyx_t_1);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_t_2};
__pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 841, __pyx_L1_error)
__pyx_t_11 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_11, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 841, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_cur_scope->__pyx_v_dd = __pyx_t_14;
__pyx_t_14.memview = NULL;
__pyx_t_14.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":842
* cdef:
* np.float64_t [:, ::1] dd = np.empty((n,len(k)),dtype=np.float64)
* np.intp_t [:, ::1] ii = np.empty((n,len(k)),dtype=np.intp) # <<<<<<<<<<<<<<
* np.intp_t [::1] kk = np.array(k, dtype=np.intp)
* np.intp_t kmax = np.max(k)
*/
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyLong_From_npy_intp(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_13 = PyObject_Length(__pyx_v_k); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 842, __pyx_L1_error)
__pyx_t_2 = PyLong_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 842, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 842, __pyx_L1_error);
__pyx_t_4 = 0;
__pyx_t_2 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_1};
__pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_4, __pyx_t_2, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 842, __pyx_L1_error)
__pyx_t_11 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_intp_t(__pyx_t_11, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_cur_scope->__pyx_v_ii = __pyx_t_15;
__pyx_t_15.memview = NULL;
__pyx_t_15.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":843
* np.float64_t [:, ::1] dd = np.empty((n,len(k)),dtype=np.float64)
* np.intp_t [:, ::1] ii = np.empty((n,len(k)),dtype=np.intp)
* np.intp_t [::1] kk = np.array(k, dtype=np.intp) # <<<<<<<<<<<<<<
* np.intp_t kmax = np.max(k)
*
*/
__pyx_t_5 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
assert(__pyx_t_5);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_v_k};
__pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_1, __pyx_t_2, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 843, __pyx_L1_error)
__pyx_t_11 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(__pyx_t_11, PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_cur_scope->__pyx_v_kk = __pyx_t_16;
__pyx_t_16.memview = NULL;
__pyx_t_16.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":844
* np.intp_t [:, ::1] ii = np.empty((n,len(k)),dtype=np.intp)
* np.intp_t [::1] kk = np.array(k, dtype=np.intp)
* np.intp_t kmax = np.max(k) # <<<<<<<<<<<<<<
*
* # Do the query in an external C++ function.
*/
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
assert(__pyx_t_4);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_k};
__pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__pyx_t_8 = __Pyx_PyLong_As_npy_intp(__pyx_t_11); if (unlikely((__pyx_t_8 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_cur_scope->__pyx_v_kmax = __pyx_t_8;
/* "scipy/spatial/_ckdtree.pyx":847
*
* # Do the query in an external C++ function.
* def _thread_func(np.intp_t start, np.intp_t stop): # <<<<<<<<<<<<<<
* cdef:
* np.float64_t *pdd = &dd[start,0]
*/
__pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_5query_1_thread_func, 0, __pyx_mstate_global->__pyx_n_u_query_locals__thread_func, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_scipy_spatial__ckdtree, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_v__thread_func = __pyx_t_11;
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":857
* pxx, stop-start, pkk, kk.shape[0], kmax, eps, p, distance_upper_bound)
*
* _run_threads(_thread_func, n, num_workers) # <<<<<<<<<<<<<<
*
* ddret = np.reshape(dd, retshape + (len(k),))
*/
__pyx_t_11 = __pyx_f_5scipy_7spatial_8_ckdtree__run_threads(__pyx_v__thread_func, __pyx_v_n, __pyx_v_num_workers); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 857, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":859
* _run_threads(_thread_func, n, num_workers)
*
* ddret = np.reshape(dd, retshape + (len(k),)) # <<<<<<<<<<<<<<
* iiret = np.reshape(ii, retshape + (len(k),))
*
*/
__pyx_t_1 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __pyx_memoryview_fromslice(__pyx_cur_scope->__pyx_v_dd, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_13 = PyObject_Length(__pyx_v_k); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 859, __pyx_L1_error)
__pyx_t_5 = PyLong_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 859, __pyx_L1_error);
__pyx_t_5 = 0;
__pyx_t_5 = PyNumber_Add(__pyx_v_retshape, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
assert(__pyx_t_1);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_t_5};
__pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__pyx_v_ddret = __pyx_t_11;
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":860
*
* ddret = np.reshape(dd, retshape + (len(k),))
* iiret = np.reshape(ii, retshape + (len(k),)) # <<<<<<<<<<<<<<
*
* if nearest:
*/
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_cur_scope->__pyx_v_ii, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_intp_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_intp_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_13 = PyObject_Length(__pyx_v_k); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 860, __pyx_L1_error)
__pyx_t_1 = PyLong_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 860, __pyx_L1_error);
__pyx_t_1 = 0;
__pyx_t_1 = PyNumber_Add(__pyx_v_retshape, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
assert(__pyx_t_2);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_1};
__pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__pyx_v_iiret = __pyx_t_11;
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":862
* iiret = np.reshape(ii, retshape + (len(k),))
*
* if nearest: # <<<<<<<<<<<<<<
* ddret = ddret[..., 0]
* iiret = iiret[..., 0]
*/
__pyx_t_12 = (__pyx_v_nearest != 0);
if (__pyx_t_12) {
/* "scipy/spatial/_ckdtree.pyx":863
*
* if nearest:
* ddret = ddret[..., 0] # <<<<<<<<<<<<<<
* iiret = iiret[..., 0]
* # the only case where we return a python scalar
*/
__pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_ddret, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 863, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF_SET(__pyx_v_ddret, __pyx_t_11);
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":864
* if nearest:
* ddret = ddret[..., 0]
* iiret = iiret[..., 0] # <<<<<<<<<<<<<<
* # the only case where we return a python scalar
* if single:
*/
__pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_iiret, __pyx_mstate_global->__pyx_tuple[3]); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 864, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF_SET(__pyx_v_iiret, __pyx_t_11);
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":866
* iiret = iiret[..., 0]
* # the only case where we return a python scalar
* if single: # <<<<<<<<<<<<<<
* ddret = float(ddret)
* iiret = int(iiret)
*/
__pyx_t_12 = (__pyx_v_single != 0);
if (__pyx_t_12) {
/* "scipy/spatial/_ckdtree.pyx":867
* # the only case where we return a python scalar
* if single:
* ddret = float(ddret) # <<<<<<<<<<<<<<
* iiret = int(iiret)
*
*/
__pyx_t_11 = __Pyx_PyNumber_Float(__pyx_v_ddret); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 867, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF_SET(__pyx_v_ddret, __pyx_t_11);
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":868
* if single:
* ddret = float(ddret)
* iiret = int(iiret) # <<<<<<<<<<<<<<
*
* return ddret, iiret
*/
__pyx_t_11 = __Pyx_PyNumber_Int(__pyx_v_iiret); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 868, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF_SET(__pyx_v_iiret, __pyx_t_11);
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":866
* iiret = iiret[..., 0]
* # the only case where we return a python scalar
* if single: # <<<<<<<<<<<<<<
* ddret = float(ddret)
* iiret = int(iiret)
*/
}
/* "scipy/spatial/_ckdtree.pyx":862
* iiret = np.reshape(ii, retshape + (len(k),))
*
* if nearest: # <<<<<<<<<<<<<<
* ddret = ddret[..., 0]
* iiret = iiret[..., 0]
*/
}
/* "scipy/spatial/_ckdtree.pyx":870
* iiret = int(iiret)
*
* return ddret, iiret # <<<<<<<<<<<<<<
*
* # ----------------
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 870, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_v_ddret);
__Pyx_GIVEREF(__pyx_v_ddret);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_ddret) != (0)) __PYX_ERR(0, 870, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_iiret);
__Pyx_GIVEREF(__pyx_v_iiret);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_iiret) != (0)) __PYX_ERR(0, 870, __pyx_L1_error);
__pyx_r = __pyx_t_11;
__pyx_t_11 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":693
* # -----
*
* @cython.boundscheck(False) # <<<<<<<<<<<<<<
* def query(cKDTree self, object x, object k=1, np.float64_t eps=0.0,
* np.float64_t p=2.0, np.float64_t distance_upper_bound=INFINITY,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
__Pyx_XDECREF(__pyx_t_11);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_14, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_16, 1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_x_arr);
__Pyx_XDECREF(__pyx_v_retshape);
__Pyx_XDECREF(__pyx_v__thread_func);
__Pyx_XDECREF(__pyx_v_ddret);
__Pyx_XDECREF(__pyx_v_iiret);
__Pyx_XDECREF(__pyx_v_k);
__Pyx_DECREF((PyObject *)__pyx_cur_scope);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":876
* # ----------------
*
* def query_ball_point(cKDTree self, object x, object r, # <<<<<<<<<<<<<<
* np.float64_t p=2.0, np.float64_t eps=0.0,
* object workers=None,
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_9query_ball_point(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_8query_ball_point, "\n query_ball_point(self, x, r, p=2.0, eps=0.0, workers=1, return_sorted=None,\n return_length=False)\n\n Find all points within distance r of point(s) x.\n\n Parameters\n ----------\n x : array_like, shape tuple + (self.m,)\n The point or points to search for neighbors of.\n r : array_like, float\n The radius of points to return, shall broadcast to the length of x.\n p : float, optional\n Which Minkowski p-norm to use. Should be in the range [1, inf].\n A finite large p may cause a ValueError if overflow can occur.\n eps : nonnegative float, optional\n Approximate search. Branches of the tree are not explored if their\n nearest points are further than ``r / (1 + eps)``, and branches are\n added in bulk if their furthest points are nearer than\n ``r * (1 + eps)``.\n workers : int, optional\n Number of jobs to schedule for parallel processing. If -1 is given\n all processors are used. Default: 1.\n\n .. versionchanged:: 1.9.0\n The \"n_jobs\" argument was renamed \"workers\". The old name\n \"n_jobs\" was deprecated in SciPy 1.6.0 and was removed in\n SciPy 1.9.0.\n\n return_sorted : bool, optional\n Sorts returned indices if True and does not sort them if False. If\n None, does not sort single point queries, but does sort\n multi-point queries which was the behavior before this option\n was added.\n\n .. versionadded:: 1.2.0\n return_length: bool, optional\n Return the number of points inside the radius instead of a list\n of the indices.\n .. versionadded:: 1.3.0\n\n Returns\n -------\n results : list or array of lists\n If `x` is a single point, returns a list of the indices of the\n "" neighbors of `x`. If `x` is an array of points, returns an object\n array of shape tuple containing lists of neighbors.\n\n Notes\n -----\n If you have many points whose neighbors you want to find, you may save\n substantial amounts of time by putting them in a cKDTree and using\n query_ball_tree.\n\n Examples\n --------\n >>> import numpy as np\n >>> from scipy import spatial\n >>> x, y = np.mgrid[0:4, 0:4]\n >>> points = np.c_[x.ravel(), y.ravel()]\n >>> tree = spatial.cKDTree(points)\n >>> tree.query_ball_point([2, 0], 1)\n [4, 8, 9, 12]\n\n Query multiple points and plot the results:\n\n >>> import matplotlib.pyplot as plt\n >>> points = np.asarray(points)\n >>> plt.plot(points[:,0], points[:,1], '.')\n >>> for results in tree.query_ball_point(([2, 0], [3, 3]), 1):\n ... nearby_points = points[results]\n ... plt.plot(nearby_points[:,0], nearby_points[:,1], 'o')\n >>> plt.margins(0.1, 0.1)\n >>> plt.show()\n\n ");
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_9query_ball_point = {"query_ball_point", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_9query_ball_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_8query_ball_point};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_9query_ball_point(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_r = 0;
__pyx_t_5numpy_float64_t __pyx_v_p;
__pyx_t_5numpy_float64_t __pyx_v_eps;
PyObject *__pyx_v_workers = 0;
PyObject *__pyx_v_return_sorted = 0;
PyObject *__pyx_v_return_length = 0;
PyObject *__pyx_v_kwargs = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[7] = {0,0,0,0,0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("query_ball_point (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_r,&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_eps,&__pyx_mstate_global->__pyx_n_u_workers,&__pyx_mstate_global->__pyx_n_u_return_sorted,&__pyx_mstate_global->__pyx_n_u_return_length,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 876, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 7:
values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 6:
values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 5:
values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "query_ball_point", 1) < (0)) __PYX_ERR(0, 876, __pyx_L3_error)
/* "scipy/spatial/_ckdtree.pyx":878
* def query_ball_point(cKDTree self, object x, object r,
* np.float64_t p=2.0, np.float64_t eps=0.0,
* object workers=None, # <<<<<<<<<<<<<<
* return_sorted=None,
* return_length=False, **kwargs):
*/
if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
/* "scipy/spatial/_ckdtree.pyx":879
* np.float64_t p=2.0, np.float64_t eps=0.0,
* object workers=None,
* return_sorted=None, # <<<<<<<<<<<<<<
* return_length=False, **kwargs):
* """
*/
if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
/* "scipy/spatial/_ckdtree.pyx":880
* object workers=None,
* return_sorted=None,
* return_length=False, **kwargs): # <<<<<<<<<<<<<<
* """
* query_ball_point(self, x, r, p=2.0, eps=0.0, workers=1, return_sorted=None,
*/
if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_False));
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("query_ball_point", 0, 2, 7, i); __PYX_ERR(0, 876, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 7:
values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 6:
values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 5:
values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 876, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 876, __pyx_L3_error)
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 876, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
/* "scipy/spatial/_ckdtree.pyx":878
* def query_ball_point(cKDTree self, object x, object r,
* np.float64_t p=2.0, np.float64_t eps=0.0,
* object workers=None, # <<<<<<<<<<<<<<
* return_sorted=None,
* return_length=False, **kwargs):
*/
if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
/* "scipy/spatial/_ckdtree.pyx":879
* np.float64_t p=2.0, np.float64_t eps=0.0,
* object workers=None,
* return_sorted=None, # <<<<<<<<<<<<<<
* return_length=False, **kwargs):
* """
*/
if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
/* "scipy/spatial/_ckdtree.pyx":880
* object workers=None,
* return_sorted=None,
* return_length=False, **kwargs): # <<<<<<<<<<<<<<
* """
* query_ball_point(self, x, r, p=2.0, eps=0.0, workers=1, return_sorted=None,
*/
if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_False));
}
__pyx_v_x = values[0];
__pyx_v_r = values[1];
if (values[2]) {
__pyx_v_p = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_p == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L3_error)
} else {
__pyx_v_p = ((__pyx_t_5numpy_float64_t)2.0);
}
if (values[3]) {
__pyx_v_eps = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L3_error)
} else {
__pyx_v_eps = ((__pyx_t_5numpy_float64_t)0.0);
}
__pyx_v_workers = values[4];
__pyx_v_return_sorted = values[5];
__pyx_v_return_length = values[6];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("query_ball_point", 0, 2, 7, __pyx_nargs); __PYX_ERR(0, 876, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query_ball_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_8query_ball_point(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v_x, __pyx_v_r, __pyx_v_p, __pyx_v_eps, __pyx_v_workers, __pyx_v_return_sorted, __pyx_v_return_length, __pyx_v_kwargs);
/* "scipy/spatial/_ckdtree.pyx":876
* # ----------------
*
* def query_ball_point(cKDTree self, object x, object r, # <<<<<<<<<<<<<<
* np.float64_t p=2.0, np.float64_t eps=0.0,
* object workers=None,
*/
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_DECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":987
* vout = result.reshape(-1)
*
* def _thread_func(np.intp_t start, np.intp_t stop): # <<<<<<<<<<<<<<
* cdef:
* vector[vector[np.intp_t]] vvres
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_16query_ball_point_1_thread_func(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_16query_ball_point_1_thread_func = {"_thread_func", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_16query_ball_point_1_thread_func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_16query_ball_point_1_thread_func(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
__pyx_t_5numpy_intp_t __pyx_v_start;
__pyx_t_5numpy_intp_t __pyx_v_stop;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[2] = {0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_thread_func (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_start,&__pyx_mstate_global->__pyx_n_u_stop,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 987, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 987, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 987, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_thread_func", 0) < (0)) __PYX_ERR(0, 987, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_thread_func", 1, 2, 2, i); __PYX_ERR(0, 987, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 2)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 987, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 987, __pyx_L3_error)
}
__pyx_v_start = __Pyx_PyLong_As_npy_intp(values[0]); if (unlikely((__pyx_v_start == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 987, __pyx_L3_error)
__pyx_v_stop = __Pyx_PyLong_As_npy_intp(values[1]); if (unlikely((__pyx_v_stop == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 987, __pyx_L3_error)
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_thread_func", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 987, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query_ball_point._thread_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_16query_ball_point__thread_func(__pyx_self, __pyx_v_start, __pyx_v_stop);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_16query_ball_point__thread_func(PyObject *__pyx_self, __pyx_t_5numpy_intp_t __pyx_v_start, __pyx_t_5numpy_intp_t __pyx_v_stop) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point *__pyx_cur_scope;
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point *__pyx_outer_scope;
std::vector<std::vector<__pyx_t_5numpy_intp_t> > __pyx_v_vvres;
__pyx_t_5numpy_intp_t __pyx_v_i;
__pyx_t_5numpy_intp_t __pyx_v_j;
__pyx_t_5numpy_intp_t __pyx_v_m;
__pyx_t_5numpy_intp_t *__pyx_v_cur;
__pyx_t_5numpy_float64_t const *__pyx_v_pvxx;
__pyx_t_5numpy_float64_t const *__pyx_v_pvrr;
PyObject *__pyx_v_tmp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__pyx_t_5numpy_intp_t __pyx_t_1;
__pyx_t_5numpy_intp_t __pyx_t_2;
__pyx_t_5numpy_intp_t __pyx_t_3;
int __pyx_t_4;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
__pyx_t_5numpy_intp_t __pyx_t_8;
__pyx_t_5numpy_intp_t __pyx_t_9;
__pyx_t_5numpy_intp_t __pyx_t_10;
PyObject **__pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_thread_func", 0);
__pyx_outer_scope = (struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
/* "scipy/spatial/_ckdtree.pyx":996
* list tmp
*
* vvres.resize(stop - start) # <<<<<<<<<<<<<<
* pvxx = vxx + start * cself.m
* pvrr = vrr + start
*/
try {
__pyx_v_vvres.resize((__pyx_v_stop - __pyx_v_start));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(0, 996, __pyx_L1_error)
}
/* "scipy/spatial/_ckdtree.pyx":997
*
* vvres.resize(stop - start)
* pvxx = vxx + start * cself.m # <<<<<<<<<<<<<<
* pvrr = vrr + start
*
*/
__pyx_v_pvxx = (__pyx_cur_scope->__pyx_v_vxx + (__pyx_v_start * __pyx_cur_scope->__pyx_v_cself->m));
/* "scipy/spatial/_ckdtree.pyx":998
* vvres.resize(stop - start)
* pvxx = vxx + start * cself.m
* pvrr = vrr + start # <<<<<<<<<<<<<<
*
* with nogil:
*/
__pyx_v_pvrr = (__pyx_cur_scope->__pyx_v_vrr + __pyx_v_start);
/* "scipy/spatial/_ckdtree.pyx":1000
* pvrr = vrr + start
*
* with nogil: # <<<<<<<<<<<<<<
* query_ball_point(cself, pvxx,
* pvrr, p, eps, stop - start, vvres.data(),
*/
{
PyThreadState * _save;
_save = PyEval_SaveThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
/* "scipy/spatial/_ckdtree.pyx":1001
*
* with nogil:
* query_ball_point(cself, pvxx, # <<<<<<<<<<<<<<
* pvrr, p, eps, stop - start, vvres.data(),
* rlen, sort_output)
*/
try {
query_ball_point(__pyx_cur_scope->__pyx_v_cself, __pyx_v_pvxx, __pyx_v_pvrr, __pyx_cur_scope->__pyx_v_p, __pyx_cur_scope->__pyx_v_eps, (__pyx_v_stop - __pyx_v_start), __pyx_v_vvres.data(), __pyx_cur_scope->__pyx_v_rlen, __pyx_cur_scope->__pyx_v_sort_output);
} catch(...) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_CppExn2PyErr();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__PYX_ERR(0, 1001, __pyx_L4_error)
}
}
/* "scipy/spatial/_ckdtree.pyx":1000
* pvrr = vrr + start
*
* with nogil: # <<<<<<<<<<<<<<
* query_ball_point(cself, pvxx,
* pvrr, p, eps, stop - start, vvres.data(),
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L5;
}
__pyx_L4_error: {
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L1_error;
}
__pyx_L5:;
}
}
/* "scipy/spatial/_ckdtree.pyx":1005
* rlen, sort_output)
*
* for i in range(stop - start): # <<<<<<<<<<<<<<
* if rlen:
* vlen[start + i] = vvres[i].front()
*/
__pyx_t_1 = (__pyx_v_stop - __pyx_v_start);
__pyx_t_2 = __pyx_t_1;
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
/* "scipy/spatial/_ckdtree.pyx":1006
*
* for i in range(stop - start):
* if rlen: # <<<<<<<<<<<<<<
* vlen[start + i] = vvres[i].front()
* continue
*/
__pyx_t_4 = (__pyx_cur_scope->__pyx_v_rlen != 0);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1007
* for i in range(stop - start):
* if rlen:
* vlen[start + i] = vvres[i].front() # <<<<<<<<<<<<<<
* continue
*
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_vlen.memview)) { __Pyx_RaiseClosureNameError("vlen"); __PYX_ERR(0, 1007, __pyx_L1_error) }
__pyx_t_5 = (__pyx_v_start + __pyx_v_i);
__pyx_t_6 = -1;
if (__pyx_t_5 < 0) {
__pyx_t_5 += __pyx_cur_scope->__pyx_v_vlen.shape[0];
if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
} else if (unlikely(__pyx_t_5 >= __pyx_cur_scope->__pyx_v_vlen.shape[0])) __pyx_t_6 = 0;
if (unlikely(__pyx_t_6 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_6);
__PYX_ERR(0, 1007, __pyx_L1_error)
}
*((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_cur_scope->__pyx_v_vlen.data) + __pyx_t_5)) )) = (__pyx_v_vvres[__pyx_v_i]).front();
/* "scipy/spatial/_ckdtree.pyx":1008
* if rlen:
* vlen[start + i] = vvres[i].front()
* continue # <<<<<<<<<<<<<<
*
* m = <np.intp_t> (vvres[i].size())
*/
goto __pyx_L6_continue;
/* "scipy/spatial/_ckdtree.pyx":1006
*
* for i in range(stop - start):
* if rlen: # <<<<<<<<<<<<<<
* vlen[start + i] = vvres[i].front()
* continue
*/
}
/* "scipy/spatial/_ckdtree.pyx":1010
* continue
*
* m = <np.intp_t> (vvres[i].size()) # <<<<<<<<<<<<<<
* tmp = m * [None]
*
*/
__pyx_v_m = ((__pyx_t_5numpy_intp_t)(__pyx_v_vvres[__pyx_v_i]).size());
/* "scipy/spatial/_ckdtree.pyx":1011
*
* m = <np.intp_t> (vvres[i].size())
* tmp = m * [None] # <<<<<<<<<<<<<<
*
* cur = vvres[i].data()
*/
__pyx_t_7 = PyList_New(1 * ((__pyx_v_m<0) ? 0:__pyx_v_m)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1011, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
{ Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < __pyx_v_m; __pyx_temp++) {
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
if (__Pyx_PyList_SET_ITEM(__pyx_t_7, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 1011, __pyx_L1_error);
}
}
__Pyx_XDECREF_SET(__pyx_v_tmp, ((PyObject*)__pyx_t_7));
__pyx_t_7 = 0;
/* "scipy/spatial/_ckdtree.pyx":1013
* tmp = m * [None]
*
* cur = vvres[i].data() # <<<<<<<<<<<<<<
* for j in range(m):
* tmp[j] = cur[j]
*/
__pyx_v_cur = (__pyx_v_vvres[__pyx_v_i]).data();
/* "scipy/spatial/_ckdtree.pyx":1014
*
* cur = vvres[i].data()
* for j in range(m): # <<<<<<<<<<<<<<
* tmp[j] = cur[j]
* vout[start + i] = tmp
*/
__pyx_t_8 = __pyx_v_m;
__pyx_t_9 = __pyx_t_8;
for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
__pyx_v_j = __pyx_t_10;
/* "scipy/spatial/_ckdtree.pyx":1015
* cur = vvres[i].data()
* for j in range(m):
* tmp[j] = cur[j] # <<<<<<<<<<<<<<
* vout[start + i] = tmp
*
*/
__pyx_t_7 = __Pyx_PyLong_From_npy_intp((__pyx_v_cur[__pyx_v_j])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1015, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (unlikely(__pyx_v_tmp == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1015, __pyx_L1_error)
}
if (unlikely((__Pyx_SetItemInt(__pyx_v_tmp, __pyx_v_j, __pyx_t_7, __pyx_t_5numpy_intp_t, 1, __Pyx_PyLong_From_npy_intp, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 1015, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
/* "scipy/spatial/_ckdtree.pyx":1016
* for j in range(m):
* tmp[j] = cur[j]
* vout[start + i] = tmp # <<<<<<<<<<<<<<
*
* _run_threads(_thread_func, n, num_workers)
*/
if (unlikely(!__pyx_cur_scope->__pyx_v_vout.memview)) { __Pyx_RaiseClosureNameError("vout"); __PYX_ERR(0, 1016, __pyx_L1_error) }
__pyx_t_5 = (__pyx_v_start + __pyx_v_i);
__pyx_t_6 = -1;
if (__pyx_t_5 < 0) {
__pyx_t_5 += __pyx_cur_scope->__pyx_v_vout.shape[0];
if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
} else if (unlikely(__pyx_t_5 >= __pyx_cur_scope->__pyx_v_vout.shape[0])) __pyx_t_6 = 0;
if (unlikely(__pyx_t_6 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_6);
__PYX_ERR(0, 1016, __pyx_L1_error)
}
__pyx_t_11 = ((PyObject * *) ( /* dim=0 */ ((char *) (((PyObject * *) __pyx_cur_scope->__pyx_v_vout.data) + __pyx_t_5)) ));
__Pyx_XGOTREF(*__pyx_t_11);
__Pyx_INCREF(__pyx_v_tmp); __Pyx_XDECREF(*__pyx_t_11);
*__pyx_t_11 = __pyx_v_tmp;
__Pyx_XGIVEREF(*__pyx_t_11);
__pyx_L6_continue:;
}
/* "scipy/spatial/_ckdtree.pyx":987
* vout = result.reshape(-1)
*
* def _thread_func(np.intp_t start, np.intp_t stop): # <<<<<<<<<<<<<<
* cdef:
* vector[vector[np.intp_t]] vvres
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query_ball_point._thread_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":876
* # ----------------
*
* def query_ball_point(cKDTree self, object x, object r, # <<<<<<<<<<<<<<
* np.float64_t p=2.0, np.float64_t eps=0.0,
* object workers=None,
*/
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_8query_ball_point(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_r, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_workers, PyObject *__pyx_v_return_sorted, PyObject *__pyx_v_return_length, PyObject *__pyx_v_kwargs) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point *__pyx_cur_scope;
PyArrayObject *__pyx_v_x_arr = 0;
__pyx_t_5numpy_intp_t __pyx_v_num_workers;
__pyx_t_5numpy_intp_t __pyx_v_n;
PyObject *__pyx_v_retshape = 0;
PyArrayObject *__pyx_v_r_arr = 0;
PyObject *__pyx_v_result = NULL;
PyObject *__pyx_v__thread_func = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
size_t __pyx_t_6;
struct ckdtree *__pyx_t_7;
bool __pyx_t_8;
int __pyx_t_9;
bool __pyx_t_10;
__pyx_t_5numpy_intp_t __pyx_t_11;
PyObject *__pyx_t_12 = NULL;
int __pyx_t_13;
__Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("query_ball_point", 0);
__pyx_cur_scope = (struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point *)__pyx_tp_new_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point(__pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point, __pyx_mstate_global->__pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree___pyx_scope_struct_2_query_ball_point *)Py_None);
__Pyx_INCREF(Py_None);
__PYX_ERR(0, 876, __pyx_L1_error)
} else {
__Pyx_GOTREF((PyObject *)__pyx_cur_scope);
}
__pyx_cur_scope->__pyx_v_p = __pyx_v_p;
__pyx_cur_scope->__pyx_v_eps = __pyx_v_eps;
/* "scipy/spatial/_ckdtree.pyx":961
* object[::1] vout
* np.intp_t[::1] vlen
* np.ndarray x_arr = np.ascontiguousarray(x, dtype=np.float64) # <<<<<<<<<<<<<<
* ckdtree *cself = self.cself
* bool rlen = return_length
*/
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 961, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
assert(__pyx_t_2);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_x};
__pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_5, __pyx_t_3, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 961, __pyx_L1_error)
__pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 961, __pyx_L1_error)
__pyx_v_x_arr = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":962
* np.intp_t[::1] vlen
* np.ndarray x_arr = np.ascontiguousarray(x, dtype=np.float64)
* ckdtree *cself = self.cself # <<<<<<<<<<<<<<
* bool rlen = return_length
* # compatibility with the old bug not sorting scalar queries.
*/
__pyx_t_7 = __pyx_v_self->cself;
__pyx_cur_scope->__pyx_v_cself = __pyx_t_7;
/* "scipy/spatial/_ckdtree.pyx":963
* np.ndarray x_arr = np.ascontiguousarray(x, dtype=np.float64)
* ckdtree *cself = self.cself
* bool rlen = return_length # <<<<<<<<<<<<<<
* # compatibility with the old bug not sorting scalar queries.
* bool sort_output = return_sorted or (
*/
__pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_length); if (unlikely((__pyx_t_8 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L1_error)
__pyx_cur_scope->__pyx_v_rlen = __pyx_t_8;
/* "scipy/spatial/_ckdtree.pyx":965
* bool rlen = return_length
* # compatibility with the old bug not sorting scalar queries.
* bool sort_output = return_sorted or ( # <<<<<<<<<<<<<<
* return_sorted is None and x_arr.ndim > 1)
*
*/
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_return_sorted); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 965, __pyx_L1_error)
if (!__pyx_t_9) {
} else {
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_return_sorted); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L1_error)
__pyx_t_8 = __pyx_t_10;
goto __pyx_L3_bool_binop_done;
}
/* "scipy/spatial/_ckdtree.pyx":966
* # compatibility with the old bug not sorting scalar queries.
* bool sort_output = return_sorted or (
* return_sorted is None and x_arr.ndim > 1) # <<<<<<<<<<<<<<
*
* np.intp_t num_workers = get_num_workers(workers, kwargs)
*/
__pyx_t_9 = (__pyx_v_return_sorted == Py_None);
if (__pyx_t_9) {
} else {
__pyx_t_8 = __pyx_t_9;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_9 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x_arr) > 1);
__pyx_t_8 = __pyx_t_9;
__pyx_L3_bool_binop_done:;
__pyx_cur_scope->__pyx_v_sort_output = __pyx_t_8;
/* "scipy/spatial/_ckdtree.pyx":968
* return_sorted is None and x_arr.ndim > 1)
*
* np.intp_t num_workers = get_num_workers(workers, kwargs) # <<<<<<<<<<<<<<
* np.intp_t n = num_points(x_arr, cself.m)
* tuple retshape = np.shape(x_arr)[:-1]
*/
__pyx_t_11 = __pyx_f_5scipy_7spatial_8_ckdtree_get_num_workers(__pyx_v_workers, __pyx_v_kwargs); if (unlikely(__pyx_t_11 == ((__pyx_t_5numpy_intp_t)-1L))) __PYX_ERR(0, 968, __pyx_L1_error)
__pyx_v_num_workers = __pyx_t_11;
/* "scipy/spatial/_ckdtree.pyx":969
*
* np.intp_t num_workers = get_num_workers(workers, kwargs)
* np.intp_t n = num_points(x_arr, cself.m) # <<<<<<<<<<<<<<
* tuple retshape = np.shape(x_arr)[:-1]
* np.ndarray r_arr = broadcast_contiguous(r, shape=retshape,
*/
__pyx_t_11 = __pyx_f_5scipy_7spatial_8_ckdtree_num_points(__pyx_v_x_arr, __pyx_cur_scope->__pyx_v_cself->m); if (unlikely(__pyx_t_11 == ((__pyx_t_5numpy_intp_t)-1L))) __PYX_ERR(0, 969, __pyx_L1_error)
__pyx_v_n = __pyx_t_11;
/* "scipy/spatial/_ckdtree.pyx":970
* np.intp_t num_workers = get_num_workers(workers, kwargs)
* np.intp_t n = num_points(x_arr, cself.m)
* tuple retshape = np.shape(x_arr)[:-1] # <<<<<<<<<<<<<<
* np.ndarray r_arr = broadcast_contiguous(r, shape=retshape,
* dtype=np.float64)
*/
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 970, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_4);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_x_arr)};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_5))) __PYX_ERR(0, 970, __pyx_L1_error)
__pyx_v_retshape = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":972
* tuple retshape = np.shape(x_arr)[:-1]
* np.ndarray r_arr = broadcast_contiguous(r, shape=retshape,
* dtype=np.float64) # <<<<<<<<<<<<<<
*
* const np.float64_t *vxx = <np.float64_t*>x_arr.data
*/
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":971
* np.intp_t n = num_points(x_arr, cself.m)
* tuple retshape = np.shape(x_arr)[:-1]
* np.ndarray r_arr = broadcast_contiguous(r, shape=retshape, # <<<<<<<<<<<<<<
* dtype=np.float64)
*
*/
__pyx_t_5 = ((PyObject *)__pyx_f_5scipy_7spatial_8_ckdtree_broadcast_contiguous(__pyx_v_r, __pyx_v_retshape, __pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 971, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_r_arr = ((PyArrayObject *)__pyx_t_5);
__pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":974
* dtype=np.float64)
*
* const np.float64_t *vxx = <np.float64_t*>x_arr.data # <<<<<<<<<<<<<<
* const np.float64_t *vrr = <np.float64_t*>r_arr.data
*
*/
__pyx_cur_scope->__pyx_v_vxx = ((__pyx_t_5numpy_float64_t *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_x_arr));
/* "scipy/spatial/_ckdtree.pyx":975
*
* const np.float64_t *vxx = <np.float64_t*>x_arr.data
* const np.float64_t *vrr = <np.float64_t*>r_arr.data # <<<<<<<<<<<<<<
*
* if not np.isfinite(x_arr).all():
*/
__pyx_cur_scope->__pyx_v_vrr = ((__pyx_t_5numpy_float64_t *)__pyx_f_5numpy_7ndarray_4data_data(__pyx_v_r_arr));
/* "scipy/spatial/_ckdtree.pyx":977
* const np.float64_t *vrr = <np.float64_t*>r_arr.data
*
* if not np.isfinite(x_arr).all(): # <<<<<<<<<<<<<<
* raise ValueError("'x' must be finite, check for nan or inf values")
*
*/
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_isfinite); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_12))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_x_arr)};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_1 = __pyx_t_4;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_6 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
__pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_all, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 977, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_13 = (!__pyx_t_9);
if (unlikely(__pyx_t_13)) {
/* "scipy/spatial/_ckdtree.pyx":978
*
* if not np.isfinite(x_arr).all():
* raise ValueError("'x' must be finite, check for nan or inf values") # <<<<<<<<<<<<<<
*
* if rlen:
*/
__pyx_t_4 = NULL;
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_x_must_be_finite_check_for_nan};
__pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __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_ERR(0, 978, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":977
* const np.float64_t *vrr = <np.float64_t*>r_arr.data
*
* if not np.isfinite(x_arr).all(): # <<<<<<<<<<<<<<
* raise ValueError("'x' must be finite, check for nan or inf values")
*
*/
}
/* "scipy/spatial/_ckdtree.pyx":980
* raise ValueError("'x' must be finite, check for nan or inf values")
*
* if rlen: # <<<<<<<<<<<<<<
* result = np.empty(retshape, dtype=np.intp)
* vlen = result.reshape(-1)
*/
__pyx_t_13 = (__pyx_cur_scope->__pyx_v_rlen != 0);
if (__pyx_t_13) {
/* "scipy/spatial/_ckdtree.pyx":981
*
* if rlen:
* result = np.empty(retshape, dtype=np.intp) # <<<<<<<<<<<<<<
* vlen = result.reshape(-1)
* else:
*/
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_12))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12);
assert(__pyx_t_4);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_retshape};
__pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_1, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 981, __pyx_L1_error)
__pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_v_result = __pyx_t_5;
__pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":982
* if rlen:
* result = np.empty(retshape, dtype=np.intp)
* vlen = result.reshape(-1) # <<<<<<<<<<<<<<
* else:
* result = np.empty(retshape, dtype=object)
*/
__pyx_t_12 = __pyx_v_result;
__Pyx_INCREF(__pyx_t_12);
__pyx_t_6 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_1};
__pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_cur_scope->__pyx_v_vlen = __pyx_t_14;
__pyx_t_14.memview = NULL;
__pyx_t_14.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":980
* raise ValueError("'x' must be finite, check for nan or inf values")
*
* if rlen: # <<<<<<<<<<<<<<
* result = np.empty(retshape, dtype=np.intp)
* vlen = result.reshape(-1)
*/
goto __pyx_L7;
}
/* "scipy/spatial/_ckdtree.pyx":984
* vlen = result.reshape(-1)
* else:
* result = np.empty(retshape, dtype=object) # <<<<<<<<<<<<<<
* vout = result.reshape(-1)
*
*/
/*else*/ {
__pyx_t_12 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
assert(__pyx_t_12);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
__pyx_t_6 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_12, __pyx_v_retshape};
__pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_builtin_object, __pyx_t_1, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 984, __pyx_L1_error)
__pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_v_result = __pyx_t_5;
__pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":985
* else:
* result = np.empty(retshape, dtype=object)
* vout = result.reshape(-1) # <<<<<<<<<<<<<<
*
* def _thread_func(np.intp_t start, np.intp_t stop):
*/
__pyx_t_3 = __pyx_v_result;
__Pyx_INCREF(__pyx_t_3);
__pyx_t_6 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_neg_1};
__pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 985, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dc_object(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 985, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_cur_scope->__pyx_v_vout = __pyx_t_15;
__pyx_t_15.memview = NULL;
__pyx_t_15.data = NULL;
}
__pyx_L7:;
/* "scipy/spatial/_ckdtree.pyx":987
* vout = result.reshape(-1)
*
* def _thread_func(np.intp_t start, np.intp_t stop): # <<<<<<<<<<<<<<
* cdef:
* vector[vector[np.intp_t]] vvres
*/
__pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_16query_ball_point_1_thread_func, 0, __pyx_mstate_global->__pyx_n_u_query_ball_point_locals__thread, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_scipy_spatial__ckdtree, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 987, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_v__thread_func = __pyx_t_5;
__pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":1018
* vout[start + i] = tmp
*
* _run_threads(_thread_func, n, num_workers) # <<<<<<<<<<<<<<
*
* if x_arr.ndim == 1: # scalar query, unpack result.
*/
__pyx_t_5 = __pyx_f_5scipy_7spatial_8_ckdtree__run_threads(__pyx_v__thread_func, __pyx_v_n, __pyx_v_num_workers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1018, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":1020
* _run_threads(_thread_func, n, num_workers)
*
* if x_arr.ndim == 1: # scalar query, unpack result. # <<<<<<<<<<<<<<
* result = result[()]
* return result
*/
__pyx_t_13 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_x_arr) == 1);
if (__pyx_t_13) {
/* "scipy/spatial/_ckdtree.pyx":1021
*
* if x_arr.ndim == 1: # scalar query, unpack result.
* result = result[()] # <<<<<<<<<<<<<<
* return result
*
*/
__pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_result, __pyx_mstate_global->__pyx_empty_tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1021, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
__pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":1020
* _run_threads(_thread_func, n, num_workers)
*
* if x_arr.ndim == 1: # scalar query, unpack result. # <<<<<<<<<<<<<<
* result = result[()]
* return result
*/
}
/* "scipy/spatial/_ckdtree.pyx":1022
* if x_arr.ndim == 1: # scalar query, unpack result.
* result = result[()]
* return result # <<<<<<<<<<<<<<
*
* # ---------------
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":876
* # ----------------
*
* def query_ball_point(cKDTree self, object x, object r, # <<<<<<<<<<<<<<
* np.float64_t p=2.0, np.float64_t eps=0.0,
* object workers=None,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_12);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_14, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_15, 1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query_ball_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_x_arr);
__Pyx_XDECREF(__pyx_v_retshape);
__Pyx_XDECREF((PyObject *)__pyx_v_r_arr);
__Pyx_XDECREF(__pyx_v_result);
__Pyx_XDECREF(__pyx_v__thread_func);
__Pyx_DECREF((PyObject *)__pyx_cur_scope);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":1028
* # ---------------
*
* def query_ball_tree(cKDTree self, cKDTree other, # <<<<<<<<<<<<<<
* np.float64_t r, np.float64_t p=2.0, np.float64_t eps=0.0):
* """
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_11query_ball_tree(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_10query_ball_tree, "\n query_ball_tree(self, other, r, p=2.0, eps=0.0)\n\n Find all pairs of points between `self` and `other` whose distance is at most r\n\n Parameters\n ----------\n other : cKDTree instance\n The tree containing points to search against.\n r : float\n The maximum distance, has to be positive.\n p : float, optional\n Which Minkowski norm to use. `p` has to meet the condition\n ``1 <= p <= infinity``.\n A finite large p may cause a ValueError if overflow can occur.\n eps : float, optional\n Approximate search. Branches of the tree are not explored\n if their nearest points are further than ``r/(1+eps)``, and\n branches are added in bulk if their furthest points are nearer\n than ``r * (1+eps)``. `eps` has to be non-negative.\n\n Returns\n -------\n results : list of lists\n For each element ``self.data[i]`` of this tree, ``results[i]`` is a\n list of the indices of its neighbors in ``other.data``.\n\n Examples\n --------\n You can search all pairs of points between two kd-trees within a distance:\n\n >>> import matplotlib.pyplot as plt\n >>> import numpy as np\n >>> from scipy.spatial import cKDTree\n >>> rng = np.random.default_rng()\n >>> points1 = rng.random((15, 2))\n >>> points2 = rng.random((15, 2))\n >>> plt.figure(figsize=(6, 6))\n >>> plt.plot(points1[:, 0], points1[:, 1], \"xk\", markersize=14)\n >>> plt.plot(points2[:, 0], points2[:, 1], \"og\", markersize=14)\n >>> kd_tree1 = cKDTree(points1)\n >>> kd_tree2 = cKDTree(points2)\n >>> indexes = kd_tree1.query_ball_tree(kd_tree2, r=0.2)\n >>> for i in range(len(indexes)):\n ... for j in indexes[i]:\n ... plt.plot([points1[i, 0], points2[j, 0]],\n ... [points1""[i, 1], points2[j, 1]], \"-r\")\n >>> plt.show()\n\n ");
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_11query_ball_tree = {"query_ball_tree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_11query_ball_tree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_10query_ball_tree};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_11query_ball_tree(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_other = 0;
__pyx_t_5numpy_float64_t __pyx_v_r;
__pyx_t_5numpy_float64_t __pyx_v_p;
__pyx_t_5numpy_float64_t __pyx_v_eps;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[4] = {0,0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("query_ball_tree (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,&__pyx_mstate_global->__pyx_n_u_r,&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_eps,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1028, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1028, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1028, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1028, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1028, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "query_ball_tree", 0) < (0)) __PYX_ERR(0, 1028, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("query_ball_tree", 0, 2, 4, i); __PYX_ERR(0, 1028, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1028, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1028, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1028, __pyx_L3_error)
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1028, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_other = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)values[0]);
__pyx_v_r = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_r == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L3_error)
if (values[2]) {
__pyx_v_p = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_p == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L3_error)
} else {
__pyx_v_p = ((__pyx_t_5numpy_float64_t)2.0);
}
if (values[3]) {
__pyx_v_eps = __Pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L3_error)
} else {
__pyx_v_eps = ((__pyx_t_5numpy_float64_t)0.0);
}
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("query_ball_tree", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1028, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query_ball_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTree, 1, "other", 0))) __PYX_ERR(0, 1028, __pyx_L1_error)
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_10query_ball_tree(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v_other, __pyx_v_r, __pyx_v_p, __pyx_v_eps);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_10query_ball_tree(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_other, __pyx_t_5numpy_float64_t __pyx_v_r, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_eps) {
std::vector<std::vector<__pyx_t_5numpy_intp_t> > __pyx_v_vvres;
__pyx_t_5numpy_intp_t __pyx_v_i;
__pyx_t_5numpy_intp_t __pyx_v_j;
__pyx_t_5numpy_intp_t __pyx_v_n;
__pyx_t_5numpy_intp_t __pyx_v_m;
__pyx_t_5numpy_intp_t *__pyx_v_cur;
PyObject *__pyx_v_results = 0;
PyObject *__pyx_v_tmp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
size_t __pyx_t_5;
__pyx_t_5numpy_intp_t __pyx_t_6;
__pyx_t_5numpy_intp_t __pyx_t_7;
__pyx_t_5numpy_intp_t __pyx_t_8;
__pyx_t_5numpy_intp_t __pyx_t_9;
__pyx_t_5numpy_intp_t __pyx_t_10;
__pyx_t_5numpy_intp_t __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("query_ball_tree", 0);
/* "scipy/spatial/_ckdtree.pyx":1089
*
* # Make sure trees are compatible
* if self.m != other.m: # <<<<<<<<<<<<<<
* raise ValueError("Trees passed to query_ball_tree have different "
* "dimensionality")
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1089, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(__pyx_t_4)) {
/* "scipy/spatial/_ckdtree.pyx":1090
* # Make sure trees are compatible
* if self.m != other.m:
* raise ValueError("Trees passed to query_ball_tree have different " # <<<<<<<<<<<<<<
* "dimensionality")
*
*/
__pyx_t_2 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Trees_passed_to_query_ball_tree};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __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_ERR(0, 1090, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":1089
*
* # Make sure trees are compatible
* if self.m != other.m: # <<<<<<<<<<<<<<
* raise ValueError("Trees passed to query_ball_tree have different "
* "dimensionality")
*/
}
/* "scipy/spatial/_ckdtree.pyx":1093
* "dimensionality")
*
* n = self.n # <<<<<<<<<<<<<<
*
* # allocate an array of std::vector<npy_intp>
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __Pyx_PyLong_As_npy_intp(__pyx_t_3); if (unlikely((__pyx_t_6 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1093, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_n = __pyx_t_6;
/* "scipy/spatial/_ckdtree.pyx":1096
*
* # allocate an array of std::vector<npy_intp>
* vvres.resize(n) # <<<<<<<<<<<<<<
*
* # query in C++
*/
try {
__pyx_v_vvres.resize(__pyx_v_n);
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(0, 1096, __pyx_L1_error)
}
/* "scipy/spatial/_ckdtree.pyx":1099
*
* # query in C++
* with nogil: # <<<<<<<<<<<<<<
* query_ball_tree(self.cself, other.cself, r, p, eps, vvres.data())
*
*/
{
PyThreadState * _save;
_save = PyEval_SaveThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
/* "scipy/spatial/_ckdtree.pyx":1100
* # query in C++
* with nogil:
* query_ball_tree(self.cself, other.cself, r, p, eps, vvres.data()) # <<<<<<<<<<<<<<
*
* # store the results in a list of lists
*/
try {
query_ball_tree(__pyx_v_self->cself, __pyx_v_other->cself, __pyx_v_r, __pyx_v_p, __pyx_v_eps, __pyx_v_vvres.data());
} catch(...) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_CppExn2PyErr();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__PYX_ERR(0, 1100, __pyx_L5_error)
}
}
/* "scipy/spatial/_ckdtree.pyx":1099
*
* # query in C++
* with nogil: # <<<<<<<<<<<<<<
* query_ball_tree(self.cself, other.cself, r, p, eps, vvres.data())
*
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L6;
}
__pyx_L5_error: {
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L1_error;
}
__pyx_L6:;
}
}
/* "scipy/spatial/_ckdtree.pyx":1103
*
* # store the results in a list of lists
* results = n * [None] # <<<<<<<<<<<<<<
* for i in range(n):
* m = <np.intp_t> (vvres[i].size())
*/
__pyx_t_3 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
{ Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
if (__Pyx_PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 1103, __pyx_L1_error);
}
}
__pyx_v_results = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":1104
* # store the results in a list of lists
* results = n * [None]
* for i in range(n): # <<<<<<<<<<<<<<
* m = <np.intp_t> (vvres[i].size())
* if (m > 0):
*/
__pyx_t_6 = __pyx_v_n;
__pyx_t_7 = __pyx_t_6;
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
__pyx_v_i = __pyx_t_8;
/* "scipy/spatial/_ckdtree.pyx":1105
* results = n * [None]
* for i in range(n):
* m = <np.intp_t> (vvres[i].size()) # <<<<<<<<<<<<<<
* if (m > 0):
* tmp = m * [None]
*/
__pyx_v_m = ((__pyx_t_5numpy_intp_t)(__pyx_v_vvres[__pyx_v_i]).size());
/* "scipy/spatial/_ckdtree.pyx":1106
* for i in range(n):
* m = <np.intp_t> (vvres[i].size())
* if (m > 0): # <<<<<<<<<<<<<<
* tmp = m * [None]
* cur = vvres[i].data()
*/
__pyx_t_4 = (__pyx_v_m > 0);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1107
* m = <np.intp_t> (vvres[i].size())
* if (m > 0):
* tmp = m * [None] # <<<<<<<<<<<<<<
* cur = vvres[i].data()
* for j in range(m):
*/
__pyx_t_3 = PyList_New(1 * ((__pyx_v_m<0) ? 0:__pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
{ Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < __pyx_v_m; __pyx_temp++) {
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
if (__Pyx_PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 1107, __pyx_L1_error);
}
}
__Pyx_XDECREF_SET(__pyx_v_tmp, ((PyObject*)__pyx_t_3));
__pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":1108
* if (m > 0):
* tmp = m * [None]
* cur = vvres[i].data() # <<<<<<<<<<<<<<
* for j in range(m):
* tmp[j] = cur[j]
*/
__pyx_v_cur = (__pyx_v_vvres[__pyx_v_i]).data();
/* "scipy/spatial/_ckdtree.pyx":1109
* tmp = m * [None]
* cur = vvres[i].data()
* for j in range(m): # <<<<<<<<<<<<<<
* tmp[j] = cur[j]
* results[i] = tmp
*/
__pyx_t_9 = __pyx_v_m;
__pyx_t_10 = __pyx_t_9;
for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
__pyx_v_j = __pyx_t_11;
/* "scipy/spatial/_ckdtree.pyx":1110
* cur = vvres[i].data()
* for j in range(m):
* tmp[j] = cur[j] # <<<<<<<<<<<<<<
* results[i] = tmp
* else:
*/
__pyx_t_3 = __Pyx_PyLong_From_npy_intp((__pyx_v_cur[__pyx_v_j])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1110, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__pyx_v_tmp == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1110, __pyx_L1_error)
}
if (unlikely((__Pyx_SetItemInt(__pyx_v_tmp, __pyx_v_j, __pyx_t_3, __pyx_t_5numpy_intp_t, 1, __Pyx_PyLong_From_npy_intp, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 1110, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
/* "scipy/spatial/_ckdtree.pyx":1111
* for j in range(m):
* tmp[j] = cur[j]
* results[i] = tmp # <<<<<<<<<<<<<<
* else:
* results[i] = []
*/
if (unlikely(__pyx_v_results == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1111, __pyx_L1_error)
}
if (unlikely((__Pyx_SetItemInt(__pyx_v_results, __pyx_v_i, __pyx_v_tmp, __pyx_t_5numpy_intp_t, 1, __Pyx_PyLong_From_npy_intp, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 1111, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":1106
* for i in range(n):
* m = <np.intp_t> (vvres[i].size())
* if (m > 0): # <<<<<<<<<<<<<<
* tmp = m * [None]
* cur = vvres[i].data()
*/
goto __pyx_L9;
}
/* "scipy/spatial/_ckdtree.pyx":1113
* results[i] = tmp
* else:
* results[i] = [] # <<<<<<<<<<<<<<
*
* return results
*/
/*else*/ {
__pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__pyx_v_results == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 1113, __pyx_L1_error)
}
if (unlikely((__Pyx_SetItemInt(__pyx_v_results, __pyx_v_i, __pyx_t_3, __pyx_t_5numpy_intp_t, 1, __Pyx_PyLong_From_npy_intp, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 1113, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L9:;
}
/* "scipy/spatial/_ckdtree.pyx":1115
* results[i] = []
*
* return results # <<<<<<<<<<<<<<
*
* # -----------
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_results);
__pyx_r = __pyx_v_results;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1028
* # ---------------
*
* def query_ball_tree(cKDTree self, cKDTree other, # <<<<<<<<<<<<<<
* np.float64_t r, np.float64_t p=2.0, np.float64_t eps=0.0):
* """
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query_ball_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_results);
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":1121
* # -----------
*
* def query_pairs(cKDTree self, np.float64_t r, np.float64_t p=2.0, # <<<<<<<<<<<<<<
* np.float64_t eps=0.0, output_type='set'):
* """
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_13query_pairs(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_12query_pairs, "\n query_pairs(self, r, p=2.0, eps=0.0, output_type='set')\n\n Find all pairs of points in `self` whose distance is at most r.\n\n Parameters\n ----------\n r : positive float\n The maximum distance.\n p : float, optional\n Which Minkowski norm to use. ``p`` has to meet the condition\n ``1 <= p <= infinity``.\n A finite large p may cause a ValueError if overflow can occur.\n eps : float, optional\n Approximate search. Branches of the tree are not explored\n if their nearest points are further than ``r/(1+eps)``, and\n branches are added in bulk if their furthest points are nearer\n than ``r * (1+eps)``. `eps` has to be non-negative.\n output_type : str, optional\n Choose the output container, 'set' or 'ndarray'. Default: 'set'\n\n Returns\n -------\n results : set or ndarray\n Set of pairs ``(i,j)``, with ``i < j``, for which the corresponding\n positions are close. If output_type is 'ndarray', an ndarray is\n returned instead of a set.\n\n Examples\n --------\n You can search all pairs of points in a kd-tree within a distance:\n\n >>> import matplotlib.pyplot as plt\n >>> import numpy as np\n >>> from scipy.spatial import cKDTree\n >>> rng = np.random.default_rng()\n >>> points = rng.random((20, 2))\n >>> plt.figure(figsize=(6, 6))\n >>> plt.plot(points[:, 0], points[:, 1], \"xk\", markersize=14)\n >>> kd_tree = cKDTree(points)\n >>> pairs = kd_tree.query_pairs(r=0.2)\n >>> for (i, j) in pairs:\n ... plt.plot([points[i, 0], points[j, 0]],\n ... [points[i, 1], points[j, 1]], \"-r\")\n >>> plt.show()\n\n ");
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_13query_pairs = {"query_pairs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_13query_pairs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_12query_pairs};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_13query_pairs(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
__pyx_t_5numpy_float64_t __pyx_v_r;
__pyx_t_5numpy_float64_t __pyx_v_p;
__pyx_t_5numpy_float64_t __pyx_v_eps;
PyObject *__pyx_v_output_type = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[4] = {0,0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("query_pairs (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_r,&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_eps,&__pyx_mstate_global->__pyx_n_u_output_type,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1121, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1121, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1121, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1121, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1121, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "query_pairs", 0) < (0)) __PYX_ERR(0, 1121, __pyx_L3_error)
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_set));
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("query_pairs", 0, 1, 4, i); __PYX_ERR(0, 1121, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1121, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1121, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1121, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1121, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_set));
}
__pyx_v_r = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_r == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L3_error)
if (values[1]) {
__pyx_v_p = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_p == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L3_error)
} else {
__pyx_v_p = ((__pyx_t_5numpy_float64_t)2.0);
}
if (values[2]) {
__pyx_v_eps = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L3_error)
} else {
__pyx_v_eps = ((__pyx_t_5numpy_float64_t)0.0);
}
__pyx_v_output_type = values[3];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("query_pairs", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 1121, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_12query_pairs(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v_r, __pyx_v_p, __pyx_v_eps, __pyx_v_output_type);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_12query_pairs(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_r, __pyx_t_5numpy_float64_t __pyx_v_p, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_output_type) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *__pyx_v_results = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
size_t __pyx_t_3;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("query_pairs", 0);
/* "scipy/spatial/_ckdtree.pyx":1173
* cdef ordered_pairs results
*
* results = ordered_pairs() # <<<<<<<<<<<<<<
*
* with nogil:
*/
__pyx_t_2 = NULL;
__pyx_t_3 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree_ordered_pairs, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_1);
}
__pyx_v_results = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree_ordered_pairs *)__pyx_t_1);
__pyx_t_1 = 0;
/* "scipy/spatial/_ckdtree.pyx":1175
* results = ordered_pairs()
*
* with nogil: # <<<<<<<<<<<<<<
* query_pairs(self.cself, r, p, eps, results.buf)
*
*/
{
PyThreadState * _save;
_save = PyEval_SaveThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
/* "scipy/spatial/_ckdtree.pyx":1176
*
* with nogil:
* query_pairs(self.cself, r, p, eps, results.buf) # <<<<<<<<<<<<<<
*
* if output_type == 'set':
*/
try {
query_pairs(__pyx_v_self->cself, __pyx_v_r, __pyx_v_p, __pyx_v_eps, __pyx_v_results->buf);
} catch(...) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_CppExn2PyErr();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__PYX_ERR(0, 1176, __pyx_L4_error)
}
}
/* "scipy/spatial/_ckdtree.pyx":1175
* results = ordered_pairs()
*
* with nogil: # <<<<<<<<<<<<<<
* query_pairs(self.cself, r, p, eps, results.buf)
*
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L5;
}
__pyx_L4_error: {
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L1_error;
}
__pyx_L5:;
}
}
/* "scipy/spatial/_ckdtree.pyx":1178
* query_pairs(self.cself, r, p, eps, results.buf)
*
* if output_type == 'set': # <<<<<<<<<<<<<<
* return results.set()
* elif output_type == 'ndarray':
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_output_type, __pyx_mstate_global->__pyx_n_u_set, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error)
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1179
*
* if output_type == 'set':
* return results.set() # <<<<<<<<<<<<<<
* elif output_type == 'ndarray':
* return results.ndarray()
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_v_results);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1178
* query_pairs(self.cself, r, p, eps, results.buf)
*
* if output_type == 'set': # <<<<<<<<<<<<<<
* return results.set()
* elif output_type == 'ndarray':
*/
}
/* "scipy/spatial/_ckdtree.pyx":1180
* if output_type == 'set':
* return results.set()
* elif output_type == 'ndarray': # <<<<<<<<<<<<<<
* return results.ndarray()
* else:
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_output_type, __pyx_mstate_global->__pyx_n_u_ndarray, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error)
if (likely(__pyx_t_4)) {
/* "scipy/spatial/_ckdtree.pyx":1181
* return results.set()
* elif output_type == 'ndarray':
* return results.ndarray() # <<<<<<<<<<<<<<
* else:
* raise ValueError("Invalid output type")
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_v_results);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_ndarray, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1180
* if output_type == 'set':
* return results.set()
* elif output_type == 'ndarray': # <<<<<<<<<<<<<<
* return results.ndarray()
* else:
*/
}
/* "scipy/spatial/_ckdtree.pyx":1183
* return results.ndarray()
* else:
* raise ValueError("Invalid output type") # <<<<<<<<<<<<<<
*
* def _build_weights(cKDTree self, object weights):
*/
/*else*/ {
__pyx_t_2 = NULL;
__pyx_t_3 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Invalid_output_type};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(0, 1183, __pyx_L1_error)
}
/* "scipy/spatial/_ckdtree.pyx":1121
* # -----------
*
* def query_pairs(cKDTree self, np.float64_t r, np.float64_t p=2.0, # <<<<<<<<<<<<<<
* np.float64_t eps=0.0, output_type='set'):
* """
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.query_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_results);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":1185
* raise ValueError("Invalid output type")
*
* def _build_weights(cKDTree self, object weights): # <<<<<<<<<<<<<<
* """
* _build_weights(weights)
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_15_build_weights(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_14_build_weights, "\n _build_weights(weights)\n\n Compute weights of nodes from weights of data points. This will sum\n up the total weight per node. This function is used internally.\n\n Parameters\n ----------\n weights : array_like\n weights of data points; must be the same length as the data points.\n currently only scalar weights are supported. Therefore the weights\n array must be 1 dimensional.\n\n Returns\n -------\n node_weights : array_like\n total weight for each KD-Tree node.\n\n ");
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_15_build_weights = {"_build_weights", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_15_build_weights, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_14_build_weights};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_15_build_weights(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_weights = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[1] = {0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_build_weights (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_weights,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1185, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1185, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_build_weights", 0) < (0)) __PYX_ERR(0, 1185, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_build_weights", 1, 1, 1, i); __PYX_ERR(0, 1185, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1185, __pyx_L3_error)
}
__pyx_v_weights = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_build_weights", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1185, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree._build_weights", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_14_build_weights(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v_weights);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_14_build_weights(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_weights) {
__pyx_t_5numpy_intp_t __pyx_v_num_of_nodes;
__Pyx_memviewslice __pyx_v_node_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_proper_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__pyx_t_5numpy_float64_t *__pyx_v_pnw;
__pyx_t_5numpy_float64_t *__pyx_v_ppw;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
size_t __pyx_t_7;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
Py_ssize_t __pyx_t_9;
int __pyx_t_10;
Py_ssize_t __pyx_t_11;
int __pyx_t_12;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_build_weights", 0);
/* "scipy/spatial/_ckdtree.pyx":1212
* np.float64_t *ppw
*
* num_of_nodes = self.cself.tree_buffer.size(); # <<<<<<<<<<<<<<
* node_weights = np.empty(num_of_nodes, dtype=np.float64)
*
*/
__pyx_v_num_of_nodes = __pyx_v_self->cself->tree_buffer->size();
/* "scipy/spatial/_ckdtree.pyx":1213
*
* num_of_nodes = self.cself.tree_buffer.size();
* node_weights = np.empty(num_of_nodes, dtype=np.float64) # <<<<<<<<<<<<<<
*
* # FIXME: use templates to avoid the type conversion
*/
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyLong_From_npy_intp(__pyx_v_num_of_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_7 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
assert(__pyx_t_2);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
__pyx_t_7 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_3};
__pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1213, __pyx_L1_error)
__pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1213, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_node_weights = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":1216
*
* # FIXME: use templates to avoid the type conversion
* proper_weights = np.ascontiguousarray(weights, dtype=np.float64) # <<<<<<<<<<<<<<
*
* if len(proper_weights) != self.n:
*/
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_7 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
assert(__pyx_t_4);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
__pyx_t_7 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_weights};
__pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1216, __pyx_L1_error)
__pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1216, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_proper_weights = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":1218
* proper_weights = np.ascontiguousarray(weights, dtype=np.float64)
*
* if len(proper_weights) != self.n: # <<<<<<<<<<<<<<
* raise ValueError('Number of weights differ from the number of data points')
*
*/
__pyx_t_9 = __Pyx_MemoryView_Len(__pyx_v_proper_weights);
__pyx_t_1 = PyLong_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1218, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_t_10)) {
/* "scipy/spatial/_ckdtree.pyx":1219
*
* if len(proper_weights) != self.n:
* raise ValueError('Number of weights differ from the number of data points') # <<<<<<<<<<<<<<
*
* pnw = &node_weights[0]
*/
__pyx_t_6 = NULL;
__pyx_t_7 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Number_of_weights_differ_from_th};
__pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1219, __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_ERR(0, 1219, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":1218
* proper_weights = np.ascontiguousarray(weights, dtype=np.float64)
*
* if len(proper_weights) != self.n: # <<<<<<<<<<<<<<
* raise ValueError('Number of weights differ from the number of data points')
*
*/
}
/* "scipy/spatial/_ckdtree.pyx":1221
* raise ValueError('Number of weights differ from the number of data points')
*
* pnw = &node_weights[0] # <<<<<<<<<<<<<<
* ppw = &proper_weights[0]
*
*/
__pyx_t_11 = 0;
__pyx_t_12 = -1;
if (__pyx_t_11 < 0) {
__pyx_t_11 += __pyx_v_node_weights.shape[0];
if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
} else if (unlikely(__pyx_t_11 >= __pyx_v_node_weights.shape[0])) __pyx_t_12 = 0;
if (unlikely(__pyx_t_12 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_12);
__PYX_ERR(0, 1221, __pyx_L1_error)
}
__pyx_v_pnw = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_node_weights.data) + __pyx_t_11)) ))));
/* "scipy/spatial/_ckdtree.pyx":1222
*
* pnw = &node_weights[0]
* ppw = &proper_weights[0] # <<<<<<<<<<<<<<
*
* with nogil:
*/
__pyx_t_11 = 0;
__pyx_t_12 = -1;
if (__pyx_t_11 < 0) {
__pyx_t_11 += __pyx_v_proper_weights.shape[0];
if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
} else if (unlikely(__pyx_t_11 >= __pyx_v_proper_weights.shape[0])) __pyx_t_12 = 0;
if (unlikely(__pyx_t_12 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_12);
__PYX_ERR(0, 1222, __pyx_L1_error)
}
__pyx_v_ppw = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_proper_weights.data) + __pyx_t_11)) ))));
/* "scipy/spatial/_ckdtree.pyx":1224
* ppw = &proper_weights[0]
*
* with nogil: # <<<<<<<<<<<<<<
* build_weights(self.cself, pnw, ppw)
*
*/
{
PyThreadState * _save;
_save = PyEval_SaveThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
/* "scipy/spatial/_ckdtree.pyx":1225
*
* with nogil:
* build_weights(self.cself, pnw, ppw) # <<<<<<<<<<<<<<
*
* return node_weights
*/
try {
build_weights(__pyx_v_self->cself, __pyx_v_pnw, __pyx_v_ppw);
} catch(...) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_CppExn2PyErr();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__PYX_ERR(0, 1225, __pyx_L5_error)
}
}
/* "scipy/spatial/_ckdtree.pyx":1224
* ppw = &proper_weights[0]
*
* with nogil: # <<<<<<<<<<<<<<
* build_weights(self.cself, pnw, ppw)
*
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L6;
}
__pyx_L5_error: {
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L1_error;
}
__pyx_L6:;
}
}
/* "scipy/spatial/_ckdtree.pyx":1227
* build_weights(self.cself, pnw, ppw)
*
* return node_weights # <<<<<<<<<<<<<<
*
* # ---------------
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_node_weights, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1185
* raise ValueError("Invalid output type")
*
* def _build_weights(cKDTree self, object weights): # <<<<<<<<<<<<<<
* """
* _build_weights(weights)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree._build_weights", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XCLEAR_MEMVIEW(&__pyx_v_node_weights, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_v_proper_weights, 1);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":1233
* # ---------------
*
* @cython.boundscheck(False) # <<<<<<<<<<<<<<
* def count_neighbors(cKDTree self, cKDTree other, object r, np.float64_t p=2.0,
* object weights=None, int cumulative=True):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_17count_neighbors(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_16count_neighbors, "\n count_neighbors(self, other, r, p=2.0, weights=None, cumulative=True)\n\n Count how many nearby pairs can be formed.\n\n Count the number of pairs ``(x1,x2)`` can be formed, with ``x1`` drawn\n from ``self`` and ``x2`` drawn from ``other``, and where\n ``distance(x1, x2, p) <= r``.\n\n Data points on ``self`` and ``other`` are optionally weighted by the\n ``weights`` argument. (See below)\n\n This is adapted from the \"two-point correlation\" algorithm described by\n Gray and Moore [1]_. See notes for further discussion.\n\n Parameters\n ----------\n other : cKDTree instance\n The other tree to draw points from, can be the same tree as self.\n r : float or one-dimensional array of floats\n The radius to produce a count for. Multiple radii are searched with\n a single tree traversal.\n If the count is non-cumulative (``cumulative=False``), ``r``\n defines the edges of the bins, and must be non-decreasing.\n p : float, optional\n 1<=p<=infinity.\n Which Minkowski p-norm to use.\n Default 2.0.\n A finite large p may cause a ValueError if overflow can occur.\n weights : tuple, array_like, or None, optional\n If None, the pair-counting is unweighted.\n If given as a tuple, weights[0] is the weights of points in ``self``, and\n weights[1] is the weights of points in ``other``; either can be None to\n indicate the points are unweighted.\n If given as an array_like, weights is the weights of points in ``self``\n and ``other``. For this to make sense, ``self`` and ``other`` must be the\n same tree. If ``self`` and ``other`` are two different trees, a ``ValueError``\n is raised.\n Default: None\n cumulative : bool, optional\n Whether the returned counts are"" cumulative. When cumulative is set to ``False``\n the algorithm is optimized to work with a large number of bins (>10) specified\n by ``r``. When ``cumulative`` is set to True, the algorithm is optimized to work\n with a small number of ``r``. Default: True\n\n Returns\n -------\n result : scalar or 1-D array\n The number of pairs. For unweighted counts, the result is integer.\n For weighted counts, the result is float.\n If cumulative is False, ``result[i]`` contains the counts with\n ``(-inf if i == 0 else r[i-1]) < R <= r[i]``\n\n Notes\n -----\n Pair-counting is the basic operation used to calculate the two point\n correlation functions from a data set composed of position of objects.\n\n Two point correlation function measures the clustering of objects and\n is widely used in cosmology to quantify the large scale structure\n in our Universe, but it may be useful for data analysis in other fields\n where self-similar assembly of objects also occur.\n\n The Landy-Szalay estimator for the two point correlation function of\n ``D`` measures the clustering signal in ``D``. [2]_\n\n For example, given the position of two sets of objects,\n\n - objects ``D`` (data) contains the clustering signal, and\n\n - objects ``R`` (random) that contains no signal,\n\n .. math::\n\n \\xi(r) = \\frac{<D, D> - 2 f <D, R> + f^2<R, R>}{f^2<R, R>},\n\n where the brackets represents counting pairs between two data sets\n in a finite bin around ``r`` (distance), corresponding to setting\n ``cumulative=False``, and ``f = float(len(D)) / float(len(R))`` is the\n ratio between number of objects from data and random.\n\n The algorithm implemented here is loosely based on the dual-tree\n algorithm described in [1]_. We switch between two differen""t\n pair-cumulation scheme depending on the setting of ``cumulative``.\n The computing time of the method we use when for\n ``cumulative == False`` does not scale with the total number of bins.\n The algorithm for ``cumulative == True`` scales linearly with the\n number of bins, though it is slightly faster when only\n 1 or 2 bins are used. [5]_.\n\n As an extension to the naive pair-counting,\n weighted pair-counting counts the product of weights instead\n of number of pairs.\n Weighted pair-counting is used to estimate marked correlation functions\n ([3]_, section 2.2),\n or to properly calculate the average of data per distance bin\n (e.g. [4]_, section 2.1 on redshift).\n\n .. [1] Gray and Moore,\n \"N-body problems in statistical learning\",\n Mining the sky, 2000, :arxiv:`astro-ph/0012333`\n\n .. [2] Landy and Szalay,\n \"Bias and variance of angular correlation functions\",\n The Astrophysical Journal, 1993, :doi:`10.1086/172900`\n\n .. [3] Sheth, Connolly and Skibba,\n \"Marked correlations in galaxy formation models\",\n 2005, :arxiv:`astro-ph/0511773`\n\n .. [4] Hawkins, et al.,\n \"The 2dF Galaxy Redshift Survey: correlation functions,\n peculiar velocities and the matter density of the Universe\",\n Monthly Notices of the Royal Astronomical Society, 2002,\n :doi:`10.1046/j.1365-2966.2003.07063.x`\n\n .. [5] https://github.com/scipy/scipy/pull/5647#issuecomment-168474926\n\n Examples\n --------\n You can count neighbors number between two kd-trees within a distance:\n\n >>> import numpy as np\n >>> from scipy.spatial import cKDTree\n >>> rng = np.random.default_rng()\n >>> points1 = rng.random((5, 2))\n >>> points2 = rng.random((5, 2))""\n >>> kd_tree1 = cKDTree(points1)\n >>> kd_tree2 = cKDTree(points2)\n >>> kd_tree1.count_neighbors(kd_tree2, 0.2)\n 1\n\n This number is same as the total pair number calculated by\n `query_ball_tree`:\n\n >>> indexes = kd_tree1.query_ball_tree(kd_tree2, r=0.2)\n >>> sum([len(i) for i in indexes])\n 1\n\n ");
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_17count_neighbors = {"count_neighbors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_17count_neighbors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_16count_neighbors};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_17count_neighbors(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_other = 0;
PyObject *__pyx_v_r = 0;
__pyx_t_5numpy_float64_t __pyx_v_p;
PyObject *__pyx_v_weights = 0;
int __pyx_v_cumulative;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[5] = {0,0,0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("count_neighbors (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,&__pyx_mstate_global->__pyx_n_u_r,&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_weights,&__pyx_mstate_global->__pyx_n_u_cumulative,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1233, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 5:
values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1233, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1233, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1233, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1233, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1233, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "count_neighbors", 0) < (0)) __PYX_ERR(0, 1233, __pyx_L3_error)
/* "scipy/spatial/_ckdtree.pyx":1235
* @cython.boundscheck(False)
* def count_neighbors(cKDTree self, cKDTree other, object r, np.float64_t p=2.0,
* object weights=None, int cumulative=True): # <<<<<<<<<<<<<<
* """
* count_neighbors(self, other, r, p=2.0, weights=None, cumulative=True)
*/
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("count_neighbors", 0, 2, 5, i); __PYX_ERR(0, 1233, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 5:
values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1233, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1233, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1233, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1233, __pyx_L3_error)
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1233, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
}
__pyx_v_other = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)values[0]);
__pyx_v_r = values[1];
if (values[2]) {
__pyx_v_p = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_p == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1234, __pyx_L3_error)
} else {
__pyx_v_p = ((__pyx_t_5numpy_float64_t)2.0);
}
__pyx_v_weights = values[3];
if (values[4]) {
__pyx_v_cumulative = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_cumulative == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1235, __pyx_L3_error)
} else {
__pyx_v_cumulative = ((int)1);
}
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("count_neighbors", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 1233, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.count_neighbors", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTree, 1, "other", 0))) __PYX_ERR(0, 1234, __pyx_L1_error)
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_16count_neighbors(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v_other, __pyx_v_r, __pyx_v_p, __pyx_v_weights, __pyx_v_cumulative);
/* "scipy/spatial/_ckdtree.pyx":1233
* # ---------------
*
* @cython.boundscheck(False) # <<<<<<<<<<<<<<
* def count_neighbors(cKDTree self, cKDTree other, object r, np.float64_t p=2.0,
* object weights=None, int cumulative=True):
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_16count_neighbors(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_other, PyObject *__pyx_v_r, __pyx_t_5numpy_float64_t __pyx_v_p, PyObject *__pyx_v_weights, int __pyx_v_cumulative) {
int __pyx_v_r_ndim;
__pyx_t_5numpy_intp_t __pyx_v_n_queries;
__pyx_t_5numpy_intp_t __pyx_v_i;
__Pyx_memviewslice __pyx_v_real_r = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_fresults = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_iresults = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_w1 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_w1n = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_w2 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_w2n = { 0, 0, { 0 }, { 0 }, { 0 } };
__pyx_t_5numpy_float64_t *__pyx_v_w1p;
__pyx_t_5numpy_float64_t *__pyx_v_w1np;
__pyx_t_5numpy_float64_t *__pyx_v_w2p;
__pyx_t_5numpy_float64_t *__pyx_v_w2np;
__pyx_t_5numpy_float64_t *__pyx_v_prr;
__pyx_t_5numpy_intp_t *__pyx_v_pir;
__pyx_t_5numpy_float64_t *__pyx_v_pfr;
int __pyx_v_cum;
PyObject *__pyx_v_uind = NULL;
PyObject *__pyx_v_inverse = NULL;
PyObject *__pyx_v_self_weights = NULL;
PyObject *__pyx_v_other_weights = NULL;
int __pyx_v_int_result;
PyObject *__pyx_v_results = NULL;
PyObject *__pyx_v_results2 = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
size_t __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
Py_ssize_t __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
__Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
Py_ssize_t __pyx_t_10;
__pyx_t_5numpy_intp_t __pyx_t_11;
Py_ssize_t __pyx_t_12;
Py_ssize_t __pyx_t_13;
PyObject *(*__pyx_t_14)(PyObject *);
__pyx_t_5numpy_intp_t __pyx_t_15;
__pyx_t_5numpy_intp_t __pyx_t_16;
int __pyx_t_17;
PyObject *__pyx_t_18 = NULL;
__Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("count_neighbors", 0);
/* "scipy/spatial/_ckdtree.pyx":1384
* np.float64_t[::1] w1, w1n
* np.float64_t[::1] w2, w2n
* np.float64_t *w1p = NULL # <<<<<<<<<<<<<<
* np.float64_t *w1np = NULL
* np.float64_t *w2p = NULL
*/
__pyx_v_w1p = NULL;
/* "scipy/spatial/_ckdtree.pyx":1385
* np.float64_t[::1] w2, w2n
* np.float64_t *w1p = NULL
* np.float64_t *w1np = NULL # <<<<<<<<<<<<<<
* np.float64_t *w2p = NULL
* np.float64_t *w2np = NULL
*/
__pyx_v_w1np = NULL;
/* "scipy/spatial/_ckdtree.pyx":1386
* np.float64_t *w1p = NULL
* np.float64_t *w1np = NULL
* np.float64_t *w2p = NULL # <<<<<<<<<<<<<<
* np.float64_t *w2np = NULL
* np.float64_t *prr
*/
__pyx_v_w2p = NULL;
/* "scipy/spatial/_ckdtree.pyx":1387
* np.float64_t *w1np = NULL
* np.float64_t *w2p = NULL
* np.float64_t *w2np = NULL # <<<<<<<<<<<<<<
* np.float64_t *prr
* np.intp_t *pir
*/
__pyx_v_w2np = NULL;
/* "scipy/spatial/_ckdtree.pyx":1394
*
* # Make sure trees are compatible
* if self.m != other.m: # <<<<<<<<<<<<<<
* raise ValueError("Trees passed to count_neighbors have different "
* "dimensionality")
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1394, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(__pyx_t_4)) {
/* "scipy/spatial/_ckdtree.pyx":1395
* # Make sure trees are compatible
* if self.m != other.m:
* raise ValueError("Trees passed to count_neighbors have different " # <<<<<<<<<<<<<<
* "dimensionality")
*
*/
__pyx_t_2 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Trees_passed_to_count_neighbors};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1395, __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_ERR(0, 1395, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":1394
*
* # Make sure trees are compatible
* if self.m != other.m: # <<<<<<<<<<<<<<
* raise ValueError("Trees passed to count_neighbors have different "
* "dimensionality")
*/
}
/* "scipy/spatial/_ckdtree.pyx":1400
* # Make a copy of r array to ensure it's contiguous and to modify it
* # below
* r_ndim = len(np.shape(r)) # <<<<<<<<<<<<<<
* if r_ndim > 1:
* raise ValueError("r must be either a single value or a "
*/
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
assert(__pyx_t_2);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_r};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1400, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_r_ndim = __pyx_t_7;
/* "scipy/spatial/_ckdtree.pyx":1401
* # below
* r_ndim = len(np.shape(r))
* if r_ndim > 1: # <<<<<<<<<<<<<<
* raise ValueError("r must be either a single value or a "
* "one-dimensional array of values")
*/
__pyx_t_4 = (__pyx_v_r_ndim > 1);
if (unlikely(__pyx_t_4)) {
/* "scipy/spatial/_ckdtree.pyx":1402
* r_ndim = len(np.shape(r))
* if r_ndim > 1:
* raise ValueError("r must be either a single value or a " # <<<<<<<<<<<<<<
* "one-dimensional array of values")
* real_r = np.array(r, ndmin=1, dtype=np.float64, copy=True)
*/
__pyx_t_6 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_r_must_be_either_a_single_value};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1402, __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_ERR(0, 1402, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":1401
* # below
* r_ndim = len(np.shape(r))
* if r_ndim > 1: # <<<<<<<<<<<<<<
* raise ValueError("r must be either a single value or a "
* "one-dimensional array of values")
*/
}
/* "scipy/spatial/_ckdtree.pyx":1404
* raise ValueError("r must be either a single value or a "
* "one-dimensional array of values")
* real_r = np.array(r, ndmin=1, dtype=np.float64, copy=True) # <<<<<<<<<<<<<<
* if not cumulative:
* for i in range(real_r.shape[0] - 1):
*/
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
assert(__pyx_t_6);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_6, __pyx_v_r};
__pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ndmin, __pyx_mstate_global->__pyx_int_1, __pyx_t_2, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1404, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_2, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 1404, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_True, __pyx_t_2, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 1404, __pyx_L1_error)
__pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1404, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_real_r = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":1405
* "one-dimensional array of values")
* real_r = np.array(r, ndmin=1, dtype=np.float64, copy=True)
* if not cumulative: # <<<<<<<<<<<<<<
* for i in range(real_r.shape[0] - 1):
* if real_r[i] > real_r[i + 1]:
*/
__pyx_t_4 = (!(__pyx_v_cumulative != 0));
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1406
* real_r = np.array(r, ndmin=1, dtype=np.float64, copy=True)
* if not cumulative:
* for i in range(real_r.shape[0] - 1): # <<<<<<<<<<<<<<
* if real_r[i] > real_r[i + 1]:
* raise ValueError("r must be non-decreasing for non-cumulative counting.");
*/
__pyx_t_7 = ((__pyx_v_real_r.shape[0]) - 1);
__pyx_t_10 = __pyx_t_7;
for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
__pyx_v_i = __pyx_t_11;
/* "scipy/spatial/_ckdtree.pyx":1407
* if not cumulative:
* for i in range(real_r.shape[0] - 1):
* if real_r[i] > real_r[i + 1]: # <<<<<<<<<<<<<<
* raise ValueError("r must be non-decreasing for non-cumulative counting.");
* real_r, uind, inverse = np.unique(real_r, return_inverse=True, return_index=True)
*/
__pyx_t_12 = __pyx_v_i;
if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_real_r.shape[0];
__pyx_t_13 = (__pyx_v_i + 1);
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_real_r.shape[0];
__pyx_t_4 = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_real_r.data) + __pyx_t_12)) ))) > (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_real_r.data) + __pyx_t_13)) ))));
if (unlikely(__pyx_t_4)) {
/* "scipy/spatial/_ckdtree.pyx":1408
* for i in range(real_r.shape[0] - 1):
* if real_r[i] > real_r[i + 1]:
* raise ValueError("r must be non-decreasing for non-cumulative counting."); # <<<<<<<<<<<<<<
* real_r, uind, inverse = np.unique(real_r, return_inverse=True, return_index=True)
* n_queries = real_r.shape[0]
*/
__pyx_t_1 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_r_must_be_non_decreasing_for_non};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __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_ERR(0, 1408, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":1407
* if not cumulative:
* for i in range(real_r.shape[0] - 1):
* if real_r[i] > real_r[i + 1]: # <<<<<<<<<<<<<<
* raise ValueError("r must be non-decreasing for non-cumulative counting.");
* real_r, uind, inverse = np.unique(real_r, return_inverse=True, return_index=True)
*/
}
}
/* "scipy/spatial/_ckdtree.pyx":1405
* "one-dimensional array of values")
* real_r = np.array(r, ndmin=1, dtype=np.float64, copy=True)
* if not cumulative: # <<<<<<<<<<<<<<
* for i in range(real_r.shape[0] - 1):
* if real_r[i] > real_r[i + 1]:
*/
}
/* "scipy/spatial/_ckdtree.pyx":1409
* if real_r[i] > real_r[i + 1]:
* raise ValueError("r must be non-decreasing for non-cumulative counting.");
* real_r, uind, inverse = np.unique(real_r, return_inverse=True, return_index=True) # <<<<<<<<<<<<<<
* n_queries = real_r.shape[0]
*
*/
__pyx_t_1 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_unique); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_real_r, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
assert(__pyx_t_1);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_1, __pyx_t_2};
__pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_return_inverse, Py_True, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1409, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_return_index, Py_True, __pyx_t_6, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 1409, __pyx_L1_error)
__pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 1409, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
__Pyx_INCREF(__pyx_t_8);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_6);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
__Pyx_INCREF(__pyx_t_2);
} else {
__pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_8);
__pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_6);
__pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_2);
}
#else
__pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
index = 0; __pyx_t_8 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
index = 1; __pyx_t_6 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
index = 2; __pyx_t_2 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 3) < (0)) __PYX_ERR(0, 1409, __pyx_L1_error)
__pyx_t_14 = NULL;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L10_unpacking_done;
__pyx_L9_unpacking_failed:;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_14 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 1409, __pyx_L1_error)
__pyx_L10_unpacking_done:;
}
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1409, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_XCLEAR_MEMVIEW(&__pyx_v_real_r, 1);
__pyx_v_real_r = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
__pyx_v_uind = __pyx_t_6;
__pyx_t_6 = 0;
__pyx_v_inverse = __pyx_t_2;
__pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":1410
* raise ValueError("r must be non-decreasing for non-cumulative counting.");
* real_r, uind, inverse = np.unique(real_r, return_inverse=True, return_index=True)
* n_queries = real_r.shape[0] # <<<<<<<<<<<<<<
*
* # Internally, we represent all distances as distance ** p
*/
__pyx_v_n_queries = (__pyx_v_real_r.shape[0]);
/* "scipy/spatial/_ckdtree.pyx":1413
*
* # Internally, we represent all distances as distance ** p
* if not isinf(p): # <<<<<<<<<<<<<<
* for i in range(n_queries):
* if not isinf(real_r[i]):
*/
__pyx_t_4 = (!(isinf(__pyx_v_p) != 0));
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1414
* # Internally, we represent all distances as distance ** p
* if not isinf(p):
* for i in range(n_queries): # <<<<<<<<<<<<<<
* if not isinf(real_r[i]):
* real_r[i] = real_r[i] ** p
*/
__pyx_t_11 = __pyx_v_n_queries;
__pyx_t_15 = __pyx_t_11;
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
__pyx_v_i = __pyx_t_16;
/* "scipy/spatial/_ckdtree.pyx":1415
* if not isinf(p):
* for i in range(n_queries):
* if not isinf(real_r[i]): # <<<<<<<<<<<<<<
* real_r[i] = real_r[i] ** p
*
*/
__pyx_t_13 = __pyx_v_i;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_real_r.shape[0];
__pyx_t_4 = (!(isinf((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_real_r.data) + __pyx_t_13)) )))) != 0));
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1416
* for i in range(n_queries):
* if not isinf(real_r[i]):
* real_r[i] = real_r[i] ** p # <<<<<<<<<<<<<<
*
* if weights is None:
*/
__pyx_t_13 = __pyx_v_i;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_real_r.shape[0];
__pyx_t_12 = __pyx_v_i;
if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_real_r.shape[0];
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_real_r.data) + __pyx_t_12)) )) = pow((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_real_r.data) + __pyx_t_13)) ))), __pyx_v_p);
/* "scipy/spatial/_ckdtree.pyx":1415
* if not isinf(p):
* for i in range(n_queries):
* if not isinf(real_r[i]): # <<<<<<<<<<<<<<
* real_r[i] = real_r[i] ** p
*
*/
}
}
/* "scipy/spatial/_ckdtree.pyx":1413
*
* # Internally, we represent all distances as distance ** p
* if not isinf(p): # <<<<<<<<<<<<<<
* for i in range(n_queries):
* if not isinf(real_r[i]):
*/
}
/* "scipy/spatial/_ckdtree.pyx":1418
* real_r[i] = real_r[i] ** p
*
* if weights is None: # <<<<<<<<<<<<<<
* self_weights = other_weights = None
* elif isinstance(weights, tuple):
*/
__pyx_t_4 = (__pyx_v_weights == Py_None);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1419
*
* if weights is None:
* self_weights = other_weights = None # <<<<<<<<<<<<<<
* elif isinstance(weights, tuple):
* self_weights, other_weights = weights
*/
__Pyx_INCREF(Py_None);
__pyx_v_self_weights = Py_None;
__Pyx_INCREF(Py_None);
__pyx_v_other_weights = Py_None;
/* "scipy/spatial/_ckdtree.pyx":1418
* real_r[i] = real_r[i] ** p
*
* if weights is None: # <<<<<<<<<<<<<<
* self_weights = other_weights = None
* elif isinstance(weights, tuple):
*/
goto __pyx_L15;
}
/* "scipy/spatial/_ckdtree.pyx":1420
* if weights is None:
* self_weights = other_weights = None
* elif isinstance(weights, tuple): # <<<<<<<<<<<<<<
* self_weights, other_weights = weights
* else:
*/
__pyx_t_4 = PyTuple_Check(__pyx_v_weights);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1421
* self_weights = other_weights = None
* elif isinstance(weights, tuple):
* self_weights, other_weights = weights # <<<<<<<<<<<<<<
* else:
* self_weights = other_weights = weights
*/
if ((likely(PyTuple_CheckExact(__pyx_v_weights))) || (PyList_CheckExact(__pyx_v_weights))) {
PyObject* sequence = __pyx_v_weights;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 1421, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__Pyx_INCREF(__pyx_t_3);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_2);
} else {
__pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_2);
}
#else
__pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_6 = PyObject_GetIter(__pyx_v_weights); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L16_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L16_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 1421, __pyx_L1_error)
__pyx_t_14 = NULL;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L17_unpacking_done;
__pyx_L16_unpacking_failed:;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_14 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 1421, __pyx_L1_error)
__pyx_L17_unpacking_done:;
}
__pyx_v_self_weights = __pyx_t_3;
__pyx_t_3 = 0;
__pyx_v_other_weights = __pyx_t_2;
__pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":1420
* if weights is None:
* self_weights = other_weights = None
* elif isinstance(weights, tuple): # <<<<<<<<<<<<<<
* self_weights, other_weights = weights
* else:
*/
goto __pyx_L15;
}
/* "scipy/spatial/_ckdtree.pyx":1423
* self_weights, other_weights = weights
* else:
* self_weights = other_weights = weights # <<<<<<<<<<<<<<
* if other is not self:
* raise ValueError("Two different trees are used. Specify weights for both in a tuple.")
*/
/*else*/ {
__Pyx_INCREF(__pyx_v_weights);
__pyx_v_self_weights = __pyx_v_weights;
__Pyx_INCREF(__pyx_v_weights);
__pyx_v_other_weights = __pyx_v_weights;
/* "scipy/spatial/_ckdtree.pyx":1424
* else:
* self_weights = other_weights = weights
* if other is not self: # <<<<<<<<<<<<<<
* raise ValueError("Two different trees are used. Specify weights for both in a tuple.")
*
*/
__pyx_t_4 = (__pyx_v_other != __pyx_v_self);
if (unlikely(__pyx_t_4)) {
/* "scipy/spatial/_ckdtree.pyx":1425
* self_weights = other_weights = weights
* if other is not self:
* raise ValueError("Two different trees are used. Specify weights for both in a tuple.") # <<<<<<<<<<<<<<
*
* cum = <int> cumulative
*/
__pyx_t_3 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Two_different_trees_are_used_Spe};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(0, 1425, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":1424
* else:
* self_weights = other_weights = weights
* if other is not self: # <<<<<<<<<<<<<<
* raise ValueError("Two different trees are used. Specify weights for both in a tuple.")
*
*/
}
}
__pyx_L15:;
/* "scipy/spatial/_ckdtree.pyx":1427
* raise ValueError("Two different trees are used. Specify weights for both in a tuple.")
*
* cum = <int> cumulative # <<<<<<<<<<<<<<
*
* if self_weights is None and other_weights is None:
*/
__pyx_v_cum = ((int)__pyx_v_cumulative);
/* "scipy/spatial/_ckdtree.pyx":1429
* cum = <int> cumulative
*
* if self_weights is None and other_weights is None: # <<<<<<<<<<<<<<
* int_result = True
* # unweighted, use the integer arithmetic
*/
__pyx_t_17 = (__pyx_v_self_weights == Py_None);
if (__pyx_t_17) {
} else {
__pyx_t_4 = __pyx_t_17;
goto __pyx_L20_bool_binop_done;
}
__pyx_t_17 = (__pyx_v_other_weights == Py_None);
__pyx_t_4 = __pyx_t_17;
__pyx_L20_bool_binop_done:;
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1430
*
* if self_weights is None and other_weights is None:
* int_result = True # <<<<<<<<<<<<<<
* # unweighted, use the integer arithmetic
* results = np.zeros(n_queries + 1, dtype=np.intp)
*/
__pyx_v_int_result = 1;
/* "scipy/spatial/_ckdtree.pyx":1432
* int_result = True
* # unweighted, use the integer arithmetic
* results = np.zeros(n_queries + 1, dtype=np.intp) # <<<<<<<<<<<<<<
*
* iresults = results
*/
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyLong_From_npy_intp((__pyx_v_n_queries + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_intp); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_6};
__pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_18, __pyx_t_1, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1432, __pyx_L1_error)
__pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_v_results = __pyx_t_2;
__pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":1434
* results = np.zeros(n_queries + 1, dtype=np.intp)
*
* iresults = results # <<<<<<<<<<<<<<
*
* prr = &real_r[0]
*/
__pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(__pyx_v_results, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 1434, __pyx_L1_error)
__pyx_v_iresults = __pyx_t_19;
__pyx_t_19.memview = NULL;
__pyx_t_19.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":1436
* iresults = results
*
* prr = &real_r[0] # <<<<<<<<<<<<<<
* pir = &iresults[0]
*
*/
__pyx_t_13 = 0;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_real_r.shape[0];
__pyx_v_prr = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_real_r.data) + __pyx_t_13)) ))));
/* "scipy/spatial/_ckdtree.pyx":1437
*
* prr = &real_r[0]
* pir = &iresults[0] # <<<<<<<<<<<<<<
*
* with nogil:
*/
__pyx_t_13 = 0;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_iresults.shape[0];
__pyx_v_pir = (&(*((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_iresults.data) + __pyx_t_13)) ))));
/* "scipy/spatial/_ckdtree.pyx":1439
* pir = &iresults[0]
*
* with nogil: # <<<<<<<<<<<<<<
* count_neighbors_unweighted(self.cself, other.cself, n_queries,
* prr, pir, p, cum)
*/
{
PyThreadState * _save;
_save = PyEval_SaveThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
/* "scipy/spatial/_ckdtree.pyx":1440
*
* with nogil:
* count_neighbors_unweighted(self.cself, other.cself, n_queries, # <<<<<<<<<<<<<<
* prr, pir, p, cum)
*
*/
try {
count_neighbors_unweighted(__pyx_v_self->cself, __pyx_v_other->cself, __pyx_v_n_queries, __pyx_v_prr, __pyx_v_pir, __pyx_v_p, __pyx_v_cum);
} catch(...) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_CppExn2PyErr();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__PYX_ERR(0, 1440, __pyx_L23_error)
}
}
/* "scipy/spatial/_ckdtree.pyx":1439
* pir = &iresults[0]
*
* with nogil: # <<<<<<<<<<<<<<
* count_neighbors_unweighted(self.cself, other.cself, n_queries,
* prr, pir, p, cum)
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L24;
}
__pyx_L23_error: {
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L1_error;
}
__pyx_L24:;
}
}
/* "scipy/spatial/_ckdtree.pyx":1429
* cum = <int> cumulative
*
* if self_weights is None and other_weights is None: # <<<<<<<<<<<<<<
* int_result = True
* # unweighted, use the integer arithmetic
*/
goto __pyx_L19;
}
/* "scipy/spatial/_ckdtree.pyx":1444
*
* else:
* int_result = False # <<<<<<<<<<<<<<
*
* # weighted / half weighted, use the floating point arithmetic
*/
/*else*/ {
__pyx_v_int_result = 0;
/* "scipy/spatial/_ckdtree.pyx":1447
*
* # weighted / half weighted, use the floating point arithmetic
* if self_weights is not None: # <<<<<<<<<<<<<<
* w1 = np.ascontiguousarray(self_weights, dtype=np.float64)
* w1n = self._build_weights(w1)
*/
__pyx_t_4 = (__pyx_v_self_weights != Py_None);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1448
* # weighted / half weighted, use the floating point arithmetic
* if self_weights is not None:
* w1 = np.ascontiguousarray(self_weights, dtype=np.float64) # <<<<<<<<<<<<<<
* w1n = self._build_weights(w1)
* w1p = &w1[0]
*/
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_18))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_18);
assert(__pyx_t_8);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_v_self_weights};
__pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_6, __pyx_t_1, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1448, __pyx_L1_error)
__pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1448, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_w1 = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":1449
* if self_weights is not None:
* w1 = np.ascontiguousarray(self_weights, dtype=np.float64)
* w1n = self._build_weights(w1) # <<<<<<<<<<<<<<
* w1p = &w1[0]
* w1np = &w1n[0]
*/
__pyx_t_18 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_18);
__pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_w1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_1};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_weights, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1449, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_w1n = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":1450
* w1 = np.ascontiguousarray(self_weights, dtype=np.float64)
* w1n = self._build_weights(w1)
* w1p = &w1[0] # <<<<<<<<<<<<<<
* w1np = &w1n[0]
* if other_weights is not None:
*/
__pyx_t_13 = 0;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_w1.shape[0];
__pyx_v_w1p = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_w1.data) + __pyx_t_13)) ))));
/* "scipy/spatial/_ckdtree.pyx":1451
* w1n = self._build_weights(w1)
* w1p = &w1[0]
* w1np = &w1n[0] # <<<<<<<<<<<<<<
* if other_weights is not None:
* w2 = np.ascontiguousarray(other_weights, dtype=np.float64)
*/
__pyx_t_13 = 0;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_w1n.shape[0];
__pyx_v_w1np = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_w1n.data) + __pyx_t_13)) ))));
/* "scipy/spatial/_ckdtree.pyx":1447
*
* # weighted / half weighted, use the floating point arithmetic
* if self_weights is not None: # <<<<<<<<<<<<<<
* w1 = np.ascontiguousarray(self_weights, dtype=np.float64)
* w1n = self._build_weights(w1)
*/
}
/* "scipy/spatial/_ckdtree.pyx":1452
* w1p = &w1[0]
* w1np = &w1n[0]
* if other_weights is not None: # <<<<<<<<<<<<<<
* w2 = np.ascontiguousarray(other_weights, dtype=np.float64)
* w2n = other._build_weights(w2)
*/
__pyx_t_4 = (__pyx_v_other_weights != Py_None);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1453
* w1np = &w1n[0]
* if other_weights is not None:
* w2 = np.ascontiguousarray(other_weights, dtype=np.float64) # <<<<<<<<<<<<<<
* w2n = other._build_weights(w2)
* w2p = &w2[0]
*/
__pyx_t_1 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_ascontiguousarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
assert(__pyx_t_1);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_v_other_weights};
__pyx_t_18 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_18);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_8, __pyx_t_18, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1453, __pyx_L1_error)
__pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_18);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1453, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_w2 = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":1454
* if other_weights is not None:
* w2 = np.ascontiguousarray(other_weights, dtype=np.float64)
* w2n = other._build_weights(w2) # <<<<<<<<<<<<<<
* w2p = &w2[0]
* w2np = &w2n[0]
*/
__pyx_t_6 = ((PyObject *)__pyx_v_other);
__Pyx_INCREF(__pyx_t_6);
__pyx_t_18 = __pyx_memoryview_fromslice(__pyx_v_w2, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_18};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_build_weights, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1454, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_w2n = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":1455
* w2 = np.ascontiguousarray(other_weights, dtype=np.float64)
* w2n = other._build_weights(w2)
* w2p = &w2[0] # <<<<<<<<<<<<<<
* w2np = &w2n[0]
*
*/
__pyx_t_13 = 0;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_w2.shape[0];
__pyx_v_w2p = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_w2.data) + __pyx_t_13)) ))));
/* "scipy/spatial/_ckdtree.pyx":1456
* w2n = other._build_weights(w2)
* w2p = &w2[0]
* w2np = &w2n[0] # <<<<<<<<<<<<<<
*
* results = np.zeros(n_queries + 1, dtype=np.float64)
*/
__pyx_t_13 = 0;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_w2n.shape[0];
__pyx_v_w2np = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_w2n.data) + __pyx_t_13)) ))));
/* "scipy/spatial/_ckdtree.pyx":1452
* w1p = &w1[0]
* w1np = &w1n[0]
* if other_weights is not None: # <<<<<<<<<<<<<<
* w2 = np.ascontiguousarray(other_weights, dtype=np.float64)
* w2n = other._build_weights(w2)
*/
}
/* "scipy/spatial/_ckdtree.pyx":1458
* w2np = &w2n[0]
*
* results = np.zeros(n_queries + 1, dtype=np.float64) # <<<<<<<<<<<<<<
* fresults = results
*
*/
__pyx_t_18 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyLong_From_npy_intp((__pyx_v_n_queries + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_18 = PyMethod_GET_SELF(__pyx_t_8);
assert(__pyx_t_18);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_18, __pyx_t_6};
__pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_t_3, __pyx_t_1, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1458, __pyx_L1_error)
__pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1);
__Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_v_results = __pyx_t_2;
__pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":1459
*
* results = np.zeros(n_queries + 1, dtype=np.float64)
* fresults = results # <<<<<<<<<<<<<<
*
* prr = &real_r[0]
*/
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_v_results, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1459, __pyx_L1_error)
__pyx_v_fresults = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
/* "scipy/spatial/_ckdtree.pyx":1461
* fresults = results
*
* prr = &real_r[0] # <<<<<<<<<<<<<<
* pfr = &fresults[0]
*
*/
__pyx_t_13 = 0;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_real_r.shape[0];
__pyx_v_prr = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_real_r.data) + __pyx_t_13)) ))));
/* "scipy/spatial/_ckdtree.pyx":1462
*
* prr = &real_r[0]
* pfr = &fresults[0] # <<<<<<<<<<<<<<
*
* with nogil:
*/
__pyx_t_13 = 0;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_fresults.shape[0];
__pyx_v_pfr = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_fresults.data) + __pyx_t_13)) ))));
/* "scipy/spatial/_ckdtree.pyx":1464
* pfr = &fresults[0]
*
* with nogil: # <<<<<<<<<<<<<<
* count_neighbors_weighted(self.cself, other.cself,
* w1p, w2p, w1np, w2np,
*/
{
PyThreadState * _save;
_save = PyEval_SaveThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
/* "scipy/spatial/_ckdtree.pyx":1465
*
* with nogil:
* count_neighbors_weighted(self.cself, other.cself, # <<<<<<<<<<<<<<
* w1p, w2p, w1np, w2np,
* n_queries,
*/
try {
count_neighbors_weighted(__pyx_v_self->cself, __pyx_v_other->cself, __pyx_v_w1p, __pyx_v_w2p, __pyx_v_w1np, __pyx_v_w2np, __pyx_v_n_queries, __pyx_v_prr, __pyx_v_pfr, __pyx_v_p, __pyx_v_cum);
} catch(...) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_CppExn2PyErr();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__PYX_ERR(0, 1465, __pyx_L28_error)
}
}
/* "scipy/spatial/_ckdtree.pyx":1464
* pfr = &fresults[0]
*
* with nogil: # <<<<<<<<<<<<<<
* count_neighbors_weighted(self.cself, other.cself,
* w1p, w2p, w1np, w2np,
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L29;
}
__pyx_L28_error: {
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L1_error;
}
__pyx_L29:;
}
}
}
__pyx_L19:;
/* "scipy/spatial/_ckdtree.pyx":1470
* prr, pfr, p, cum)
*
* results2 = np.zeros(inverse.shape, results.dtype) # <<<<<<<<<<<<<<
* if cumulative:
* # copy out the results (taking care of duplication and sorting)
*/
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_inverse, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_results, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
assert(__pyx_t_8);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_v_results2 = __pyx_t_2;
__pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":1471
*
* results2 = np.zeros(inverse.shape, results.dtype)
* if cumulative: # <<<<<<<<<<<<<<
* # copy out the results (taking care of duplication and sorting)
* results2[...] = results[inverse]
*/
__pyx_t_4 = (__pyx_v_cumulative != 0);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1473
* if cumulative:
* # copy out the results (taking care of duplication and sorting)
* results2[...] = results[inverse] # <<<<<<<<<<<<<<
* else:
* # keep the identical ones zero
*/
__pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_results, __pyx_v_inverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (unlikely((PyObject_SetItem(__pyx_v_results2, Py_Ellipsis, __pyx_t_2) < 0))) __PYX_ERR(0, 1473, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":1471
*
* results2 = np.zeros(inverse.shape, results.dtype)
* if cumulative: # <<<<<<<<<<<<<<
* # copy out the results (taking care of duplication and sorting)
* results2[...] = results[inverse]
*/
goto __pyx_L30;
}
/* "scipy/spatial/_ckdtree.pyx":1477
* # keep the identical ones zero
* # this could have been done in a more readable way.
* results2[uind] = results[inverse][uind] # <<<<<<<<<<<<<<
* results = results2
*
*/
/*else*/ {
__pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_results, __pyx_v_inverse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_uind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely((PyObject_SetItem(__pyx_v_results2, __pyx_v_uind, __pyx_t_3) < 0))) __PYX_ERR(0, 1477, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L30:;
/* "scipy/spatial/_ckdtree.pyx":1478
* # this could have been done in a more readable way.
* results2[uind] = results[inverse][uind]
* results = results2 # <<<<<<<<<<<<<<
*
* if r_ndim == 0:
*/
__Pyx_INCREF(__pyx_v_results2);
__Pyx_DECREF_SET(__pyx_v_results, __pyx_v_results2);
/* "scipy/spatial/_ckdtree.pyx":1480
* results = results2
*
* if r_ndim == 0: # <<<<<<<<<<<<<<
* if int_result and results[0] <= <np.intp_t> LONG_MAX:
* return int(results[0])
*/
__pyx_t_4 = (__pyx_v_r_ndim == 0);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1481
*
* if r_ndim == 0:
* if int_result and results[0] <= <np.intp_t> LONG_MAX: # <<<<<<<<<<<<<<
* return int(results[0])
* else:
*/
if (__pyx_v_int_result) {
} else {
__pyx_t_4 = __pyx_v_int_result;
goto __pyx_L33_bool_binop_done;
}
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_results, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PyLong_From_npy_intp(((__pyx_t_5numpy_intp_t)LONG_MAX)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1481, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1481, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = __pyx_t_17;
__pyx_L33_bool_binop_done:;
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1482
* if r_ndim == 0:
* if int_result and results[0] <= <np.intp_t> LONG_MAX:
* return int(results[0]) # <<<<<<<<<<<<<<
* else:
* return results[0]
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_6 = __Pyx_GetItemInt(__pyx_v_results, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1481
*
* if r_ndim == 0:
* if int_result and results[0] <= <np.intp_t> LONG_MAX: # <<<<<<<<<<<<<<
* return int(results[0])
* else:
*/
}
/* "scipy/spatial/_ckdtree.pyx":1484
* return int(results[0])
* else:
* return results[0] # <<<<<<<<<<<<<<
* else:
* return results
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_results, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "scipy/spatial/_ckdtree.pyx":1480
* results = results2
*
* if r_ndim == 0: # <<<<<<<<<<<<<<
* if int_result and results[0] <= <np.intp_t> LONG_MAX:
* return int(results[0])
*/
}
/* "scipy/spatial/_ckdtree.pyx":1486
* return results[0]
* else:
* return results # <<<<<<<<<<<<<<
*
* # ----------------------
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_results);
__pyx_r = __pyx_v_results;
goto __pyx_L0;
}
/* "scipy/spatial/_ckdtree.pyx":1233
* # ---------------
*
* @cython.boundscheck(False) # <<<<<<<<<<<<<<
* def count_neighbors(cKDTree self, cKDTree other, object r, np.float64_t p=2.0,
* object weights=None, int cumulative=True):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
__Pyx_XDECREF(__pyx_t_18);
__PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.count_neighbors", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XCLEAR_MEMVIEW(&__pyx_v_real_r, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_v_fresults, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_v_iresults, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_v_w1, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_v_w1n, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_v_w2, 1);
__PYX_XCLEAR_MEMVIEW(&__pyx_v_w2n, 1);
__Pyx_XDECREF(__pyx_v_uind);
__Pyx_XDECREF(__pyx_v_inverse);
__Pyx_XDECREF(__pyx_v_self_weights);
__Pyx_XDECREF(__pyx_v_other_weights);
__Pyx_XDECREF(__pyx_v_results);
__Pyx_XDECREF(__pyx_v_results2);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":1492
* # ----------------------
*
* def sparse_distance_matrix(cKDTree self, cKDTree other, # <<<<<<<<<<<<<<
* np.float64_t max_distance,
* np.float64_t p=2.0,
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_19sparse_distance_matrix(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_18sparse_distance_matrix, "\n sparse_distance_matrix(other, max_distance, p=2.0, output_type='dok_matrix')\n\n Compute a sparse distance matrix\n\n Computes a distance matrix between two cKDTrees, leaving as zero\n any distance greater than max_distance.\n\n Parameters\n ----------\n other : cKDTree\n The other `KDTree` to compute distances against.\n max_distance : positive float\n Maximum distance within which neighbors are returned. Distances above this\n value are returned as zero.\n p : float, 1<=p<=infinity\n Which Minkowski p-norm to use.\n A finite large p may cause a ValueError if overflow can occur.\n output_type : str, optional\n Which container to use for output data. Options: ``'dok_array'``,\n ``'coo_array'``, ``'dict'``, or ``'ndarray'``.\n Legacy options ``'dok_matrix'`` and ``'coo_matrix'`` are still available.\n Default: ``'dok_matrix'``.\n\n .. warning:: dok_matrix and coo_matrix are being replaced.\n\n All new code using scipy sparse should use sparse array\n types 'dok_array' or 'coo_array'. The default value of\n `output_type` will be deprecated at v1.19 and switch from\n 'dok_matrix' to 'dok_array' in v1.21.\n The values 'dok_matrix' and 'coo_matrix' continue\n to work, but will go away eventually.\n\n Returns\n -------\n result : dok_array, coo_array, dict or ndarray\n Sparse matrix representing the results in \"dictionary of keys\"\n format. If a dict is returned the keys are ``(i,j)`` tuples of indices.\n If output_type is ``'ndarray'`` a record array with fields ``'i'``, ``'j'``,\n and ``'v'`` is returned,\n\n Examples\n --------\n You can compute a sparse distance matrix between two kd-trees:\n\n >>> import numpy a""s np\n >>> from scipy.spatial import cKDTree\n >>> rng = np.random.default_rng()\n >>> points1 = rng.random((5, 2))\n >>> points2 = rng.random((5, 2))\n >>> kdtree1 = cKDTree(points1)\n >>> kdtree2 = cKDTree(points2)\n >>> sdm = kdtree1.sparse_distance_matrix(kdtree2, 0.3, output_type=\"dok_array\")\n >>> sdm.toarray()\n array([[0. , 0. , 0.12295571, 0. , 0. ],\n [0. , 0. , 0. , 0. , 0. ],\n [0.28942611, 0. , 0. , 0.2333084 , 0. ],\n [0. , 0. , 0. , 0. , 0. ],\n [0.24617575, 0.29571802, 0.26836782, 0. , 0. ]])\n\n You can check distances above the `max_distance` are zeros:\n\n >>> from scipy.spatial import distance_matrix\n >>> distance_matrix(points1, points2)\n array([[0.56906522, 0.39923701, 0.12295571, 0.8658745 , 0.79428925],\n [0.37327919, 0.7225693 , 0.87665969, 0.32580855, 0.75679479],\n [0.28942611, 0.30088013, 0.6395831 , 0.2333084 , 0.33630734],\n [0.31994999, 0.72658602, 0.71124834, 0.55396483, 0.90785663],\n [0.24617575, 0.29571802, 0.26836782, 0.57714465, 0.6473269 ]])\n\n ");
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_19sparse_distance_matrix = {"sparse_distance_matrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_19sparse_distance_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_7spatial_8_ckdtree_7cKDTree_18sparse_distance_matrix};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_19sparse_distance_matrix(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_other = 0;
__pyx_t_5numpy_float64_t __pyx_v_max_distance;
__pyx_t_5numpy_float64_t __pyx_v_p;
PyObject *__pyx_v_output_type = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[4] = {0,0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sparse_distance_matrix (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,&__pyx_mstate_global->__pyx_n_u_max_distance,&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_output_type,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1492, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1492, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1492, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1492, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1492, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sparse_distance_matrix", 0) < (0)) __PYX_ERR(0, 1492, __pyx_L3_error)
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_dok_matrix));
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sparse_distance_matrix", 0, 2, 4, i); __PYX_ERR(0, 1492, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1492, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1492, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1492, __pyx_L3_error)
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1492, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_dok_matrix));
}
__pyx_v_other = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)values[0]);
__pyx_v_max_distance = __Pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_max_distance == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L3_error)
if (values[2]) {
__pyx_v_p = __Pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_p == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1494, __pyx_L3_error)
} else {
__pyx_v_p = ((__pyx_t_5numpy_float64_t)2.0);
}
__pyx_v_output_type = values[3];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("sparse_distance_matrix", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1492, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.sparse_distance_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree_cKDTree, 1, "other", 0))) __PYX_ERR(0, 1492, __pyx_L1_error)
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_18sparse_distance_matrix(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v_other, __pyx_v_max_distance, __pyx_v_p, __pyx_v_output_type);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_18sparse_distance_matrix(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_other, __pyx_t_5numpy_float64_t __pyx_v_max_distance, __pyx_t_5numpy_float64_t __pyx_v_p, PyObject *__pyx_v_output_type) {
struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *__pyx_v_res = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
size_t __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sparse_distance_matrix", 0);
/* "scipy/spatial/_ckdtree.pyx":1571
*
* # Make sure trees are compatible
* if self.m != other.m: # <<<<<<<<<<<<<<
* raise ValueError("Trees passed to sparse_distance_matrix have "
* "different dimensionality")
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1571, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1571, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1571, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1571, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(__pyx_t_4)) {
/* "scipy/spatial/_ckdtree.pyx":1572
* # Make sure trees are compatible
* if self.m != other.m:
* raise ValueError("Trees passed to sparse_distance_matrix have " # <<<<<<<<<<<<<<
* "different dimensionality")
* # do the query
*/
__pyx_t_2 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Trees_passed_to_sparse_distance};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1572, __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_ERR(0, 1572, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":1571
*
* # Make sure trees are compatible
* if self.m != other.m: # <<<<<<<<<<<<<<
* raise ValueError("Trees passed to sparse_distance_matrix have "
* "different dimensionality")
*/
}
/* "scipy/spatial/_ckdtree.pyx":1575
* "different dimensionality")
* # do the query
* res = coo_entries() # <<<<<<<<<<<<<<
*
* with nogil:
*/
__pyx_t_2 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_5scipy_7spatial_8_ckdtree_coo_entries, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1575, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_3);
}
__pyx_v_res = ((struct __pyx_obj_5scipy_7spatial_8_ckdtree_coo_entries *)__pyx_t_3);
__pyx_t_3 = 0;
/* "scipy/spatial/_ckdtree.pyx":1577
* res = coo_entries()
*
* with nogil: # <<<<<<<<<<<<<<
* sparse_distance_matrix(
* self.cself, other.cself, p, max_distance, res.buf)
*/
{
PyThreadState * _save;
_save = PyEval_SaveThread();
__Pyx_FastGIL_Remember();
/*try:*/ {
/* "scipy/spatial/_ckdtree.pyx":1578
*
* with nogil:
* sparse_distance_matrix( # <<<<<<<<<<<<<<
* self.cself, other.cself, p, max_distance, res.buf)
*
*/
try {
sparse_distance_matrix(__pyx_v_self->cself, __pyx_v_other->cself, __pyx_v_p, __pyx_v_max_distance, __pyx_v_res->buf);
} catch(...) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_CppExn2PyErr();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__PYX_ERR(0, 1578, __pyx_L5_error)
}
}
/* "scipy/spatial/_ckdtree.pyx":1577
* res = coo_entries()
*
* with nogil: # <<<<<<<<<<<<<<
* sparse_distance_matrix(
* self.cself, other.cself, p, max_distance, res.buf)
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L6;
}
__pyx_L5_error: {
__Pyx_FastGIL_Forget();
PyEval_RestoreThread(_save);
goto __pyx_L1_error;
}
__pyx_L6:;
}
}
/* "scipy/spatial/_ckdtree.pyx":1581
* self.cself, other.cself, p, max_distance, res.buf)
*
* if output_type == 'dict': # <<<<<<<<<<<<<<
* return res.dict()
* elif output_type == 'ndarray':
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_output_type, __pyx_mstate_global->__pyx_n_u_dict_2, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1581, __pyx_L1_error)
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1582
*
* if output_type == 'dict':
* return res.dict() # <<<<<<<<<<<<<<
* elif output_type == 'ndarray':
* return res.ndarray()
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_v_res);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dict_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1582, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1581
* self.cself, other.cself, p, max_distance, res.buf)
*
* if output_type == 'dict': # <<<<<<<<<<<<<<
* return res.dict()
* elif output_type == 'ndarray':
*/
}
/* "scipy/spatial/_ckdtree.pyx":1583
* if output_type == 'dict':
* return res.dict()
* elif output_type == 'ndarray': # <<<<<<<<<<<<<<
* return res.ndarray()
* elif output_type == 'dok_matrix':
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_output_type, __pyx_mstate_global->__pyx_n_u_ndarray, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1583, __pyx_L1_error)
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1584
* return res.dict()
* elif output_type == 'ndarray':
* return res.ndarray() # <<<<<<<<<<<<<<
* elif output_type == 'dok_matrix':
* return res.dok_matrix(self.n, other.n)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_v_res);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_ndarray, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1584, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1583
* if output_type == 'dict':
* return res.dict()
* elif output_type == 'ndarray': # <<<<<<<<<<<<<<
* return res.ndarray()
* elif output_type == 'dok_matrix':
*/
}
/* "scipy/spatial/_ckdtree.pyx":1585
* elif output_type == 'ndarray':
* return res.ndarray()
* elif output_type == 'dok_matrix': # <<<<<<<<<<<<<<
* return res.dok_matrix(self.n, other.n)
* elif output_type == 'dok_array':
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_output_type, __pyx_mstate_global->__pyx_n_u_dok_matrix, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1585, __pyx_L1_error)
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1586
* return res.ndarray()
* elif output_type == 'dok_matrix':
* return res.dok_matrix(self.n, other.n) # <<<<<<<<<<<<<<
* elif output_type == 'dok_array':
* return res.dok_array(self.n, other.n)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_v_res);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1586, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_1, __pyx_t_6};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dok_matrix, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1586, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1585
* elif output_type == 'ndarray':
* return res.ndarray()
* elif output_type == 'dok_matrix': # <<<<<<<<<<<<<<
* return res.dok_matrix(self.n, other.n)
* elif output_type == 'dok_array':
*/
}
/* "scipy/spatial/_ckdtree.pyx":1587
* elif output_type == 'dok_matrix':
* return res.dok_matrix(self.n, other.n)
* elif output_type == 'dok_array': # <<<<<<<<<<<<<<
* return res.dok_array(self.n, other.n)
* elif output_type == 'coo_matrix':
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_output_type, __pyx_mstate_global->__pyx_n_u_dok_array, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1587, __pyx_L1_error)
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1588
* return res.dok_matrix(self.n, other.n)
* elif output_type == 'dok_array':
* return res.dok_array(self.n, other.n) # <<<<<<<<<<<<<<
* elif output_type == 'coo_matrix':
* return res.coo_matrix(self.n, other.n)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_6 = ((PyObject *)__pyx_v_res);
__Pyx_INCREF(__pyx_t_6);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_2};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dok_array, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1587
* elif output_type == 'dok_matrix':
* return res.dok_matrix(self.n, other.n)
* elif output_type == 'dok_array': # <<<<<<<<<<<<<<
* return res.dok_array(self.n, other.n)
* elif output_type == 'coo_matrix':
*/
}
/* "scipy/spatial/_ckdtree.pyx":1589
* elif output_type == 'dok_array':
* return res.dok_array(self.n, other.n)
* elif output_type == 'coo_matrix': # <<<<<<<<<<<<<<
* return res.coo_matrix(self.n, other.n)
* elif output_type == 'coo_array':
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_output_type, __pyx_mstate_global->__pyx_n_u_coo_matrix, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1589, __pyx_L1_error)
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1590
* return res.dok_array(self.n, other.n)
* elif output_type == 'coo_matrix':
* return res.coo_matrix(self.n, other.n) # <<<<<<<<<<<<<<
* elif output_type == 'coo_array':
* return res.coo_array(self.n, other.n)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_v_res);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1590, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_1, __pyx_t_6};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_coo_matrix, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1590, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1589
* elif output_type == 'dok_array':
* return res.dok_array(self.n, other.n)
* elif output_type == 'coo_matrix': # <<<<<<<<<<<<<<
* return res.coo_matrix(self.n, other.n)
* elif output_type == 'coo_array':
*/
}
/* "scipy/spatial/_ckdtree.pyx":1591
* elif output_type == 'coo_matrix':
* return res.coo_matrix(self.n, other.n)
* elif output_type == 'coo_array': # <<<<<<<<<<<<<<
* return res.coo_array(self.n, other.n)
* else:
*/
__pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_output_type, __pyx_mstate_global->__pyx_n_u_coo_array, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1591, __pyx_L1_error)
if (likely(__pyx_t_4)) {
/* "scipy/spatial/_ckdtree.pyx":1592
* return res.coo_matrix(self.n, other.n)
* elif output_type == 'coo_array':
* return res.coo_array(self.n, other.n) # <<<<<<<<<<<<<<
* else:
* raise ValueError('Invalid output type')
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_6 = ((PyObject *)__pyx_v_res);
__Pyx_INCREF(__pyx_t_6);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_2};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_coo_array, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1591
* elif output_type == 'coo_matrix':
* return res.coo_matrix(self.n, other.n)
* elif output_type == 'coo_array': # <<<<<<<<<<<<<<
* return res.coo_array(self.n, other.n)
* else:
*/
}
/* "scipy/spatial/_ckdtree.pyx":1594
* return res.coo_array(self.n, other.n)
* else:
* raise ValueError('Invalid output type') # <<<<<<<<<<<<<<
*
*
*/
/*else*/ {
__pyx_t_2 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Invalid_output_type};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1594, __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_ERR(0, 1594, __pyx_L1_error)
}
/* "scipy/spatial/_ckdtree.pyx":1492
* # ----------------------
*
* def sparse_distance_matrix(cKDTree self, cKDTree other, # <<<<<<<<<<<<<<
* np.float64_t max_distance,
* np.float64_t p=2.0,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.sparse_distance_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_res);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":1601
* # ----------------------
*
* def __getstate__(cKDTree self): # <<<<<<<<<<<<<<
* cdef object state
* cdef ckdtree * cself = self.cself
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_21__getstate__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_21__getstate__ = {"__getstate__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_21__getstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_21__getstate__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__getstate__", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__getstate__", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_20__getstate__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_20__getstate__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
PyObject *__pyx_v_state = 0;
struct ckdtree *__pyx_v_cself;
CYTHON_UNUSED __pyx_t_5numpy_intp_t __pyx_v_size;
PyArrayObject *__pyx_v_tree = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct ckdtree *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
char *__pyx_t_6;
struct __pyx_array_obj *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
char *__pyx_t_9;
size_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getstate__", 0);
/* "scipy/spatial/_ckdtree.pyx":1603
* def __getstate__(cKDTree self):
* cdef object state
* cdef ckdtree * cself = self.cself # <<<<<<<<<<<<<<
* cdef np.intp_t size = cself.tree_buffer.size() * sizeof(ckdtreenode)
*
*/
__pyx_t_1 = __pyx_v_self->cself;
__pyx_v_cself = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":1604
* cdef object state
* cdef ckdtree * cself = self.cself
* cdef np.intp_t size = cself.tree_buffer.size() * sizeof(ckdtreenode) # <<<<<<<<<<<<<<
*
* cdef np.ndarray tree = np.asarray(<char[:size]> <char*> cself.tree_buffer.data())
*/
__pyx_v_size = (__pyx_v_cself->tree_buffer->size() * (sizeof(struct ckdtreenode)));
/* "scipy/spatial/_ckdtree.pyx":1606
* cdef np.intp_t size = cself.tree_buffer.size() * sizeof(ckdtreenode)
*
* cdef np.ndarray tree = np.asarray(<char[:size]> <char*> cself.tree_buffer.data()) # <<<<<<<<<<<<<<
*
* state = (tree.copy(), self.data.copy(), self.n, self.m, self.leafsize,
*/
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = ((char *)__pyx_v_cself->tree_buffer->data());
if (!__pyx_t_6) {
PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
__PYX_ERR(0, 1606, __pyx_L1_error)
}
__pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_char); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_4 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#if CYTHON_COMPILING_IN_LIMITED_API
__pyx_t_9 = PyBytes_AsString(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1606, __pyx_L1_error)
#else
__pyx_t_9 = PyBytes_AS_STRING(__pyx_t_8);
#endif
__pyx_t_7 = __pyx_array_new(__pyx_t_4, sizeof(char), __pyx_t_9, "c", (char *) __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1606, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_10 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
__pyx_t_10 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_t_7)};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF((PyObject *)__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1606, __pyx_L1_error)
__pyx_v_tree = ((PyArrayObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "scipy/spatial/_ckdtree.pyx":1608
* cdef np.ndarray tree = np.asarray(<char[:size]> <char*> cself.tree_buffer.data())
*
* state = (tree.copy(), self.data.copy(), self.n, self.m, self.leafsize, # <<<<<<<<<<<<<<
* self.maxes, self.mins, self.indices.copy(),
* self.boxsize, self.boxsize_data)
*/
__pyx_t_5 = ((PyObject *)__pyx_v_tree);
__Pyx_INCREF(__pyx_t_5);
__pyx_t_10 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1608, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_3 = ((PyObject *)__pyx_v_self->data);
__Pyx_INCREF(__pyx_t_3);
__pyx_t_10 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
__pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1608, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1608, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_m); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1608, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_leafsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1608, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "scipy/spatial/_ckdtree.pyx":1609
*
* state = (tree.copy(), self.data.copy(), self.n, self.m, self.leafsize,
* self.maxes, self.mins, self.indices.copy(), # <<<<<<<<<<<<<<
* self.boxsize, self.boxsize_data)
* return state
*/
__pyx_t_12 = ((PyObject *)__pyx_v_self->indices);
__Pyx_INCREF(__pyx_t_12);
__pyx_t_10 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
__pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
/* "scipy/spatial/_ckdtree.pyx":1608
* cdef np.ndarray tree = np.asarray(<char[:size]> <char*> cself.tree_buffer.data())
*
* state = (tree.copy(), self.data.copy(), self.n, self.m, self.leafsize, # <<<<<<<<<<<<<<
* self.maxes, self.mins, self.indices.copy(),
* self.boxsize, self.boxsize_data)
*/
__pyx_t_12 = PyTuple_New(10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1608, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_5);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_3);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_8);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_8) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_4) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__Pyx_INCREF((PyObject *)__pyx_v_self->maxes);
__Pyx_GIVEREF((PyObject *)__pyx_v_self->maxes);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 5, ((PyObject *)__pyx_v_self->maxes)) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__Pyx_INCREF((PyObject *)__pyx_v_self->mins);
__Pyx_GIVEREF((PyObject *)__pyx_v_self->mins);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 6, ((PyObject *)__pyx_v_self->mins)) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_11);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_11) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_self->boxsize);
__Pyx_GIVEREF(__pyx_v_self->boxsize);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_v_self->boxsize) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__Pyx_INCREF((PyObject *)__pyx_v_self->boxsize_data);
__Pyx_GIVEREF((PyObject *)__pyx_v_self->boxsize_data);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 9, ((PyObject *)__pyx_v_self->boxsize_data)) != (0)) __PYX_ERR(0, 1608, __pyx_L1_error);
__pyx_t_2 = 0;
__pyx_t_5 = 0;
__pyx_t_3 = 0;
__pyx_t_8 = 0;
__pyx_t_4 = 0;
__pyx_t_11 = 0;
__pyx_v_state = __pyx_t_12;
__pyx_t_12 = 0;
/* "scipy/spatial/_ckdtree.pyx":1611
* self.maxes, self.mins, self.indices.copy(),
* self.boxsize, self.boxsize_data)
* return state # <<<<<<<<<<<<<<
*
* def __setstate__(cKDTree self, state):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_state);
__pyx_r = __pyx_v_state;
goto __pyx_L0;
/* "scipy/spatial/_ckdtree.pyx":1601
* # ----------------------
*
* def __getstate__(cKDTree self): # <<<<<<<<<<<<<<
* cdef object state
* cdef ckdtree * cself = self.cself
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF((PyObject *)__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_state);
__Pyx_XDECREF((PyObject *)__pyx_v_tree);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":1613
* return state
*
* def __setstate__(cKDTree self, state): # <<<<<<<<<<<<<<
* cdef np.ndarray tree
* cdef ckdtree * cself = self.cself
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_23__setstate__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_23__setstate__ = {"__setstate__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_23__setstate__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_23__setstate__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_state = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[1] = {0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1613, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1613, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate__", 0) < (0)) __PYX_ERR(0, 1613, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 1, 1, i); __PYX_ERR(0, 1613, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1613, __pyx_L3_error)
}
__pyx_v_state = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__setstate__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1613, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_22__setstate__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v_state);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_22__setstate__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, PyObject *__pyx_v_state) {
PyArrayObject *__pyx_v_tree = 0;
struct ckdtree *__pyx_v_cself;
PyArrayObject *__pyx_v_mytree = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
struct ckdtree *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *(*__pyx_t_13)(PyObject *);
__pyx_t_5numpy_intp_t __pyx_t_14;
__pyx_t_5numpy_intp_t __pyx_t_15;
__pyx_t_5numpy_intp_t __pyx_t_16;
std::vector<struct ckdtreenode> *__pyx_t_17;
npy_intp __pyx_t_18;
size_t __pyx_t_19;
char *__pyx_t_20;
struct __pyx_array_obj *__pyx_t_21 = NULL;
char *__pyx_t_22;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setstate__", 0);
/* "scipy/spatial/_ckdtree.pyx":1615
* def __setstate__(cKDTree self, state):
* cdef np.ndarray tree
* cdef ckdtree * cself = self.cself # <<<<<<<<<<<<<<
* cdef np.ndarray mytree
*
*/
__pyx_t_1 = __pyx_v_self->cself;
__pyx_v_cself = __pyx_t_1;
/* "scipy/spatial/_ckdtree.pyx":1620
* # unpack the state
* (tree, self.data, self.cself.n, self.cself.m, self.cself.leafsize,
* self.maxes, self.mins, self.indices, self.boxsize, self.boxsize_data) = state # <<<<<<<<<<<<<<
*
* cself.tree_buffer = new vector[ckdtreenode]()
*/
if ((likely(PyTuple_CheckExact(__pyx_v_state))) || (PyList_CheckExact(__pyx_v_state))) {
PyObject* sequence = __pyx_v_state;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 10)) {
if (size > 10) __Pyx_RaiseTooManyValuesError(10);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 1619, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_3);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
__Pyx_INCREF(__pyx_t_4);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
__Pyx_INCREF(__pyx_t_5);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
__Pyx_INCREF(__pyx_t_6);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 5);
__Pyx_INCREF(__pyx_t_7);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 6);
__Pyx_INCREF(__pyx_t_8);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 7);
__Pyx_INCREF(__pyx_t_9);
__pyx_t_10 = PyTuple_GET_ITEM(sequence, 8);
__Pyx_INCREF(__pyx_t_10);
__pyx_t_11 = PyTuple_GET_ITEM(sequence, 9);
__Pyx_INCREF(__pyx_t_11);
} else {
__pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 4, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 5, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 6, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_8);
__pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 7, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_9);
__pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 8, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_10);
__pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 9, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_11);
}
#else
{
Py_ssize_t i;
PyObject** temps[10] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
for (i=0; i < 10; i++) {
PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
} else {
Py_ssize_t index = -1;
PyObject** temps[10] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
__pyx_t_12 = PyObject_GetIter(__pyx_v_state); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
for (index=0; index < 10; index++) {
PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 10) < (0)) __PYX_ERR(0, 1619, __pyx_L1_error)
__pyx_t_13 = NULL;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
goto __pyx_L4_unpacking_done;
__pyx_L3_unpacking_failed:;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_13 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 1619, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
/* "scipy/spatial/_ckdtree.pyx":1619
*
* # unpack the state
* (tree, self.data, self.cself.n, self.cself.m, self.cself.leafsize, # <<<<<<<<<<<<<<
* self.maxes, self.mins, self.indices, self.boxsize, self.boxsize_data) = state
*
*/
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1619, __pyx_L1_error)
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1619, __pyx_L1_error)
__pyx_t_14 = __Pyx_PyLong_As_npy_intp(__pyx_t_4); if (unlikely((__pyx_t_14 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_15 = __Pyx_PyLong_As_npy_intp(__pyx_t_5); if (unlikely((__pyx_t_15 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_16 = __Pyx_PyLong_As_npy_intp(__pyx_t_6); if (unlikely((__pyx_t_16 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1619, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1619, __pyx_L1_error)
if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1619, __pyx_L1_error)
if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1619, __pyx_L1_error)
if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1619, __pyx_L1_error)
__pyx_v_tree = ((PyArrayObject *)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF((PyObject *)__pyx_v_self->data);
__Pyx_DECREF((PyObject *)__pyx_v_self->data);
__pyx_v_self->data = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
__pyx_v_self->cself->n = __pyx_t_14;
__pyx_v_self->cself->m = __pyx_t_15;
__pyx_v_self->cself->leafsize = __pyx_t_16;
/* "scipy/spatial/_ckdtree.pyx":1620
* # unpack the state
* (tree, self.data, self.cself.n, self.cself.m, self.cself.leafsize,
* self.maxes, self.mins, self.indices, self.boxsize, self.boxsize_data) = state # <<<<<<<<<<<<<<
*
* cself.tree_buffer = new vector[ckdtreenode]()
*/
__Pyx_GIVEREF(__pyx_t_7);
__Pyx_GOTREF((PyObject *)__pyx_v_self->maxes);
__Pyx_DECREF((PyObject *)__pyx_v_self->maxes);
__pyx_v_self->maxes = ((PyArrayObject *)__pyx_t_7);
__pyx_t_7 = 0;
__Pyx_GIVEREF(__pyx_t_8);
__Pyx_GOTREF((PyObject *)__pyx_v_self->mins);
__Pyx_DECREF((PyObject *)__pyx_v_self->mins);
__pyx_v_self->mins = ((PyArrayObject *)__pyx_t_8);
__pyx_t_8 = 0;
__Pyx_GIVEREF(__pyx_t_9);
__Pyx_GOTREF((PyObject *)__pyx_v_self->indices);
__Pyx_DECREF((PyObject *)__pyx_v_self->indices);
__pyx_v_self->indices = ((PyArrayObject *)__pyx_t_9);
__pyx_t_9 = 0;
__Pyx_GIVEREF(__pyx_t_10);
__Pyx_GOTREF(__pyx_v_self->boxsize);
__Pyx_DECREF(__pyx_v_self->boxsize);
__pyx_v_self->boxsize = __pyx_t_10;
__pyx_t_10 = 0;
__Pyx_GIVEREF(__pyx_t_11);
__Pyx_GOTREF((PyObject *)__pyx_v_self->boxsize_data);
__Pyx_DECREF((PyObject *)__pyx_v_self->boxsize_data);
__pyx_v_self->boxsize_data = ((PyArrayObject *)__pyx_t_11);
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":1622
* self.maxes, self.mins, self.indices, self.boxsize, self.boxsize_data) = state
*
* cself.tree_buffer = new vector[ckdtreenode]() # <<<<<<<<<<<<<<
* cself.tree_buffer.resize(tree.size // sizeof(ckdtreenode))
*
*/
try {
__pyx_t_17 = new std::vector<struct ckdtreenode> ();
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(0, 1622, __pyx_L1_error)
}
__pyx_v_cself->tree_buffer = __pyx_t_17;
/* "scipy/spatial/_ckdtree.pyx":1623
*
* cself.tree_buffer = new vector[ckdtreenode]()
* cself.tree_buffer.resize(tree.size // sizeof(ckdtreenode)) # <<<<<<<<<<<<<<
*
* mytree = np.asarray(<char[:tree.size]> <char*> cself.tree_buffer.data())
*/
__pyx_t_18 = __pyx_f_5numpy_7ndarray_4size_size(__pyx_v_tree);
__pyx_t_19 = (sizeof(struct ckdtreenode));
if (unlikely(__pyx_t_19 == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(0, 1623, __pyx_L1_error)
}
try {
__pyx_v_cself->tree_buffer->resize((__pyx_t_18 / __pyx_t_19));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(0, 1623, __pyx_L1_error)
}
/* "scipy/spatial/_ckdtree.pyx":1625
* cself.tree_buffer.resize(tree.size // sizeof(ckdtreenode))
*
* mytree = np.asarray(<char[:tree.size]> <char*> cself.tree_buffer.data()) # <<<<<<<<<<<<<<
*
* # set raw pointers
*/
__pyx_t_10 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_20 = ((char *)__pyx_v_cself->tree_buffer->data());
if (unlikely(!__pyx_v_tree)) { __Pyx_RaiseUnboundLocalError("tree"); __PYX_ERR(0, 1625, __pyx_L1_error) }
if (!__pyx_t_20) {
PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
__PYX_ERR(0, 1625, __pyx_L1_error)
}
__pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_char); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_f_5numpy_7ndarray_4size_size(__pyx_v_tree))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#if CYTHON_COMPILING_IN_LIMITED_API
__pyx_t_22 = PyBytes_AsString(__pyx_t_7); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1625, __pyx_L1_error)
#else
__pyx_t_22 = PyBytes_AS_STRING(__pyx_t_7);
#endif
__pyx_t_21 = __pyx_array_new(__pyx_t_9, sizeof(char), __pyx_t_22, "c", (char *) __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1625, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_21);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_19 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
assert(__pyx_t_10);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
__pyx_t_19 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_10, ((PyObject *)__pyx_t_21)};
__pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_19, (2-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF((PyObject *)__pyx_t_21); __pyx_t_21 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1625, __pyx_L1_error)
__pyx_v_mytree = ((PyArrayObject *)__pyx_t_11);
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":1628
*
* # set raw pointers
* self._python_tree = None # <<<<<<<<<<<<<<
* self._pre_init()
*
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->_python_tree);
__Pyx_DECREF(__pyx_v_self->_python_tree);
__pyx_v_self->_python_tree = Py_None;
/* "scipy/spatial/_ckdtree.pyx":1629
* # set raw pointers
* self._python_tree = None
* self._pre_init() # <<<<<<<<<<<<<<
*
* # copy the tree data
*/
__pyx_t_11 = ((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->_pre_init(__pyx_v_self); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1629, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":1632
*
* # copy the tree data
* mytree[:] = tree # <<<<<<<<<<<<<<
*
*
*/
if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_mytree), ((PyObject *)__pyx_v_tree), 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < (0)) __PYX_ERR(0, 1632, __pyx_L1_error)
/* "scipy/spatial/_ckdtree.pyx":1636
*
* # set up the tree structure pointers
* self._post_init() # <<<<<<<<<<<<<<
*
* cdef _run_threads(_thread_func, np.intp_t n, np.intp_t n_jobs):
*/
__pyx_t_11 = ((struct __pyx_vtabstruct_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self->__pyx_vtab)->_post_init(__pyx_v_self); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":1613
* return state
*
* def __setstate__(cKDTree self, state): # <<<<<<<<<<<<<<
* cdef np.ndarray tree
* cdef ckdtree * cself = self.cself
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF((PyObject *)__pyx_t_21);
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tree);
__Pyx_XDECREF((PyObject *)__pyx_v_mytree);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":523
* ckdtree * cself
* object _python_tree
* readonly np.ndarray data # <<<<<<<<<<<<<<
* readonly np.ndarray maxes
* readonly np.ndarray mins
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4data_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4data___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4data___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF((PyObject *)__pyx_v_self->data);
__pyx_r = ((PyObject *)__pyx_v_self->data);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":524
* object _python_tree
* readonly np.ndarray data
* readonly np.ndarray maxes # <<<<<<<<<<<<<<
* readonly np.ndarray mins
* readonly np.ndarray indices
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_5maxes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_5maxes_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_5maxes___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_5maxes___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF((PyObject *)__pyx_v_self->maxes);
__pyx_r = ((PyObject *)__pyx_v_self->maxes);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":525
* readonly np.ndarray data
* readonly np.ndarray maxes
* readonly np.ndarray mins # <<<<<<<<<<<<<<
* readonly np.ndarray indices
* readonly object boxsize
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4mins_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_4mins_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4mins___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_4mins___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF((PyObject *)__pyx_v_self->mins);
__pyx_r = ((PyObject *)__pyx_v_self->mins);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":526
* readonly np.ndarray maxes
* readonly np.ndarray mins
* readonly np.ndarray indices # <<<<<<<<<<<<<<
* readonly object boxsize
* np.ndarray boxsize_data
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_7indices_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_7indices___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_7indices___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF((PyObject *)__pyx_v_self->indices);
__pyx_r = ((PyObject *)__pyx_v_self->indices);
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":527
* readonly np.ndarray mins
* readonly np.ndarray indices
* readonly object boxsize # <<<<<<<<<<<<<<
* np.ndarray boxsize_data
* py_safe_once_flag flag
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_7boxsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_7boxsize_1__get__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_7boxsize___get__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_7boxsize___get__(struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->boxsize);
__pyx_r = __pyx_v_self->boxsize;
goto __pyx_L0;
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state):
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_25__reduce_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_25__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_25__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_25__reduce_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_24__reduce_cython__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
/* "(tree fragment)":2
* def __reduce_cython__(self):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
__Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(2, 2, __pyx_L1_error)
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":3
* def __reduce_cython__(self):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_27__setstate_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_5scipy_7spatial_8_ckdtree_7cKDTree_27__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_27__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5scipy_7spatial_8_ckdtree_7cKDTree_27__setstate_cython__(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[1] = {0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 3, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 3, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(2, 3, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(2, 3, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 3, __pyx_L3_error)
}
__pyx_v___pyx_state = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_26__setstate_cython__(((struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *)__pyx_v_self), __pyx_v___pyx_state);
/* function exit code */
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_5scipy_7spatial_8_ckdtree_7cKDTree_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5scipy_7spatial_8_ckdtree_cKDTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
/* "(tree fragment)":4
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
*/
__Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(2, 4, __pyx_L1_error)
/* "(tree fragment)":3
* def __reduce_cython__(self):
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.spatial._ckdtree.cKDTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/spatial/_ckdtree.pyx":1638
* self._post_init()
*
* cdef _run_threads(_thread_func, np.intp_t n, np.intp_t n_jobs): # <<<<<<<<<<<<<<
* n_jobs = min(n, n_jobs)
* if n_jobs > 1:
*/
static PyObject *__pyx_f_5scipy_7spatial_8_ckdtree__run_threads(PyObject *__pyx_v__thread_func, __pyx_t_5numpy_intp_t __pyx_v_n, __pyx_t_5numpy_intp_t __pyx_v_n_jobs) {
PyObject *__pyx_v_ranges = NULL;
PyObject *__pyx_v_threads = NULL;
PyObject *__pyx_v_t = NULL;
__pyx_t_5numpy_intp_t __pyx_7genexpr__pyx_v_j;
PyObject *__pyx_8genexpr1__pyx_v_start = NULL;
PyObject *__pyx_8genexpr1__pyx_v_end = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__pyx_t_5numpy_intp_t __pyx_t_1;
__pyx_t_5numpy_intp_t __pyx_t_2;
__pyx_t_5numpy_intp_t __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
__pyx_t_5numpy_intp_t __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
Py_ssize_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *(*__pyx_t_13)(PyObject *);
size_t __pyx_t_14;
PyObject *__pyx_t_15 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_run_threads", 0);
/* "scipy/spatial/_ckdtree.pyx":1639
*
* cdef _run_threads(_thread_func, np.intp_t n, np.intp_t n_jobs):
* n_jobs = min(n, n_jobs) # <<<<<<<<<<<<<<
* if n_jobs > 1:
* ranges = [(j * n // n_jobs, (j + 1) * n // n_jobs)
*/
__pyx_t_1 = __pyx_v_n_jobs;
__pyx_t_2 = __pyx_v_n;
__pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
if (__pyx_t_4) {
__pyx_t_3 = __pyx_t_1;
} else {
__pyx_t_3 = __pyx_t_2;
}
__pyx_v_n_jobs = __pyx_t_3;
/* "scipy/spatial/_ckdtree.pyx":1640
* cdef _run_threads(_thread_func, np.intp_t n, np.intp_t n_jobs):
* n_jobs = min(n, n_jobs)
* if n_jobs > 1: # <<<<<<<<<<<<<<
* ranges = [(j * n // n_jobs, (j + 1) * n // n_jobs)
* for j in range(n_jobs)]
*/
__pyx_t_4 = (__pyx_v_n_jobs > 1);
if (__pyx_t_4) {
/* "scipy/spatial/_ckdtree.pyx":1641
* n_jobs = min(n, n_jobs)
* if n_jobs > 1:
* ranges = [(j * n // n_jobs, (j + 1) * n // n_jobs) # <<<<<<<<<<<<<<
* for j in range(n_jobs)]
*
*/
{ /* enter inner scope */
__pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
/* "scipy/spatial/_ckdtree.pyx":1642
* if n_jobs > 1:
* ranges = [(j * n // n_jobs, (j + 1) * n // n_jobs)
* for j in range(n_jobs)] # <<<<<<<<<<<<<<
*
* threads = [threading.Thread(target=_thread_func,
*/
__pyx_t_3 = __pyx_v_n_jobs;
__pyx_t_1 = __pyx_t_3;
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_7genexpr__pyx_v_j = __pyx_t_2;
/* "scipy/spatial/_ckdtree.pyx":1641
* n_jobs = min(n, n_jobs)
* if n_jobs > 1:
* ranges = [(j * n // n_jobs, (j + 1) * n // n_jobs) # <<<<<<<<<<<<<<
* for j in range(n_jobs)]
*
*/
__pyx_t_6 = (__pyx_7genexpr__pyx_v_j * __pyx_v_n);
if (unlikely(__pyx_v_n_jobs == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(0, 1641, __pyx_L1_error)
}
else if (sizeof(__pyx_t_5numpy_intp_t) == sizeof(long) && (!(((__pyx_t_5numpy_intp_t)-1) > 0)) && unlikely(__pyx_v_n_jobs == (__pyx_t_5numpy_intp_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_t_6))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
__PYX_ERR(0, 1641, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_PyLong_From_npy_intp(__Pyx_div___pyx_t_5numpy_intp_t(__pyx_t_6, __pyx_v_n_jobs, 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = ((__pyx_7genexpr__pyx_v_j + 1) * __pyx_v_n);
if (unlikely(__pyx_v_n_jobs == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(0, 1641, __pyx_L1_error)
}
else if (sizeof(__pyx_t_5numpy_intp_t) == sizeof(long) && (!(((__pyx_t_5numpy_intp_t)-1) > 0)) && unlikely(__pyx_v_n_jobs == (__pyx_t_5numpy_intp_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_t_6))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
__PYX_ERR(0, 1641, __pyx_L1_error)
}
__pyx_t_8 = __Pyx_PyLong_From_npy_intp(__Pyx_div___pyx_t_5numpy_intp_t(__pyx_t_6, __pyx_v_n_jobs, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 1641, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_8);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1641, __pyx_L1_error);
__pyx_t_7 = 0;
__pyx_t_8 = 0;
if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1641, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
} /* exit inner scope */
__pyx_v_ranges = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
/* "scipy/spatial/_ckdtree.pyx":1644
* for j in range(n_jobs)]
*
* threads = [threading.Thread(target=_thread_func, # <<<<<<<<<<<<<<
* args=(start, end))
* for start, end in ranges]
*/
{ /* enter inner scope */
__pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1644, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_5);
/* "scipy/spatial/_ckdtree.pyx":1646
* threads = [threading.Thread(target=_thread_func,
* args=(start, end))
* for start, end in ranges] # <<<<<<<<<<<<<<
* for t in threads:
* t.daemon = True
*/
__pyx_t_9 = __pyx_v_ranges; __Pyx_INCREF(__pyx_t_9);
__pyx_t_10 = 0;
for (;;) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1646, __pyx_L8_error)
#endif
if (__pyx_t_10 >= __pyx_temp) break;
}
__pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference);
++__pyx_t_10;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1646, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_8);
if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
PyObject* sequence = __pyx_t_8;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(0, 1646, __pyx_L8_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__Pyx_INCREF(__pyx_t_7);
__pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_11);
} else {
__pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1646, __pyx_L8_error)
__Pyx_XGOTREF(__pyx_t_7);
__pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1646, __pyx_L8_error)
__Pyx_XGOTREF(__pyx_t_11);
}
#else
__pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1646, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1646, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_11);
#endif
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_12 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1646, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_11);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < (0)) __PYX_ERR(0, 1646, __pyx_L8_error)
__pyx_t_13 = NULL;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
goto __pyx_L12_unpacking_done;
__pyx_L11_unpacking_failed:;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_13 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 1646, __pyx_L8_error)
__pyx_L12_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_start, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_end, __pyx_t_11);
__pyx_t_11 = 0;
/* "scipy/spatial/_ckdtree.pyx":1644
* for j in range(n_jobs)]
*
* threads = [threading.Thread(target=_thread_func, # <<<<<<<<<<<<<<
* args=(start, end))
* for start, end in ranges]
*/
__pyx_t_11 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_threading); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1644, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Thread); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1644, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "scipy/spatial/_ckdtree.pyx":1645
*
* threads = [threading.Thread(target=_thread_func,
* args=(start, end)) # <<<<<<<<<<<<<<
* for start, end in ranges]
* for t in threads:
*/
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1645, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_8genexpr1__pyx_v_start);
__Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_start);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_8genexpr1__pyx_v_start) != (0)) __PYX_ERR(0, 1645, __pyx_L8_error);
__Pyx_INCREF(__pyx_8genexpr1__pyx_v_end);
__Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_end);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_8genexpr1__pyx_v_end) != (0)) __PYX_ERR(0, 1645, __pyx_L8_error);
__pyx_t_14 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_12))) {
__pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
assert(__pyx_t_11);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
__pyx_t_14 = 0;
}
#endif
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_11, NULL};
__pyx_t_15 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1644, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_15);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_target, __pyx_v__thread_func, __pyx_t_15, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 1644, __pyx_L8_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_args, __pyx_t_7, __pyx_t_15, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 1644, __pyx_L8_error)
__pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_15);
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1644, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_8);
}
if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1644, __pyx_L8_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "scipy/spatial/_ckdtree.pyx":1646
* threads = [threading.Thread(target=_thread_func,
* args=(start, end))
* for start, end in ranges] # <<<<<<<<<<<<<<
* for t in threads:
* t.daemon = True
*/
}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment