Skip to content

Instantly share code, notes, and snippets.

@bjodah
Created June 21, 2025 18:54
Show Gist options
  • Save bjodah/cac706265f270a820cdc0ff91f4364b4 to your computer and use it in GitHub Desktop.
Save bjodah/cac706265f270a820cdc0ff91f4364b4 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.1.0 */
/* BEGIN: Cython Metadata
{
"distutils": {
"depends": [
"/work/external/pycvodes/pycvodes/include/cvodes_anyode.hpp",
"/work/external/pycvodes/pycvodes/include/cvodes_cxx.hpp",
"chemreac/include/chemreac.hpp"
],
"include_dirs": [
"chemreac/include",
"/work/external/pycvodes/pycvodes/include"
],
"language": "c++",
"name": "chemreac._chemreac",
"sources": [
"./chemreac/_chemreac.pyx"
]
},
"module_name": "chemreac._chemreac"
}
END: Cython Metadata */
#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API)
#define CYTHON_LIMITED_API 1
#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_1_0"
#define CYTHON_HEX_VERSION 0x030100F0
#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 HAVE_LONG_LONG
#define HAVE_LONG_LONG
#endif
#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 1
#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
#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
#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_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK 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
#undef CYTHON_USE_FREELISTS
#define CYTHON_USE_FREELISTS 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
#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 && PY_VERSION_HEX >= 0x030800B1)
#endif
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#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
# 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)
#ifdef _MSC_VER
#ifndef _MSC_STDINT_H_
#if _MSC_VER < 1300
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#else
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
#endif
#endif
#if _MSC_VER < 1300
#ifdef _WIN64
typedef unsigned long long __pyx_uintptr_t;
#else
typedef unsigned int __pyx_uintptr_t;
#endif
#else
#ifdef _WIN64
typedef unsigned __int64 __pyx_uintptr_t;
#else
typedef unsigned __int32 __pyx_uintptr_t;
#endif
#endif
#else
#include <stdint.h>
typedef uintptr_t __pyx_uintptr_t;
#endif
#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 >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
#define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && 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 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))
#elif CYTHON_BACKPORT_VECTORCALL
typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
size_t nargsf, PyObject *kwnames);
#define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
#define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#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 __PYX_LIMITED_VERSION_HEX < 0x03090000
#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
#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 && PY_VERSION_HEX >= 0x03080000
#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
#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
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !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) PySequence_GetItem(o, i)
#endif
#else
#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(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 __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
PyObject *module = PyImport_AddModule(name);
Py_XINCREF(module);
return module;
}
#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>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
float value;
memset(&value, 0xFF, sizeof(value));
return value;
}
#endif
#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__chemreac___chemreac
#define __PYX_HAVE_API__chemreac___chemreac
/* Early includes */
#include <string.h>
#include <stdlib.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 <vector>
#include <utility>
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
// move should be defined for these versions of MSVC, but __cplusplus isn't set usefully
#include <type_traits>
namespace cython_std {
template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); }
template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); }
}
#endif
#include <unordered_map>
#include <string_view>
#include <string>
#include "anyode/anyode.hpp"
#include "chemreac.hpp"
#include "cvodes_cxx.hpp"
#include "cvodes_anyode.hpp"
#include "pythread.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */
#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#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
#include <type_traits>
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[] = {
"chemreac/_chemreac.pyx",
"<stringsource>",
"../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd",
"cpython/type.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto */
#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)
#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)
#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_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)
#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
#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)
#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
#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
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
#define __PYX_FORCE_INIT_THREADS 0
#endif
/* 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()
/* 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;
/* IncludeStructmemberH.proto */
#include <structmember.h>
/* CriticalSections.proto */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs
#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs
#define __Pyx_PyCriticalSection_End1(cs)
#define __Pyx_PyCriticalSection_End2(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin
#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin
#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End
#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End
#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
/* 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])
/* #### Code section: numeric_typedefs ### */
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":787
* # 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":788
*
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":789
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
* ctypedef npy_int64 int64_t
* #ctypedef npy_int96 int96_t
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":790
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
* #ctypedef npy_int96 int96_t
* #ctypedef npy_int128 int128_t
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":794
* #ctypedef npy_int128 int128_t
*
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":795
*
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":796
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
* ctypedef npy_uint64 uint64_t
* #ctypedef npy_uint96 uint96_t
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":797
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
* #ctypedef npy_uint96 uint96_t
* #ctypedef npy_uint128 uint128_t
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":801
* #ctypedef npy_uint128 uint128_t
*
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
* ctypedef npy_float64 float64_t
* #ctypedef npy_float80 float80_t
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":802
*
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":809
* ctypedef double complex complex128_t
*
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
* ctypedef npy_ulonglong ulonglong_t
*
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":810
*
* ctypedef npy_longlong longlong_t
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
*
* ctypedef npy_intp intp_t
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":812
* ctypedef npy_ulonglong ulonglong_t
*
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
* ctypedef npy_uintp uintp_t
*
*/
typedef npy_intp __pyx_t_5numpy_intp_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":813
*
* ctypedef npy_intp intp_t
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
*
* ctypedef npy_double float_t
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":815
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":816
*
* ctypedef npy_double float_t
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
* ctypedef npy_longdouble longdouble_t
*
*/
typedef npy_double __pyx_t_5numpy_double_t;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":817
* 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_obj_8chemreac_9_chemreac_ArrayWrapper;
struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion;
struct __pyx_defaults;
struct __pyx_array_obj;
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
struct __pyx_opt_args_8chemreac_9_chemreac_fromaddress;
/* "chemreac/_chemreac.pyx":38
*
*
* cdef fromaddress(address, shape, dtype=np.float64, strides=None, ro=True): # <<<<<<<<<<<<<<
* dtype = np.dtype(dtype)
* return np.asarray(ArrayWrapper(
*/
struct __pyx_opt_args_8chemreac_9_chemreac_fromaddress {
int __pyx_n;
PyObject *dtype;
PyObject *strides;
PyObject *ro;
};
/* "chemreac/_chemreac.pyx":31
*
*
* cdef class ArrayWrapper(object): # <<<<<<<<<<<<<<
* cdef public dict __array_interface__
*
*/
struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper {
PyObject_HEAD
PyObject *__pyx___array_interface__;
};
/* "chemreac/_chemreac.pyx":50
*
*
* cdef class PyReactionDiffusion: # <<<<<<<<<<<<<<
* """
* Wrapper around C++ class ReactionDiffusion,
*/
struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion {
PyObject_HEAD
chemreac::ReactionDiffusion<double> *thisptr;
std::vector<double> k_err;
std::vector<double> D_err;
PyObject *names;
PyObject *tex_names;
};
/* "chemreac/_chemreac.pyx":529
* # sundials wrapper:
*
* def cvode_predefined( # <<<<<<<<<<<<<<
* PyReactionDiffusion rd, cnp.ndarray[cnp.float64_t, ndim=1] y0,
* cnp.ndarray[cnp.float64_t, ndim=1] tout,
*/
struct __pyx_defaults {
PyObject_HEAD
std::vector<double> arg0;
};
/* "View.MemoryView":110
*
*
* @cython.collection_type("sequence") # <<<<<<<<<<<<<<
* @cname("__pyx_array")
* cdef class array:
*/
struct __pyx_array_obj {
PyObject_HEAD
struct __pyx_vtabstruct_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;
};
/* "View.MemoryView":299
*
*
* @cname('__pyx_MemviewEnum') # <<<<<<<<<<<<<<
* cdef class Enum(object):
* cdef object name
*/
struct __pyx_MemviewEnum_obj {
PyObject_HEAD
PyObject *name;
};
/* "View.MemoryView":334
*
*
* @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
* cdef class memoryview:
*
*/
struct __pyx_memoryview_obj {
PyObject_HEAD
struct __pyx_vtabstruct_memoryview *__pyx_vtab;
PyObject *obj;
PyObject *_size;
PyObject *_array_interface;
PyThread_type_lock lock;
__pyx_atomic_int_type acquisition_count;
Py_buffer view;
int flags;
int dtype_is_object;
__Pyx_TypeInfo const *typeinfo;
};
/* "View.MemoryView":950
*
*
* @cython.collection_type("sequence") # <<<<<<<<<<<<<<
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview):
*/
struct __pyx_memoryviewslice_obj {
struct __pyx_memoryview_obj __pyx_base;
__Pyx_memviewslice from_slice;
PyObject *from_object;
PyObject *(*to_object_func)(char *);
int (*to_dtype_func)(char *, PyObject *);
};
/* "View.MemoryView":110
*
*
* @cython.collection_type("sequence") # <<<<<<<<<<<<<<
* @cname("__pyx_array")
* cdef class array:
*/
struct __pyx_vtabstruct_array {
PyObject *(*get_memview)(struct __pyx_array_obj *);
};
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
/* "View.MemoryView":334
*
*
* @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
* cdef class memoryview:
*
*/
struct __pyx_vtabstruct_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_memoryview *__pyx_vtabptr_memoryview;
/* "View.MemoryView":950
*
*
* @cython.collection_type("sequence") # <<<<<<<<<<<<<<
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview):
*/
struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
/* #### 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 */
#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 */
#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 */
#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 */
#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 */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
/* 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);
/* TupleAndListFromArray.proto */
#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 */
#include <string.h>
/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
/* UnicodeEquals.proto */
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
/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
/* 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
);
/* CallCFunction.proto */
#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)
/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
(sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
#include "frameobject.h"
#define __Pxy_PyFrame_Initialize_Offsets()
#define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
#else
static size_t __pyx_pyframe_localsplus_offset = 0;
#include "frameobject.h"
#define __Pxy_PyFrame_Initialize_Offsets()\
((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
#define __Pyx_PyFrame_GetLocalsplus(frame)\
(assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
#endif
#endif
/* PyObjectCall.proto */
#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 */
#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);
/* UnpackUnboundCMethod.proto */
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
/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#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);
/* 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))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
/* 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
/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
int prepend_sign, char padding_char);
/* COrdinalToPyUnicode.proto */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);
/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif
/* IncludeStdlibH.proto */
#include <stdlib.h>
/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
Py_UCS4 max_char);
/* 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
CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
(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)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(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);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(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);
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);
/* PyObjectCallOneArg.proto */
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
/* RejectKeywords.proto */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);
/* DivInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);
/* UnaryNegOverflows.proto */
#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
(((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
/* PyDictVersioning.proto */
#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_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
/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
static int __pyx_assertions_enabled_flag;
#define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
static int __Pyx_init_assertions_enabled(void) {
PyObject *builtins, *debug, *debug_str;
int flag;
builtins = PyEval_GetBuiltins();
if (!builtins) goto bad;
debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
if (!debug_str) goto bad;
debug = PyObject_GetItem(builtins, debug_str);
Py_DECREF(debug_str);
if (!debug) goto bad;
flag = PyObject_IsTrue(debug);
Py_DECREF(debug);
if (flag == -1) goto bad;
__pyx_assertions_enabled_flag = flag;
return 0;
bad:
__pyx_assertions_enabled_flag = 1;
return -1;
}
#else
#define __Pyx_init_assertions_enabled() (0)
#define __pyx_assertions_enabled() (!Py_OptimizeFlag)
#endif
/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
/* GetTopmostException.proto */
#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
/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif
/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
/* 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
CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
/* 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
/* PySequenceMultiply.proto */
#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif
/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
(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);
/* RaiseUnboundLocalError.proto */
static void __Pyx_RaiseUnboundLocalError(const char *varname);
/* DivInt[long].proto */
static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);
/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
int result = PySequence_Contains(seq, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
/* HasAttr.proto */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif
/* KeywordStringCheck.proto */
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(const char* function_name, PyObject *kw);
/* 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
/* MoveIfSupported.proto */
#if CYTHON_USE_CPP_STD_MOVE
#include <utility>
#define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x)
#else
#define __PYX_STD_MOVE_IF_SUPPORTED(x) x
#endif
/* IsLittleEndian.proto */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
/* BufferFormatCheck.proto */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
__Pyx_BufFmt_StackElem* stack,
const __Pyx_TypeInfo* type);
/* BufferGetAndValidate.proto */
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
((obj == Py_None || obj == NULL) ?\
(__Pyx_ZeroBuffer(buf), 0) :\
__Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
const __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static void __Pyx_ZeroBuffer(Py_buffer* buf);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
#define __Pyx_BufPtrCContig2d(type, buf, i0, s0, i1, s1) ((type)((char*)buf + i0 * s0) + i1)
#define __Pyx_BufPtrFortranContig2d(type, buf, i0, s0, i1, s1) ((type)((char*)buf + i1 * s1) + i0)
/* 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
/* 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
/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
(inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif
/* GetItemIntUnicode.proto */
#define __Pyx_GetItemInt_Unicode(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Unicode_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "string index out of range"), (Py_UCS4)-1))
static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
int wraparound, int boundscheck);
/* PyNumberPow2.proto */
#define __Pyx_PyNumber_InPlacePowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 1)
#define __Pyx_PyNumber_PowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 0)
static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace);
/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
/* UnpackTuple2.proto */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple);
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
/* PyObject_Unicode.proto */
#define __Pyx_PyObject_Unicode(obj)\
(likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
/* RaiseKeywordRequired.proto */
static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name);
/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
(inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#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
/* 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
#define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0)
/* BufferFallbackError.proto */
static void __Pyx_RaiseBufferFallbackError(void);
/* 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) PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
/* CallTypeTraverse.proto */
#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
/* DefaultPlacementNew.proto */
#include <new>
template<typename T>
void __Pyx_default_placement_construct(T* x) {
new (static_cast<void*>(x)) T();
}
/* FixUpExtensionType.proto */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
/* ValidateBasesTuple.proto */
#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);
/* LimitedApiGetTypeDict.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif
/* DelItemOnTypeDict.proto */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
/* SetItemOnTypeDict.proto */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);
/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);
/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);
/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_1_0
#define __PYX_HAVE_RT_ImportType_proto_3_1_0
#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_1_0(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_1_0(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_1_0 {
__Pyx_ImportType_CheckSize_Error_3_1_0 = 0,
__Pyx_ImportType_CheckSize_Warn_3_1_0 = 1,
__Pyx_ImportType_CheckSize_Ignore_3_1_0 = 2
};
static PyTypeObject *__Pyx_ImportType_3_1_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_0 check_size);
#endif
/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);
/* dict_setdefault.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type);
/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
/* PyMethodNew.proto */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif
/* CythonFunctionShared.proto */
#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_BACKPORT_VECTORCALL ||\
(CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL)
__pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *func_weakreflist;
#endif
PyObject *func_dict;
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_BACKPORT_VECTORCALL || 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);
/* CLineInTraceback.proto */
#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 */
#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);
/* 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;
/* MemviewSliceIsContig.proto */
static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
/* OverlappingSlices.proto */
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
__Pyx_memviewslice *slice2,
int ndim, size_t itemsize);
/* LengthHint.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyObject_LengthHint(o, defaultval) (defaultval)
#else
#define __Pyx_PyObject_LengthHint(o, defaultval) PyObject_LengthHint(o, defaultval)
#endif
/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __Pyx_TypeInfo *b);
/* MemviewSliceValidateAndInit.proto */
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);
/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
/* 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
/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_double(const 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
/* MemviewSliceCopyTemplate.proto */
static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
const char *mode, int ndim,
size_t sizeof_dtype, int contig_flag,
int dtype_is_object);
/* MemviewSliceInit.proto */
#include <stdio.h>
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#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
static int __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
int memview_is_new_reference);
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);
/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_intp(npy_intp value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
/* CIntFromPy.proto */
static CYTHON_INLINE npy_intp __Pyx_PyLong_As_npy_intp(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);
/* 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
/* GetRuntimeVersion.proto */
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);
/* 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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
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*/
/* Module declarations from "libc.string" */
/* Module declarations from "libc.stdlib" */
/* Module declarations from "cython.view" */
/* Module declarations from "cython.dataclasses" */
/* Module declarations from "cython" */
/* 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 "libcpp" */
/* Module declarations from "libcpp.vector" */
/* Module declarations from "libcpp.utility" */
/* Module declarations from "libcpp.unordered_map" */
/* Module declarations from "libcpp.string_view" */
/* Module declarations from "libcpp.string" */
/* Module declarations from "anyode" */
/* Module declarations from "chemreac" */
/* Module declarations from "cvodes_cxx" */
/* Module declarations from "cvodes_anyode" */
/* Module declarations from "chemreac._chemreac" */
static PyObject *__pyx_collections_abc_Sequence = 0;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static int __pyx_memoryview_thread_locks_used;
static PyThread_type_lock __pyx_memoryview_thread_locks[8];
static PyObject *__pyx_f_8chemreac_9_chemreac_fromaddress(PyObject *, PyObject *, struct __pyx_opt_args_8chemreac_9_chemreac_fromaddress *__pyx_optional_args); /*proto*/
static void __pyx_f_8chemreac_9_chemreac__add_2_vecs(int, double *, double *, double, double, double *); /*proto*/
static void __pyx_f_8chemreac_9_chemreac__add_5_vecs(int, double *, double *, double *, double *, double *, double, double, double, double, double, double *); /*proto*/
static void __pyx_f_8chemreac_9_chemreac__rk4(chemreac::ReactionDiffusion<double> *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *); /*proto*/
static PyObject *__pyx_f_8chemreac_9_chemreac___pyx_unpickle_ArrayWrapper__set_state(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *, PyObject *); /*proto*/
static std::pair<double,double> __pyx_convert_pair_from_py_double__and_double(PyObject *); /*proto*/
static PyObject *__pyx_convert_vector_to_py_double(std::vector<double> const &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_int(std::vector<int> const &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(std::vector<std::vector<int> > const &); /*proto*/
static PyObject *__pyx_convert_pair_to_py_double____double(std::pair<double,double> const &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(std::vector<std::vector<double> > const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static PyObject *__pyx_convert_unordered_map_to_py_std_3a__3a_string____int(std::unordered_map<std::string,int> const &); /*proto*/
static PyObject *__pyx_convert_unordered_map_to_py_std_3a__3a_string____double(std::unordered_map<std::string,double> const &); /*proto*/
static PyObject *__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_double_3e___(std::unordered_map<std::string,std::vector<double> > const &); /*proto*/
static PyObject *__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_int_3e___(std::unordered_map<std::string,std::vector<int> > const &); /*proto*/
static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *); /*proto*/
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 PyObject *_unellipsify(PyObject *, int); /*proto*/
static int assert_direct_dimensions(Py_ssize_t *, int); /*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 Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*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_with_gil(char *, Py_ssize_t *, Py_ssize_t *, 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_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
static std::vector<int> __pyx_convert_vector_from_py_int(PyObject *); /*proto*/
static std::vector<std::vector<int> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(PyObject *); /*proto*/
static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *); /*proto*/
static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *); /*proto*/
static std::vector<realtype> __pyx_convert_vector_from_py_realtype(PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
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_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "chemreac._chemreac"
extern int __pyx_module_is_main_chemreac___chemreac;
int __pyx_module_is_main_chemreac___chemreac = 0;
/* Implementation of "chemreac._chemreac" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_ImportError;
/* #### Code section: string_decls ### */
static const char __pyx_k_[] = ": ";
static const char __pyx_k_6[] = "\200\001\330\004*\250!\2506\260\021";
static const char __pyx_k_D[] = "D";
static const char __pyx_k_N[] = "N";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_Q[] = "\200\001\330\004\n\210+\220Q";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k__2[] = ".";
static const char __pyx_k__3[] = ">";
static const char __pyx_k__4[] = "'";
static const char __pyx_k__5[] = ")";
static const char __pyx_k__8[] = "?";
static const char __pyx_k_bi[] = "bi";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_nr[] = "nr";
static const char __pyx_k_ny[] = "ny";
static const char __pyx_k_pi[] = "pi";
static const char __pyx_k_rd[] = "rd";
static const char __pyx_k_si[] = "si";
static const char __pyx_k_t0[] = "t0";
static const char __pyx_k_td[] = "td";
static const char __pyx_k_y0[] = "y0";
static const char __pyx_k_abc[] = "abc";
static const char __pyx_k_all[] = "all";
static const char __pyx_k_and[] = " and ";
static const char __pyx_k_exp[] = "exp";
static const char __pyx_k_fcs[] = "fcs";
static const char __pyx_k_got[] = " (got ";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_log[] = "log";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_rk4[] = "rk4";
static const char __pyx_k_str[] = "str";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_xci[] = "xci";
static const char __pyx_k_A_HN[] = "\200A\330\010\014\210H\220N\240!";
static const char __pyx_k_Jout[] = "Jout";
static const char __pyx_k_atol[] = "atol";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_diff[] = "diff";
static const char __pyx_k_expb[] = "expb";
static const char __pyx_k_fout[] = "fout";
static const char __pyx_k_func[] = "__func__";
static const char __pyx_k_geom[] = "geom";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_linC[] = "linC";
static const char __pyx_k_logb[] = "logb";
static const char __pyx_k_logt[] = "logt";
static const char __pyx_k_logx[] = "logx";
static const char __pyx_k_logy[] = "logy";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_maxl[] = "maxl";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_msbj[] = "msbj";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_ndim[] = "ndim";
static const char __pyx_k_nfev[] = "nfev";
static const char __pyx_k_njev[] = "njev";
static const char __pyx_k_nout[] = "nout";
static const char __pyx_k_pack[] = "pack";
static const char __pyx_k_rtol[] = "rtol";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_tbuf[] = "tbuf";
static const char __pyx_k_tend[] = "tend";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_tout[] = "tout";
static const char __pyx_k_yout[] = "yout";
static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_at_0x[] = " at 0x";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_descr[] = "descr";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_lin_x[] = "lin_x";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_lrefl[] = "lrefl";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rrefl[] = "rrefl";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_utf_8[] = "utf-8";
static const char __pyx_k_xyout[] = "xyout";
static const char __pyx_k_y0out[] = "y0out";
static const char __pyx_k_y1out[] = "y1out";
static const char __pyx_k_z_chg[] = "z_chg";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_cumsum[] = "cumsum";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_dx_max[] = "dx_max";
static const char __pyx_k_dx_min[] = "dx_min";
static const char __pyx_k_efield[] = "efield";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_ew_ele[] = "ew_ele";
static const char __pyx_k_fields[] = "fields";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_method[] = "method";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_nderiv[] = "nderiv";
static const char __pyx_k_nsteps[] = "nsteps";
static const char __pyx_k_object[] = " object>";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_A_t8_aq[] = "\200A\330\010\017\210t\2208\320\033.\250a\250q";
static const char __pyx_k_asarray[] = "asarray";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_eps_lin[] = "eps_lin";
static const char __pyx_k_eps_rel[] = "eps_rel";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_fortran[] = "fortran";
static const char __pyx_k_memview[] = "memview";
static const char __pyx_k_npoints[] = "npoints";
static const char __pyx_k_reshape[] = "reshape";
static const char __pyx_k_squeeze[] = "squeeze";
static const char __pyx_k_strides[] = "strides";
static const char __pyx_k_success[] = "success";
static const char __pyx_k_typestr[] = "typestr";
static const char __pyx_k_version[] = "version";
static const char __pyx_k_Ellipsis[] = "Ellipsis";
static const char __pyx_k_Sequence[] = "Sequence";
static const char __pyx_k_add_note[] = "add_note";
static const char __pyx_k_g_values[] = "g_values";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_itemsize[] = "itemsize";
static const char __pyx_k_mobility[] = "mobility";
static const char __pyx_k_nreached[] = "nreached";
static const char __pyx_k_nstencil[] = "nstencil";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_register[] = "register";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_surf_chg[] = "surf_chg";
static const char __pyx_k_use_log2[] = "use_log2";
static const char __pyx_k_A_t8_aq_2[] = "\200A\330\010\017\210t\2208\230;\240a\240q";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_durations[] = "durations";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_ilu_limit[] = "ilu_limit";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_iter_type[] = "iter_type";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_undecided[] = "undecided";
static const char __pyx_k_xc_bi_map[] = "_xc_bi_map";
static const char __pyx_k_xyout_arr[] = "xyout_arr";
static const char __pyx_k_A_HL_aq_t1[] = "\200A\330\010\014\210H\220L\240\001\240\021\240$\240a\240q\330\010\017\210t\2201";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_ew_ele_arr[] = "ew_ele_arr";
static const char __pyx_k_ew_ele_out[] = "ew_ele_out";
static const char __pyx_k_first_step[] = "first_step";
static const char __pyx_k_modulation[] = "modulation";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_xyout_dims[] = "xyout_dims";
static const char __pyx_k_A_4q_1Bb_2T[] = "\200A\340\010\013\2104\210q\330\014\023\2201\220B\220b\230\010\240\001\240\021\340\014\023\2202\220T\230\021\230!";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_auto_efield[] = "auto_efield";
static const char __pyx_k_autorestart[] = "autorestart";
static const char __pyx_k_calc_efield[] = "calc_efield";
static const char __pyx_k_clip_to_pos[] = "clip_to_pos";
static const char __pyx_k_constraints[] = "constraints";
static const char __pyx_k_ew_ele_dims[] = "ew_ele_dims";
static const char __pyx_k_n_jac_diags[] = "n_jac_diags";
static const char __pyx_k_stoich_prod[] = "stoich_prod";
static const char __pyx_k_with_jtimes[] = "with_jtimes";
static const char __pyx_k_A_H_3aq_T_Qa[] = "\200A\360*\000\t\r\210H\320\024*\250!\2503\250a\250q\260\001\260\024\260T\270\021\270#\270Q\270a";
static const char __pyx_k_ArrayWrapper[] = "ArrayWrapper";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_root_indices[] = "root_indices";
static const char __pyx_k_roots_output[] = "roots_output";
static const char __pyx_k_stab_lim_det[] = "stab_lim_det";
static const char __pyx_k_stoich_inact[] = "stoich_inact";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_MemoryView_of[] = "<MemoryView of ";
static const char __pyx_k_Unkown_geom_s[] = "Unkown geom %s";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_diag_data_len[] = "diag_data_len";
static const char __pyx_k_faraday_const[] = "faraday_const";
static const char __pyx_k_get_last_info[] = "get_last_info";
static const char __pyx_k_linear_solver[] = "linear_solver";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_stoich_active[] = "stoich_active";
static const char __pyx_k_with_jacobian[] = "with_jacobian";
static const char __pyx_k_zero_counters[] = "zero_counters";
static const char __pyx_k_A_4q_4q_b_AQ_q[] = "\200A\340\010\021\220\022\2204\220q\230\001\330\010\013\2104\210q\330\014\026\220b\230\004\230A\230Q\330\010\017\210q";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_block_diag_ilu[] = "block_diag_ilu";
static const char __pyx_k_cvode_adaptive[] = "cvode_adaptive";
static const char __pyx_k_dense_jac_cmaj[] = "dense_jac_cmaj";
static const char __pyx_k_dense_jac_rmaj[] = "dense_jac_rmaj";
static const char __pyx_k_modulated_rxns[] = "modulated_rxns";
static const char __pyx_k_return_on_root[] = "return_on_root";
static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
static const char __pyx_k_banded_jac_cmaj[] = "banded_jac_cmaj";
static const char __pyx_k_collections_abc[] = "collections.abc";
static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
static const char __pyx_k_g_value_parents[] = "g_value_parents";
static const char __pyx_k_integrated_conc[] = "integrated_conc";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_return_on_error[] = "return_on_error";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_cvode_predefined[] = "cvode_predefined";
static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
static const char __pyx_k_stencil_bi_lbound[] = "_stencil_bi_lbound";
static const char __pyx_k_A_t1_AZt1_AZt1_A_q[] = "\200A\330\010\017\210t\2201\360\010\000\t\r\210A\210Z\220t\2301\330\010\014\210A\210Z\220t\2301\330\010\014\210A\210]\230!\330\010\017\210q";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_chemreac__chemreac[] = "chemreac._chemreac";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_PyReactionDiffusion[] = "PyReactionDiffusion";
static const char __pyx_k_compressed_jac_cmaj[] = "compressed_jac_cmaj";
static const char __pyx_k_vacuum_permittivity[] = "vacuum_permittivity";
static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
static const char __pyx_k_y0_of_incorrect_size[] = "y0 of incorrect size";
static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
static const char __pyx_k_PyReactionDiffusion_f[] = "PyReactionDiffusion.f";
static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
static const char __pyx_k_last_integration_info[] = "last_integration_info";
static const char __pyx_k_per_rxn_contrib_to_fi[] = "per_rxn_contrib_to_fi";
static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
static const char __pyx_k_chemreac__chemreac_pyx[] = "chemreac/_chemreac.pyx";
static const char __pyx_k_A_q_c_Q_q_c_Q_HD_AQat1D[] = "\200A\340\010\017\210q\220\006\220c\230\024\230Q\330\010\017\210q\220\006\220c\230\024\230Q\330\010\014\210H\220D\230\001\230\023\230A\230Q\230a\230t\2401\240D\250\001\250\021";
static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
static const char __pyx_k_PyReactionDiffusion_expb[] = "PyReactionDiffusion.expb";
static const char __pyx_k_PyReactionDiffusion_logb[] = "PyReactionDiffusion.logb";
static const char __pyx_k_hk_A_1_A_A_B_xq_7_a_nA_1[] = "\200\001\360\006\000\005\010\200\220h\230k\250\033\260A\330\010\r\210^\2301\330\010\016\320\016!\320!~\360\000\000\001A\002\360\000\000A\002B\002\330\004\023\220<\230x\240q\250\001\330\004\007\200|\2207\230!\330\010.\250a\250\270n\310A\330\004\013\2101";
static const char __pyx_k_linC_must_be_of_length_N[] = "linC must be of length N";
static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
static const char __pyx_k_pyx_unpickle_ArrayWrapper[] = "__pyx_unpickle_ArrayWrapper";
static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
static const char __pyx_k_ArrayWrapper___reduce_cython[] = "ArrayWrapper.__reduce_cython__";
static const char __pyx_k_G_ST_22EEUUV_eeiiuuv_BfAYeSTT[] = "\200\001\360\n\000\t\n\330\010\t\330\010*\320*G\300|\320ST\330\010\037\320\0372\3202E\320EU\320UV\330\010$\320$<\320<e\320ei\320iu\320uv\340\010<\270B\270f\300A\300Y\310e\320ST\320T\\\320\\^\320^_\330\010<\270B\270f\300A\300T\310\025\310a\310r\320QS\320ST\320TV\320VW\330\010<\270B\270f\300A\300W\310A\310Q\340\010\036\230a\360\006\000\t\026\220Q\340\004\013\2108\2202\220Q\330\004\013\2109\220F\230#\230V\2401\330\004\013\2102\210V\2203\220b\230\002\230!\2302\230Q\330\004\013\2104\210u\220C\220t\2303\230b\240\002\240!\2402\240Q\330\004\013\2103\210a\210r\220\033\230C\230s\240!\330\004\010\210\005\210U\220!\2202\220R\220q\230\002\230!\330\010\014\210A\210U\220\"\220A\220Q\330\004\007\200q\330\010\025\220R\220v\230R\230t\2407\250#\250R\250t\2602\260Q\340\004\010\210\001\210\025\210a\330\004\010\210\001\210\031\220+\230R\230w\240a\240q\330\004\010\210\005\210U\220!\2203\220a\330\010\014\210A\210S\220\013\2304\230s\240\"\240I\250R\250q\260\001\260\031\270!\2701\330\004\013\2102\210T\220\021\220\"\220E\230\021\230&\240\002\240!\330\004\006\200n\220A\330\004\010\210\005\210U\220!\2209\230A\330\010\021\220\021\220!\2207\230!\2302\230R\230q\240\002\240!\330\010\n\210*\220A\220Q\220f\230A\230Q\330\010\014\210E\220\025\220a\220s\230'\240\021\240!\330\014\020\220\001\220\025\220a\220q\230\t\240\021\240\"\240A\240Q\330\010\013\2101\330\014\031\230\032\240:\250V\2602\260Q\340\010\023\320\023$\320$?\270q\330\014\016\210j\230\006\230f\240M\260\021\260&\270\006\270b\300\007\300q\310\001\330\014\r\210T\220\021\220)\2307\240!\2403\240a\240t\2501\250D\260\001\260\024\260Q\260a\330\014\032\230.\250\010\260\014\270A\330\014\024\220O\320#6\260a\260y\300\006\300b\310\007\310q\320PQ\330\014#\2401\240M\260\027\270\001\270\033\300F\310)\320ST\330\014\031\320\031*\250%\320/@\300\003\300<\310}\320\\b\320bc\340\010\013\2109\220C\220w\230a\230q\330\014\022\220*\230A\320\035E\300R\300q\330\004\013\2106\220\024\220X\230R\230t\2407\250\"\250D\260\002\260!";
static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
static const char __pyx_k_ArrayWrapper___setstate_cython[] = "ArrayWrapper.__setstate_cython__";
static const char __pyx_k_PyReactionDiffusion__xc_bi_map[] = "PyReactionDiffusion._xc_bi_map";
static const char __pyx_k_T_G1F_a_vWA_q_t_0_q_q_T_G1_T_A[] = "\200\001\360\010\000\005\016\210T\220\021\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220A\330\010\022\220!\330\010\027\220q\340\010\027\220t\320\0330\260\007\260q\330\004\007\200q\330\010\017\320\017-\250T\260\021\260'\270\033\300G\3101\340\010\017\320\017-\250T\260\021\260'\270\033\300A";
static const char __pyx_k_lower_bounds_of_incorrect_size[] = "lower_bounds of incorrect size";
static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
static const char __pyx_k_upper_bounds_of_incorrect_size[] = "upper_bounds of incorrect size";
static const char __pyx_k_5BfBd_8SYY_4BfBd_8SYY_Rxq_Rxq_w[] = "\200\001\360\n\000\0055\260B\260f\270B\270d\300'\310\022\3108\320SY\320Y[\320[\\\330\0044\260B\260f\270B\270d\300'\310\022\3108\320SY\320Y[\320[\\\330\004\010\210\001\210\022\210:\220R\220x\230q\240\005\240R\240x\250q\260\007\260w\270a\330\004\013\2105\220\010\230\002\230$\230g\240R\240t\2502\250V\2605\270\010\300\002\300$\300g\310R\310t\320SU\320UV";
static const char __pyx_k_A_1_q_c_Rq_A_t6_D_4r_c_1A_D_D_H[] = "\200A\340\010\r\320\r#\2401\330\010\017\210q\220\006\220c\230\024\230R\230q\240\004\240A\330\010\017\210t\2206\230\023\230D\240\002\240!\2404\240r\250\021\250$\250c\260\022\2601\260A\260]\300!\330\014\020\220\004\220D\230\004\230D\240\001\330\010\014\210H\320\024(\250\001\330\014\017\210q\220\001\220\021\220$\220f\230J\240d\250'\260\024\260Q";
static const char __pyx_k_A_4wd_a_AQ_4vS_2T_E_gQa_s_2T_Cq[] = "\200A\360\n\000\t\014\2104\210w\220d\230$\230a\330\014\022\220*\230A\230Q\330\010\013\2104\210v\220S\230\001\330\014\023\2202\220T\230\021\230\"\230E\240\021\240$\240g\250Q\250a\330\r\021\220\026\220s\230!\330\014\023\2202\220T\230\021\230\"\230C\230q\240\002\240%\240q\250\004\250F\260\"\260B\260a\260q\330\r\021\220\026\220s\230!\330\014\023\2202\220T\230\021\230!\2301\230B\230c\240\021\240!\2401\240B\240e\2501\250D\260\006\260b\270\002\270!\2701\340\014\022\320\022%\240Q\320&7\260r\270\024\270Q";
static const char __pyx_k_A_G_ST_22EEUUV_jjnnzz_2Qb_2_F_4[] = "\200\001\360\006\000@\001A\001\330\010*\320*G\300|\320ST\330\010\037\320\0372\3202E\320EU\320UV\330\010$\320$<\320<j\320jn\320nz\320z{\340\010\021\220\022\2202\220Q\220b\230\001\330\0102\260\"\260F\270!\2704\270u\300A\300Q\330\0108\270\002\270&\300\002\300$\300g\310S\320PR\320RV\320VX\320XY\360\006\000\t\026\220Q\330\004\013\2102\210V\2203\220b\230\002\230!\2302\230Q\330\004\013\2104\210u\220C\220t\2303\230b\240\002\240!\2402\240Q\330\004\017\320\017 \320 ;\2701\330\010\n\210*\220F\230&\240\r\250Q\250f\260F\270\"\270G\3001\300A\330\010\t\210\022\2101\210D\220\004\220G\2301\230D\240\001\240\024\240Q\240d\250!\2504\250~\270^\3108\320S_\320_`\330\010\020\220\017\320\0372\260!\2609\270F\300\"\300G\3101\310A\330\010\037\230q\240\r\250W\260A\260Q\330\010\016\210i\220x\230}\320,=\270U\320BS\320SV\320V`\320`j\320js\320s\360\000\000@\002F\002\360\000\000F\002S\002\360\000\000S\002Y\002\360\000\000Y\002Z\002\330\004\013\2102\210^\2301\230H\240I\320-=\270T\300\031\310\"\310D\320P[\320[\\\330\004\010\210\001\210\036\220q\330\004\007\200q\330\010\014\210A\210\\\230\032\2408\2501\340\004\013\2104\210x\220r\230\024\230W\240B\240d\250\"\250F\260!";
static const char __pyx_k_A_G_ST_22EQ_6a_NdR___81_6_Bb_Rv[] = "\200\001\360\006\000@\001A\001\330\010*\320*G\300|\320ST\330\010\037\320\0372\3202E\300Q\330\010#\320#6\260a\330\010 \320 N\310d\320R^\320^_\340\010\033\2308\2401\340\010\031\230\032\2406\250\021\250\"\250B\250b\260\005\260R\260v\270Q\270c\300\022\3002\300Q\300a\360\014\000\t\022\220\022\2202\220Q\220b\230\001\330\004\007\200r\210\026\210s\220!\330\010\016\210j\230\001\230\021\340\004\013\2104\210u\220C\220t\2303\230b\240\002\240!\2402\240Q\330\004\t\210\021\210%\210q\330\004\010\210\005\210U\220!\2202\220Q\330\010\r\210Q\210a\210q\220\005\220R\220q\230\001\330\004\007\200q\330\010\025\220Y\230f\240A\240Q\240a\240r\250\021\250\"\250A\250Q\330\010\014\210E\220\025\220a\220q\330\014\026\220a\220u\230A\340\004\013\210?\320\0325\260Q\330\010\t\210\027\220\001\220\024\220R\220z\240\026\240v\250]\270!\2706\300\026\300r\310\027\320PQ\320QR\330\010\016\210n\230H\240L\260\001\330\010\020\220\017\320\0372\260!\2609\270F\300\"\300G\3101\310A\330\010\037\230q\240\r\250W\260A\260[\300\006\300i\310q\330\010\030\230\r\240Q\330\010\r\320\r\036\230c\240\023\240A\240^\260<\270v\300]\320RX\320XY\330\004\016\210a\210u\220E\230\022\2301\330\004\016\210a\210u\220B\220e\2302\230V\2401\240C\240r\250\021\330\004\023\320\023-\250Q\250c\260\037\300\r\310X\320UV\330\004\027\220q\230\016\240a\330\004\013\2109\220D\230\001\330\004\013\2109\220D\230\001\330\004\007\200q\330\010\013\210?\230$\230l\250!\250<\260u\270C\270r\300\023\300C\300s\310!\3106\320QS\320ST\330\014\026\220a\340\014\026\220d\230\"\230C\230s\240!\340\010\022\220!\330\004\013\2102\210^\2301\230H\240A\330\004\007\200q\330\010\023\2201\220E\230\025\230b\240\001\330\010\023\2201\220E\230\021\330\010\023\2201\220E\230\022\2301\330\010\023\2201\220E\230\022\2301\330\010\030\320\0302\260!\2603\3206F\300m\320S[\320[\\\330\010\033\2301\230O\2501\330\010\014\210A\210\\\230\021\340\004\013\2106\220\024\220X\230R\230t\2407\250\"\250D\260\002\260&\270\001";
static const char __pyx_k_A_b_Q_q_c_Rq_A_t6_S_b_t6_S_Bat1[] = "\200A\340\010\032\230$\230b\240\001\240\024\240Q\330\010\017\210q\220\006\220c\230\024\230R\230q\240\004\240A\330\010\017\210t\2206\230\021\230#\230S\240\001\240\021\240$\240b\250\001\250\024\250\\\270\021\270!\330\010\017\210t\2206\230\021\230#\230S\240\004\240B\240a\240t\2501\330\010\014\210H\320\024$\240A\330\014\017\210q\220\001\220\021\220$\220f\230J\240d\250&\260\002\260(\270$\270f\300A\300Q";
static const char __pyx_k_PyReactionDiffusion__stencil_bi[] = "PyReactionDiffusion._stencil_bi_lbound";
static const char __pyx_k_PyReactionDiffusion_calc_efield[] = "PyReactionDiffusion.calc_efield";
static const char __pyx_k_need_boolean_for_use_get_dx_max[] = "need boolean for use_get_dx_max";
static const char __pyx_k_only_field_type_assumed_for_now[] = "only field type assumed for now";
static const char __pyx_k_A_q_c_Rq_A_t6_S_Bat1_t6_S_Bat1_H[] = "\200A\340\010\017\210q\220\006\220c\230\024\230R\230q\240\004\240A\330\010\017\210t\2206\230\021\230#\230S\240\004\240B\240a\240t\2501\330\010\017\210t\2206\230\021\230#\230S\240\004\240B\240a\240t\2501\330\010\014\210H\220O\2401\330\014\017\210q\220\001\220\021\220$\220f\230A\230T\240\021\240#\240T\250\024\250V\2601\260A";
static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
static const char __pyx_k_Did_not_reach_all_points_for_ind[] = "Did not reach all points for index %d";
static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.";
static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
static const char __pyx_k_PyReactionDiffusion___reduce_cyt[] = "PyReactionDiffusion.__reduce_cython__";
static const char __pyx_k_PyReactionDiffusion___setstate_c[] = "PyReactionDiffusion.__setstate_cython__";
static const char __pyx_k_PyReactionDiffusion_banded_jac_c[] = "PyReactionDiffusion.banded_jac_cmaj";
static const char __pyx_k_PyReactionDiffusion_compressed_j[] = "PyReactionDiffusion.compressed_jac_cmaj";
static const char __pyx_k_PyReactionDiffusion_dense_jac_cm[] = "PyReactionDiffusion.dense_jac_cmaj";
static const char __pyx_k_PyReactionDiffusion_dense_jac_rm[] = "PyReactionDiffusion.dense_jac_rmaj";
static const char __pyx_k_PyReactionDiffusion_get_last_inf[] = "PyReactionDiffusion.get_last_info";
static const char __pyx_k_PyReactionDiffusion_integrated_c[] = "PyReactionDiffusion.integrated_conc";
static const char __pyx_k_PyReactionDiffusion_per_rxn_cont[] = "PyReactionDiffusion.per_rxn_contrib_to_fi";
static const char __pyx_k_PyReactionDiffusion_zero_counter[] = "PyReactionDiffusion.zero_counters";
static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
static const char __pyx_k_cvode_predefined_durations_field[] = "cvode_predefined_durations_fields";
static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
static const char __pyx_k_lower_bounds_of_incorrect_length[] = "lower_bounds of incorrect length";
static const char __pyx_k_need_boolean_for_error_outside_b[] = "need boolean for error_outside_bounds";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static const char __pyx_k_upper_bounds_of_incorrect_length[] = "upper_bounds of incorrect length";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0x00ad8de, 0xc0a2011, 0x5d109e5) = (__array_interface__))";
/* #### Code section: decls ### */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper___init__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface_____get__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___2__set__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___4__del__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_2__reduce_cython__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_4__setstate_cython__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion___cinit__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, int __pyx_v_n, std::vector<std::vector<int> > __pyx_v_stoich_active, std::vector<std::vector<int> > __pyx_v_stoich_prod, std::vector<double> __pyx_v_k, int __pyx_v_N, std::vector<double> __pyx_v_D, std::vector<int> __pyx_v_z_chg, std::vector<double> __pyx_v_mobility, std::vector<double> __pyx_v_x, std::vector<std::vector<int> > __pyx_v_stoich_inact, int __pyx_v_geom, int __pyx_v_logy, int __pyx_v_logt, int __pyx_v_logx, std::vector<std::vector<double> > __pyx_v_g_values, std::vector<int> __pyx_v_g_value_parents, std::vector<std::vector<double> > __pyx_v_fields, std::vector<int> __pyx_v_modulated_rxns, std::vector<std::vector<double> > __pyx_v_modulation, int __pyx_v_nstencil, int __pyx_v_lrefl, int __pyx_v_rrefl, int __pyx_v_auto_efield, std::pair<double,double> __pyx_v_surf_chg, double __pyx_v_eps_rel, double __pyx_v_faraday_const, double __pyx_v_vacuum_permittivity, double __pyx_v_ilu_limit, int __pyx_v_n_jac_diags, int __pyx_v_use_log2, int __pyx_v_clip_to_pos); /* proto */
static void __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_2__dealloc__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_4f(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, double __pyx_v_t, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_fout); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_6dense_jac_rmaj(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, double __pyx_v_t, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_Jout); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8dense_jac_cmaj(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, double __pyx_v_t, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_Jout); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_10banded_jac_cmaj(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, double __pyx_v_t, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_Jout); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_12compressed_jac_cmaj(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, double __pyx_v_t, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_Jout); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14calc_efield(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyArrayObject *__pyx_v_linC); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_16integrated_conc(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_linC); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5lin_x___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_1n___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_1N___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_2nr___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_4geom___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_13stoich_active___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_11stoich_prod___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_12stoich_inact___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_1k___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_1k_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, std::vector<double> __pyx_v_k); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_1D___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_1D_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, std::vector<double> __pyx_v_D); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5z_chg___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5z_chg_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, std::vector<int> __pyx_v_z_chg); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8mobility___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8mobility_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, std::vector<double> __pyx_v_mobility); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_1x___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_4logy___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_4logt___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_4logx___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8nstencil___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_6nsidep___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5lrefl___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5rrefl___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_11auto_efield___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8surf_chg___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_7eps_rel___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_13faraday_const___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_19vacuum_permittivity___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8g_values___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8g_values_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, std::vector<std::vector<double> > __pyx_v_g_values); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_15g_value_parents___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_15g_value_parents_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, std::vector<int> __pyx_v_g_value_parents); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_6fields___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_6fields_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, std::vector<std::vector<double> > __pyx_v_fields); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14modulated_rxns___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14modulated_rxns_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, std::vector<int> __pyx_v_modulated_rxns); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_10modulation___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_10modulation_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, std::vector<std::vector<double> > __pyx_v_modulation); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_9ilu_limit___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_11n_jac_diags___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8use_log2___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_11clip_to_pos___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_12upper_bounds___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_12upper_bounds_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_12lower_bounds___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_12lower_bounds_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_17get_dx_max_factor___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_17get_dx_max_factor_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_22get_dx_max_upper_limit___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_22get_dx_max_upper_limit_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14get_dx0_factor___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14get_dx0_factor_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14get_dx0_max_dx___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14get_dx0_max_dx_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14use_get_dx_max___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14use_get_dx_max_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_20error_outside_bounds___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_20error_outside_bounds_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_18logb(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_20expb(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_4nfev___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_4njev___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_11nprec_setup___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_11nprec_solve___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_11njacvec_dot___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_15nprec_solve_ilu___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_14nprec_solve_lu___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_21last_integration_info___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_25last_integration_info_dbl___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_28last_integration_info_vecdbl___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_28last_integration_info_vecint___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_22get_last_info(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_success); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_24zero_counters(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_26per_rxn_contrib_to_fi(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, double __pyx_v_t, PyArrayObject *__pyx_v_y, int __pyx_v_si, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8xcenters___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_2xc___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_8D_weight___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_6_gradD___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_28_stencil_bi_lbound(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, int __pyx_v_bi); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_30_xc_bi_map(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, int __pyx_v_xci); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_6efield___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_6efield_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, __Pyx_memviewslice __pyx_v_efield); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5k_err___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5k_err_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5D_err___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5D_err_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5names___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5names_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_5names_4__del__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_9tex_names___get__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_9tex_names_2__set__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_9tex_names_4__del__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_cvode_predefined(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_rd, PyArrayObject *__pyx_v_y0, PyArrayObject *__pyx_v_tout, std::vector<realtype> __pyx_v_atol, double __pyx_v_rtol, PyObject *__pyx_v_method, bool __pyx_v_with_jacobian, PyObject *__pyx_v_iter_type, PyObject *__pyx_v_linear_solver, int __pyx_v_maxl, double __pyx_v_eps_lin, double __pyx_v_first_step, double __pyx_v_dx_min, double __pyx_v_dx_max, int __pyx_v_nsteps, int __pyx_v_autorestart, bool __pyx_v_return_on_error, bool __pyx_v_with_jtimes, bool __pyx_v_ew_ele, std::vector<double> __pyx_v_constraints, int __pyx_v_msbj, bool __pyx_v_stab_lim_det); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_2cvode_predefined_durations_fields(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_rd, PyArrayObject *__pyx_v_y0, PyArrayObject *__pyx_v_durations, PyArrayObject *__pyx_v_fields, std::vector<realtype> __pyx_v_atol, double __pyx_v_rtol, PyObject *__pyx_v_method, int __pyx_v_npoints, bool __pyx_v_with_jacobian, PyObject *__pyx_v_iter_type, PyObject *__pyx_v_linear_solver, int __pyx_v_maxl, double __pyx_v_eps_lin, double __pyx_v_first_step, double __pyx_v_dx_min, double __pyx_v_dx_max, int __pyx_v_nsteps, int __pyx_v_autorestart, bool __pyx_v_return_on_error, bool __pyx_v_with_jtimes, PyObject *__pyx_v_ew_ele, std::vector<double> __pyx_v_constraints, int __pyx_v_msbj, bool __pyx_v_stab_lim_det); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_4cvode_adaptive(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_rd, PyArrayObject *__pyx_v_y0, double __pyx_v_t0, double __pyx_v_tend, std::vector<realtype> __pyx_v_atol, double __pyx_v_rtol, PyObject *__pyx_v_method, bool __pyx_v_with_jacobian, PyObject *__pyx_v_iter_type, PyObject *__pyx_v_linear_solver, int __pyx_v_maxl, double __pyx_v_eps_lin, double __pyx_v_first_step, double __pyx_v_dx_min, double __pyx_v_dx_max, int __pyx_v_nsteps, bool __pyx_v_return_on_root, int __pyx_v_autorestart, bool __pyx_v_return_on_error, bool __pyx_v_with_jtimes, bool __pyx_v_ew_ele, std::vector<double> __pyx_v_constraints, int __pyx_v_msbj, bool __pyx_v_stab_lim_det); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_6rk4(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_rd, PyObject *__pyx_v_y0, PyObject *__pyx_v_tout); /* proto */
static PyObject *__pyx_pf_8chemreac_9_chemreac_8__pyx_unpickle_ArrayWrapper(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_8chemreac_9_chemreac_ArrayWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8chemreac_9_chemreac_PyReactionDiffusion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8chemreac_9_chemreac___pyx_defaults(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### 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;
#ifdef __Pyx_CyFunction_USED
PyTypeObject *__pyx_CyFunctionType;
#endif
#ifdef __Pyx_FusedFunction_USED
PyTypeObject *__pyx_FusedFunctionType;
#endif
#ifdef __Pyx_Generator_USED
PyTypeObject *__pyx_GeneratorType;
#endif
#ifdef __Pyx_IterableCoroutine_USED
PyTypeObject *__pyx_IterableCoroutineType;
#endif
#ifdef __Pyx_Coroutine_USED
PyTypeObject *__pyx_CoroutineAwaitType;
#endif
#ifdef __Pyx_Coroutine_USED
PyTypeObject *__pyx_CoroutineType;
#endif
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_8chemreac_9_chemreac_ArrayWrapper;
PyObject *__pyx_type_8chemreac_9_chemreac_PyReactionDiffusion;
PyObject *__pyx_type_8chemreac_9_chemreac___pyx_defaults;
PyObject *__pyx_type___pyx_array;
PyObject *__pyx_type___pyx_MemviewEnum;
PyObject *__pyx_type___pyx_memoryview;
PyObject *__pyx_type___pyx_memoryviewslice;
PyTypeObject *__pyx_ptype_8chemreac_9_chemreac_ArrayWrapper;
PyTypeObject *__pyx_ptype_8chemreac_9_chemreac_PyReactionDiffusion;
PyTypeObject *__pyx_ptype_8chemreac_9_chemreac___pyx_defaults;
PyTypeObject *__pyx_array_type;
PyTypeObject *__pyx_MemviewEnum_type;
PyTypeObject *__pyx_memoryview_type;
PyTypeObject *__pyx_memoryviewslice_type;
__Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
__Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type__lower;
PyObject *__pyx_k__6;
std::pair<double,double> __pyx_k__7;
PyObject *__pyx_slice[2];
PyObject *__pyx_tuple[7];
PyObject *__pyx_codeobj_tab[23];
PyObject *__pyx_string_tab[312];
PyObject *__pyx_int_0;
PyObject *__pyx_int_1;
PyObject *__pyx_int_2;
PyObject *__pyx_int_3;
PyObject *__pyx_int_4;
PyObject *__pyx_int_710878;
PyObject *__pyx_int_97585637;
PyObject *__pyx_int_112105877;
PyObject *__pyx_int_136983863;
PyObject *__pyx_int_184977713;
PyObject *__pyx_int_201990161;
PyObject *__pyx_int_neg_1;
/* #### Code section: module_state_contents ### */
/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#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_n_u_ASCII __pyx_string_tab[1]
#define __pyx_kp_u_All_dimensions_preceding_dimensi __pyx_string_tab[2]
#define __pyx_n_u_ArrayWrapper __pyx_string_tab[3]
#define __pyx_n_u_ArrayWrapper___reduce_cython __pyx_string_tab[4]
#define __pyx_n_u_ArrayWrapper___setstate_cython __pyx_string_tab[5]
#define __pyx_n_u_AssertionError __pyx_string_tab[6]
#define __pyx_kp_u_Buffer_view_does_not_expose_stri __pyx_string_tab[7]
#define __pyx_kp_u_Can_only_create_a_buffer_that_is __pyx_string_tab[8]
#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[9]
#define __pyx_kp_u_Cannot_create_writable_memory_vi __pyx_string_tab[10]
#define __pyx_kp_u_Cannot_index_with_type __pyx_string_tab[11]
#define __pyx_kp_u_Cannot_transpose_memoryview_with __pyx_string_tab[12]
#define __pyx_n_u_D __pyx_string_tab[13]
#define __pyx_kp_u_Did_not_reach_all_points_for_ind __pyx_string_tab[14]
#define __pyx_kp_u_Dimension_d_is_not_direct __pyx_string_tab[15]
#define __pyx_n_u_Ellipsis __pyx_string_tab[16]
#define __pyx_kp_u_Empty_shape_tuple_for_cython_arr __pyx_string_tab[17]
#define __pyx_n_u_ImportError __pyx_string_tab[18]
#define __pyx_kp_u_Incompatible_checksums_0x_x_vs_0 __pyx_string_tab[19]
#define __pyx_kp_u_Incompatible_checksums_0x_x_vs_0_2 __pyx_string_tab[20]
#define __pyx_n_u_IndexError __pyx_string_tab[21]
#define __pyx_kp_u_Index_out_of_bounds_axis_d __pyx_string_tab[22]
#define __pyx_kp_u_Indirect_dimensions_not_supporte __pyx_string_tab[23]
#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[24]
#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[25]
#define __pyx_n_u_Jout __pyx_string_tab[26]
#define __pyx_n_u_MemoryError __pyx_string_tab[27]
#define __pyx_kp_u_MemoryView_of __pyx_string_tab[28]
#define __pyx_n_u_N __pyx_string_tab[29]
#define __pyx_n_u_NotImplementedError __pyx_string_tab[30]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[31]
#define __pyx_n_b_O __pyx_string_tab[32]
#define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_string_tab[33]
#define __pyx_n_u_PickleError __pyx_string_tab[34]
#define __pyx_n_u_PyReactionDiffusion __pyx_string_tab[35]
#define __pyx_n_u_PyReactionDiffusion___reduce_cyt __pyx_string_tab[36]
#define __pyx_n_u_PyReactionDiffusion___setstate_c __pyx_string_tab[37]
#define __pyx_n_u_PyReactionDiffusion__stencil_bi __pyx_string_tab[38]
#define __pyx_n_u_PyReactionDiffusion__xc_bi_map __pyx_string_tab[39]
#define __pyx_n_u_PyReactionDiffusion_banded_jac_c __pyx_string_tab[40]
#define __pyx_n_u_PyReactionDiffusion_calc_efield __pyx_string_tab[41]
#define __pyx_n_u_PyReactionDiffusion_compressed_j __pyx_string_tab[42]
#define __pyx_n_u_PyReactionDiffusion_dense_jac_cm __pyx_string_tab[43]
#define __pyx_n_u_PyReactionDiffusion_dense_jac_rm __pyx_string_tab[44]
#define __pyx_n_u_PyReactionDiffusion_expb __pyx_string_tab[45]
#define __pyx_n_u_PyReactionDiffusion_f __pyx_string_tab[46]
#define __pyx_n_u_PyReactionDiffusion_get_last_inf __pyx_string_tab[47]
#define __pyx_n_u_PyReactionDiffusion_integrated_c __pyx_string_tab[48]
#define __pyx_n_u_PyReactionDiffusion_logb __pyx_string_tab[49]
#define __pyx_n_u_PyReactionDiffusion_per_rxn_cont __pyx_string_tab[50]
#define __pyx_n_u_PyReactionDiffusion_zero_counter __pyx_string_tab[51]
#define __pyx_n_u_Sequence __pyx_string_tab[52]
#define __pyx_kp_u_Step_may_not_be_zero_axis_d __pyx_string_tab[53]
#define __pyx_n_u_TypeError __pyx_string_tab[54]
#define __pyx_kp_u_Unable_to_convert_item_to_object __pyx_string_tab[55]
#define __pyx_kp_u_Unkown_geom_s __pyx_string_tab[56]
#define __pyx_n_u_ValueError __pyx_string_tab[57]
#define __pyx_n_u_View_MemoryView __pyx_string_tab[58]
#define __pyx_kp_u__2 __pyx_string_tab[59]
#define __pyx_kp_u__3 __pyx_string_tab[60]
#define __pyx_kp_u__4 __pyx_string_tab[61]
#define __pyx_kp_u__5 __pyx_string_tab[62]
#define __pyx_kp_u__8 __pyx_string_tab[63]
#define __pyx_n_u_abc __pyx_string_tab[64]
#define __pyx_kp_u_add_note __pyx_string_tab[65]
#define __pyx_n_u_all __pyx_string_tab[66]
#define __pyx_n_u_allocate_buffer __pyx_string_tab[67]
#define __pyx_kp_u_and __pyx_string_tab[68]
#define __pyx_n_u_array __pyx_string_tab[69]
#define __pyx_n_u_asarray __pyx_string_tab[70]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[71]
#define __pyx_kp_u_at_0x __pyx_string_tab[72]
#define __pyx_n_u_atol __pyx_string_tab[73]
#define __pyx_n_u_auto_efield __pyx_string_tab[74]
#define __pyx_n_u_autorestart __pyx_string_tab[75]
#define __pyx_n_u_banded_jac_cmaj __pyx_string_tab[76]
#define __pyx_n_u_base __pyx_string_tab[77]
#define __pyx_n_u_bi __pyx_string_tab[78]
#define __pyx_n_u_block_diag_ilu __pyx_string_tab[79]
#define __pyx_n_u_c __pyx_string_tab[80]
#define __pyx_n_u_calc_efield __pyx_string_tab[81]
#define __pyx_n_u_chemreac__chemreac __pyx_string_tab[82]
#define __pyx_kp_u_chemreac__chemreac_pyx __pyx_string_tab[83]
#define __pyx_n_u_class __pyx_string_tab[84]
#define __pyx_n_u_class_getitem __pyx_string_tab[85]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[86]
#define __pyx_n_u_clip_to_pos __pyx_string_tab[87]
#define __pyx_kp_u_collections_abc __pyx_string_tab[88]
#define __pyx_n_u_compressed_jac_cmaj __pyx_string_tab[89]
#define __pyx_n_u_constraints __pyx_string_tab[90]
#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[91]
#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[92]
#define __pyx_n_u_count __pyx_string_tab[93]
#define __pyx_n_u_cumsum __pyx_string_tab[94]
#define __pyx_n_u_cvode_adaptive __pyx_string_tab[95]
#define __pyx_n_u_cvode_predefined __pyx_string_tab[96]
#define __pyx_n_u_cvode_predefined_durations_field __pyx_string_tab[97]
#define __pyx_n_u_data __pyx_string_tab[98]
#define __pyx_n_u_decode __pyx_string_tab[99]
#define __pyx_n_u_default __pyx_string_tab[100]
#define __pyx_n_u_dense_jac_cmaj __pyx_string_tab[101]
#define __pyx_n_u_dense_jac_rmaj __pyx_string_tab[102]
#define __pyx_n_u_descr __pyx_string_tab[103]
#define __pyx_n_u_diag_data_len __pyx_string_tab[104]
#define __pyx_n_u_dict __pyx_string_tab[105]
#define __pyx_n_u_dict_2 __pyx_string_tab[106]
#define __pyx_n_u_diff __pyx_string_tab[107]
#define __pyx_kp_u_disable __pyx_string_tab[108]
#define __pyx_n_u_dtype __pyx_string_tab[109]
#define __pyx_n_u_dtype_is_object __pyx_string_tab[110]
#define __pyx_n_u_durations __pyx_string_tab[111]
#define __pyx_n_u_dx_max __pyx_string_tab[112]
#define __pyx_n_u_dx_min __pyx_string_tab[113]
#define __pyx_n_u_efield __pyx_string_tab[114]
#define __pyx_n_u_empty __pyx_string_tab[115]
#define __pyx_kp_u_enable __pyx_string_tab[116]
#define __pyx_n_u_encode __pyx_string_tab[117]
#define __pyx_n_u_enumerate __pyx_string_tab[118]
#define __pyx_n_u_eps_lin __pyx_string_tab[119]
#define __pyx_n_u_eps_rel __pyx_string_tab[120]
#define __pyx_n_u_error __pyx_string_tab[121]
#define __pyx_n_u_ew_ele __pyx_string_tab[122]
#define __pyx_n_u_ew_ele_arr __pyx_string_tab[123]
#define __pyx_n_u_ew_ele_dims __pyx_string_tab[124]
#define __pyx_n_u_ew_ele_out __pyx_string_tab[125]
#define __pyx_n_u_exp __pyx_string_tab[126]
#define __pyx_n_u_expb __pyx_string_tab[127]
#define __pyx_n_u_f __pyx_string_tab[128]
#define __pyx_n_u_faraday_const __pyx_string_tab[129]
#define __pyx_n_u_fcs __pyx_string_tab[130]
#define __pyx_n_u_fields __pyx_string_tab[131]
#define __pyx_n_u_first_step __pyx_string_tab[132]
#define __pyx_n_u_flags __pyx_string_tab[133]
#define __pyx_n_u_float64 __pyx_string_tab[134]
#define __pyx_n_u_format __pyx_string_tab[135]
#define __pyx_n_u_fortran __pyx_string_tab[136]
#define __pyx_n_u_fout __pyx_string_tab[137]
#define __pyx_n_u_func __pyx_string_tab[138]
#define __pyx_n_u_g_value_parents __pyx_string_tab[139]
#define __pyx_n_u_g_values __pyx_string_tab[140]
#define __pyx_kp_u_gc __pyx_string_tab[141]
#define __pyx_n_u_geom __pyx_string_tab[142]
#define __pyx_n_u_get_last_info __pyx_string_tab[143]
#define __pyx_n_u_getstate __pyx_string_tab[144]
#define __pyx_kp_u_got __pyx_string_tab[145]
#define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_string_tab[146]
#define __pyx_n_u_i __pyx_string_tab[147]
#define __pyx_n_u_id __pyx_string_tab[148]
#define __pyx_n_u_ilu_limit __pyx_string_tab[149]
#define __pyx_n_u_import __pyx_string_tab[150]
#define __pyx_n_u_index __pyx_string_tab[151]
#define __pyx_n_u_info __pyx_string_tab[152]
#define __pyx_n_u_initializing __pyx_string_tab[153]
#define __pyx_n_u_int __pyx_string_tab[154]
#define __pyx_n_u_int32 __pyx_string_tab[155]
#define __pyx_n_u_integrated_conc __pyx_string_tab[156]
#define __pyx_n_u_is_coroutine __pyx_string_tab[157]
#define __pyx_kp_u_isenabled __pyx_string_tab[158]
#define __pyx_n_u_items __pyx_string_tab[159]
#define __pyx_n_u_itemsize __pyx_string_tab[160]
#define __pyx_kp_u_itemsize_0_for_cython_array __pyx_string_tab[161]
#define __pyx_n_u_iter_type __pyx_string_tab[162]
#define __pyx_n_u_j __pyx_string_tab[163]
#define __pyx_n_u_k __pyx_string_tab[164]
#define __pyx_n_u_last_integration_info __pyx_string_tab[165]
#define __pyx_n_u_linC __pyx_string_tab[166]
#define __pyx_kp_u_linC_must_be_of_length_N __pyx_string_tab[167]
#define __pyx_n_u_lin_x __pyx_string_tab[168]
#define __pyx_n_u_linear_solver __pyx_string_tab[169]
#define __pyx_n_u_log __pyx_string_tab[170]
#define __pyx_n_u_logb __pyx_string_tab[171]
#define __pyx_n_u_logt __pyx_string_tab[172]
#define __pyx_n_u_logx __pyx_string_tab[173]
#define __pyx_n_u_logy __pyx_string_tab[174]
#define __pyx_n_u_lower __pyx_string_tab[175]
#define __pyx_kp_u_lower_bounds_of_incorrect_length __pyx_string_tab[176]
#define __pyx_kp_u_lower_bounds_of_incorrect_size __pyx_string_tab[177]
#define __pyx_n_u_lrefl __pyx_string_tab[178]
#define __pyx_n_u_main __pyx_string_tab[179]
#define __pyx_n_u_maxl __pyx_string_tab[180]
#define __pyx_n_u_memview __pyx_string_tab[181]
#define __pyx_n_u_method __pyx_string_tab[182]
#define __pyx_n_u_mobility __pyx_string_tab[183]
#define __pyx_n_u_mode __pyx_string_tab[184]
#define __pyx_n_u_modulated_rxns __pyx_string_tab[185]
#define __pyx_n_u_modulation __pyx_string_tab[186]
#define __pyx_n_u_module __pyx_string_tab[187]
#define __pyx_n_u_msbj __pyx_string_tab[188]
#define __pyx_n_u_n __pyx_string_tab[189]
#define __pyx_n_u_n_jac_diags __pyx_string_tab[190]
#define __pyx_n_u_name __pyx_string_tab[191]
#define __pyx_n_u_name_2 __pyx_string_tab[192]
#define __pyx_n_u_nderiv __pyx_string_tab[193]
#define __pyx_n_u_ndim __pyx_string_tab[194]
#define __pyx_kp_u_need_boolean_for_error_outside_b __pyx_string_tab[195]
#define __pyx_kp_u_need_boolean_for_use_get_dx_max __pyx_string_tab[196]
#define __pyx_n_u_new __pyx_string_tab[197]
#define __pyx_n_u_nfev __pyx_string_tab[198]
#define __pyx_n_u_njev __pyx_string_tab[199]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[200]
#define __pyx_n_u_nout __pyx_string_tab[201]
#define __pyx_n_u_np __pyx_string_tab[202]
#define __pyx_n_u_npoints __pyx_string_tab[203]
#define __pyx_n_u_nr __pyx_string_tab[204]
#define __pyx_n_u_nreached __pyx_string_tab[205]
#define __pyx_n_u_nstencil __pyx_string_tab[206]
#define __pyx_n_u_nsteps __pyx_string_tab[207]
#define __pyx_n_u_numpy __pyx_string_tab[208]
#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[209]
#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[210]
#define __pyx_n_u_ny __pyx_string_tab[211]
#define __pyx_n_u_obj __pyx_string_tab[212]
#define __pyx_kp_u_object __pyx_string_tab[213]
#define __pyx_n_u_offset __pyx_string_tab[214]
#define __pyx_kp_u_only_field_type_assumed_for_now __pyx_string_tab[215]
#define __pyx_n_u_out __pyx_string_tab[216]
#define __pyx_n_u_pack __pyx_string_tab[217]
#define __pyx_n_u_per_rxn_contrib_to_fi __pyx_string_tab[218]
#define __pyx_n_u_pi __pyx_string_tab[219]
#define __pyx_n_u_pickle __pyx_string_tab[220]
#define __pyx_n_u_pop __pyx_string_tab[221]
#define __pyx_n_u_pyx_PickleError __pyx_string_tab[222]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[223]
#define __pyx_n_u_pyx_result __pyx_string_tab[224]
#define __pyx_n_u_pyx_state __pyx_string_tab[225]
#define __pyx_n_u_pyx_type __pyx_string_tab[226]
#define __pyx_n_u_pyx_unpickle_ArrayWrapper __pyx_string_tab[227]
#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[228]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[229]
#define __pyx_n_u_qualname __pyx_string_tab[230]
#define __pyx_n_u_range __pyx_string_tab[231]
#define __pyx_n_u_rd __pyx_string_tab[232]
#define __pyx_n_u_reduce __pyx_string_tab[233]
#define __pyx_n_u_reduce_cython __pyx_string_tab[234]
#define __pyx_n_u_reduce_ex __pyx_string_tab[235]
#define __pyx_n_u_register __pyx_string_tab[236]
#define __pyx_n_u_reshape __pyx_string_tab[237]
#define __pyx_n_u_result __pyx_string_tab[238]
#define __pyx_n_u_return_on_error __pyx_string_tab[239]
#define __pyx_n_u_return_on_root __pyx_string_tab[240]
#define __pyx_n_u_rk4 __pyx_string_tab[241]
#define __pyx_n_u_root_indices __pyx_string_tab[242]
#define __pyx_n_u_roots_output __pyx_string_tab[243]
#define __pyx_n_u_rrefl __pyx_string_tab[244]
#define __pyx_n_u_rtol __pyx_string_tab[245]
#define __pyx_n_u_s __pyx_string_tab[246]
#define __pyx_n_u_self __pyx_string_tab[247]
#define __pyx_n_u_set_name __pyx_string_tab[248]
#define __pyx_n_u_setstate __pyx_string_tab[249]
#define __pyx_n_u_setstate_cython __pyx_string_tab[250]
#define __pyx_n_u_shape __pyx_string_tab[251]
#define __pyx_n_u_si __pyx_string_tab[252]
#define __pyx_n_u_size __pyx_string_tab[253]
#define __pyx_n_u_spec __pyx_string_tab[254]
#define __pyx_n_u_squeeze __pyx_string_tab[255]
#define __pyx_n_u_stab_lim_det __pyx_string_tab[256]
#define __pyx_n_u_start __pyx_string_tab[257]
#define __pyx_n_u_state __pyx_string_tab[258]
#define __pyx_n_u_stencil_bi_lbound __pyx_string_tab[259]
#define __pyx_n_u_step __pyx_string_tab[260]
#define __pyx_n_u_stoich_active __pyx_string_tab[261]
#define __pyx_n_u_stoich_inact __pyx_string_tab[262]
#define __pyx_n_u_stoich_prod __pyx_string_tab[263]
#define __pyx_n_u_stop __pyx_string_tab[264]
#define __pyx_n_u_str __pyx_string_tab[265]
#define __pyx_kp_u_strided_and_direct __pyx_string_tab[266]
#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[267]
#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[268]
#define __pyx_n_u_strides __pyx_string_tab[269]
#define __pyx_kp_u_stringsource __pyx_string_tab[270]
#define __pyx_n_u_struct __pyx_string_tab[271]
#define __pyx_n_u_success __pyx_string_tab[272]
#define __pyx_n_u_sum __pyx_string_tab[273]
#define __pyx_n_u_surf_chg __pyx_string_tab[274]
#define __pyx_n_u_t __pyx_string_tab[275]
#define __pyx_n_u_t0 __pyx_string_tab[276]
#define __pyx_n_u_tbuf __pyx_string_tab[277]
#define __pyx_n_u_td __pyx_string_tab[278]
#define __pyx_n_u_tend __pyx_string_tab[279]
#define __pyx_n_u_test __pyx_string_tab[280]
#define __pyx_n_u_tout __pyx_string_tab[281]
#define __pyx_n_u_typestr __pyx_string_tab[282]
#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[283]
#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[284]
#define __pyx_n_u_undecided __pyx_string_tab[285]
#define __pyx_n_u_unpack __pyx_string_tab[286]
#define __pyx_n_u_update __pyx_string_tab[287]
#define __pyx_kp_u_upper_bounds_of_incorrect_length __pyx_string_tab[288]
#define __pyx_kp_u_upper_bounds_of_incorrect_size __pyx_string_tab[289]
#define __pyx_n_u_use_log2 __pyx_string_tab[290]
#define __pyx_n_u_use_setstate __pyx_string_tab[291]
#define __pyx_kp_u_utf_8 __pyx_string_tab[292]
#define __pyx_n_u_vacuum_permittivity __pyx_string_tab[293]
#define __pyx_n_u_version __pyx_string_tab[294]
#define __pyx_n_u_with_jacobian __pyx_string_tab[295]
#define __pyx_n_u_with_jtimes __pyx_string_tab[296]
#define __pyx_n_u_x __pyx_string_tab[297]
#define __pyx_n_u_xc_bi_map __pyx_string_tab[298]
#define __pyx_n_u_xci __pyx_string_tab[299]
#define __pyx_n_u_xyout __pyx_string_tab[300]
#define __pyx_n_u_xyout_arr __pyx_string_tab[301]
#define __pyx_n_u_xyout_dims __pyx_string_tab[302]
#define __pyx_n_u_y __pyx_string_tab[303]
#define __pyx_n_u_y0 __pyx_string_tab[304]
#define __pyx_kp_u_y0_of_incorrect_size __pyx_string_tab[305]
#define __pyx_n_u_y0out __pyx_string_tab[306]
#define __pyx_n_u_y1out __pyx_string_tab[307]
#define __pyx_n_u_yout __pyx_string_tab[308]
#define __pyx_n_u_z_chg __pyx_string_tab[309]
#define __pyx_n_u_zero_counters __pyx_string_tab[310]
#define __pyx_n_u_zeros __pyx_string_tab[311]
/* #### 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);
#ifdef __Pyx_CyFunction_USED
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
#endif
#ifdef __Pyx_FusedFunction_USED
Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
#endif
#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_ptype_8chemreac_9_chemreac_ArrayWrapper);
Py_CLEAR(clear_module_state->__pyx_type_8chemreac_9_chemreac_ArrayWrapper);
Py_CLEAR(clear_module_state->__pyx_ptype_8chemreac_9_chemreac_PyReactionDiffusion);
Py_CLEAR(clear_module_state->__pyx_type_8chemreac_9_chemreac_PyReactionDiffusion);
Py_CLEAR(clear_module_state->__pyx_ptype_8chemreac_9_chemreac___pyx_defaults);
Py_CLEAR(clear_module_state->__pyx_type_8chemreac_9_chemreac___pyx_defaults);
Py_CLEAR(clear_module_state->__pyx_array_type);
Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
Py_CLEAR(clear_module_state->__pyx_memoryview_type);
Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
Py_CLEAR(clear_module_state->__pyx_k__6);
for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
for (int i=0; i<7; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
for (int i=0; i<23; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
for (int i=0; i<312; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
Py_CLEAR(clear_module_state->__pyx_int_0);
Py_CLEAR(clear_module_state->__pyx_int_1);
Py_CLEAR(clear_module_state->__pyx_int_2);
Py_CLEAR(clear_module_state->__pyx_int_3);
Py_CLEAR(clear_module_state->__pyx_int_4);
Py_CLEAR(clear_module_state->__pyx_int_710878);
Py_CLEAR(clear_module_state->__pyx_int_97585637);
Py_CLEAR(clear_module_state->__pyx_int_112105877);
Py_CLEAR(clear_module_state->__pyx_int_136983863);
Py_CLEAR(clear_module_state->__pyx_int_184977713);
Py_CLEAR(clear_module_state->__pyx_int_201990161);
Py_CLEAR(clear_module_state->__pyx_int_neg_1);
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);
#ifdef __Pyx_CyFunction_USED
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
#endif
#ifdef __Pyx_FusedFunction_USED
Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
#endif
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_ptype_8chemreac_9_chemreac_ArrayWrapper);
Py_VISIT(traverse_module_state->__pyx_type_8chemreac_9_chemreac_ArrayWrapper);
Py_VISIT(traverse_module_state->__pyx_ptype_8chemreac_9_chemreac_PyReactionDiffusion);
Py_VISIT(traverse_module_state->__pyx_type_8chemreac_9_chemreac_PyReactionDiffusion);
Py_VISIT(traverse_module_state->__pyx_ptype_8chemreac_9_chemreac___pyx_defaults);
Py_VISIT(traverse_module_state->__pyx_type_8chemreac_9_chemreac___pyx_defaults);
Py_VISIT(traverse_module_state->__pyx_array_type);
Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
Py_VISIT(traverse_module_state->__pyx_memoryview_type);
Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
Py_VISIT(traverse_module_state->__pyx_k__6);
for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
for (int i=0; i<7; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
for (int i=0; i<23; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
for (int i=0; i<312; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_2);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_3);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_4);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_710878);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_97585637);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_112105877);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_136983863);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_184977713);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_201990161);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_1);
return 0;
}
#endif
/* #### Code section: module_code ### */
/* "pair.from_py":187
* pair(T&, U&) except +
*
* @cname("__pyx_convert_pair_from_py_double__and_double") # <<<<<<<<<<<<<<
* cdef pair[X,Y] __pyx_convert_pair_from_py_double__and_double(object o) except *:
* x, y = o
*/
static std::pair<double,double> __pyx_convert_pair_from_py_double__and_double(PyObject *__pyx_v_o) {
PyObject *__pyx_v_x = NULL;
PyObject *__pyx_v_y = NULL;
std::pair<double,double> __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *(*__pyx_t_4)(PyObject *);
double __pyx_t_5;
double __pyx_t_6;
std::pair<double,double> __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_pair_from_py_double__and_double", 0);
/* "pair.from_py":189
* @cname("__pyx_convert_pair_from_py_double__and_double")
* cdef pair[X,Y] __pyx_convert_pair_from_py_double__and_double(object o) except *:
* x, y = o # <<<<<<<<<<<<<<
* return pair[X,Y](<X>x, <Y>y)
*
*/
if ((likely(PyTuple_CheckExact(__pyx_v_o))) || (PyList_CheckExact(__pyx_v_o))) {
PyObject* sequence = __pyx_v_o;
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(1, 189, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_2);
} else {
__pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 189, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 189, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_2);
}
#else
__pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(1, 189, __pyx_L1_error)
__pyx_t_4 = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L4_unpacking_done;
__pyx_L3_unpacking_failed:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(1, 189, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
__pyx_v_x = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_y = __pyx_t_2;
__pyx_t_2 = 0;
/* "pair.from_py":190
* cdef pair[X,Y] __pyx_convert_pair_from_py_double__and_double(object o) except *:
* x, y = o
* return pair[X,Y](<X>x, <Y>y) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_5 = __Pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 190, __pyx_L1_error)
__pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_v_y); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 190, __pyx_L1_error)
try {
__pyx_t_7 = std::pair<double,double> (((double)__pyx_t_5), ((double)__pyx_t_6));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 190, __pyx_L1_error)
}
__pyx_r = __pyx_t_7;
goto __pyx_L0;
/* "pair.from_py":187
* pair(T&, U&) except +
*
* @cname("__pyx_convert_pair_from_py_double__and_double") # <<<<<<<<<<<<<<
* cdef pair[X,Y] __pyx_convert_pair_from_py_double__and_double(object o) except *:
* x, y = o
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("pair.from_py.__pyx_convert_pair_from_py_double__and_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_x);
__Pyx_XDECREF(__pyx_v_y);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "vector.to_py":76
* const Py_ssize_t PY_SSIZE_T_MAX
*
* @cname("__pyx_convert_vector_to_py_double") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_vector_to_py_double(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
*/
static PyObject *__pyx_convert_vector_to_py_double(std::vector<double> const &__pyx_v_v) {
Py_ssize_t __pyx_v_v_size_signed;
PyObject *__pyx_v_o = NULL;
Py_ssize_t __pyx_v_i;
PyObject *__pyx_v_item = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0);
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_double")
* cdef object __pyx_convert_vector_to_py_double(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
__pyx_t_1 = (__pyx_v_v.size() > ((size_t)PY_SSIZE_T_MAX));
if (unlikely(__pyx_t_1)) {
/* "vector.to_py":79
* cdef object __pyx_convert_vector_to_py_double(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError() # <<<<<<<<<<<<<<
* v_size_signed = <Py_ssize_t> v.size()
*
*/
PyErr_NoMemory(); __PYX_ERR(1, 79, __pyx_L1_error)
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_double")
* cdef object __pyx_convert_vector_to_py_double(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
}
/* "vector.to_py":80
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size() # <<<<<<<<<<<<<<
*
* o = PyList_New(v_size_signed)
*/
__pyx_v_v_size_signed = ((Py_ssize_t)__pyx_v_v.size());
/* "vector.to_py":82
* v_size_signed = <Py_ssize_t> v.size()
*
* o = PyList_New(v_size_signed) # <<<<<<<<<<<<<<
*
* cdef Py_ssize_t i
*/
__pyx_t_2 = PyList_New(__pyx_v_v_size_signed); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_o = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":87
* cdef object item
*
* for i in range(v_size_signed): # <<<<<<<<<<<<<<
* item = v[i]
* Py_INCREF(item)
*/
__pyx_t_3 = __pyx_v_v_size_signed;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
/* "vector.to_py":88
*
* for i in range(v_size_signed):
* item = v[i] # <<<<<<<<<<<<<<
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item)
*/
__pyx_t_2 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":89
* for i in range(v_size_signed):
* item = v[i]
* Py_INCREF(item) # <<<<<<<<<<<<<<
* __Pyx_PyList_SET_ITEM(o, i, item)
*
*/
Py_INCREF(__pyx_v_item);
/* "vector.to_py":90
* item = v[i]
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item) # <<<<<<<<<<<<<<
*
* return o
*/
__pyx_t_6 = __Pyx_PyList_SET_ITEM(__pyx_v_o, __pyx_v_i, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 90, __pyx_L1_error)
}
/* "vector.to_py":92
* __Pyx_PyList_SET_ITEM(o, i, item)
*
* return o # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_o);
__pyx_r = __pyx_v_o;
goto __pyx_L0;
/* "vector.to_py":76
* const Py_ssize_t PY_SSIZE_T_MAX
*
* @cname("__pyx_convert_vector_to_py_double") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_vector_to_py_double(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_o);
__Pyx_XDECREF(__pyx_v_item);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_convert_vector_to_py_int(std::vector<int> const &__pyx_v_v) {
Py_ssize_t __pyx_v_v_size_signed;
PyObject *__pyx_v_o = NULL;
Py_ssize_t __pyx_v_i;
PyObject *__pyx_v_item = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int", 0);
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_int")
* cdef object __pyx_convert_vector_to_py_int(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
__pyx_t_1 = (__pyx_v_v.size() > ((size_t)PY_SSIZE_T_MAX));
if (unlikely(__pyx_t_1)) {
/* "vector.to_py":79
* cdef object __pyx_convert_vector_to_py_int(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError() # <<<<<<<<<<<<<<
* v_size_signed = <Py_ssize_t> v.size()
*
*/
PyErr_NoMemory(); __PYX_ERR(1, 79, __pyx_L1_error)
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_int")
* cdef object __pyx_convert_vector_to_py_int(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
}
/* "vector.to_py":80
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size() # <<<<<<<<<<<<<<
*
* o = PyList_New(v_size_signed)
*/
__pyx_v_v_size_signed = ((Py_ssize_t)__pyx_v_v.size());
/* "vector.to_py":82
* v_size_signed = <Py_ssize_t> v.size()
*
* o = PyList_New(v_size_signed) # <<<<<<<<<<<<<<
*
* cdef Py_ssize_t i
*/
__pyx_t_2 = PyList_New(__pyx_v_v_size_signed); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_o = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":87
* cdef object item
*
* for i in range(v_size_signed): # <<<<<<<<<<<<<<
* item = v[i]
* Py_INCREF(item)
*/
__pyx_t_3 = __pyx_v_v_size_signed;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
/* "vector.to_py":88
*
* for i in range(v_size_signed):
* item = v[i] # <<<<<<<<<<<<<<
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item)
*/
__pyx_t_2 = __Pyx_PyLong_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":89
* for i in range(v_size_signed):
* item = v[i]
* Py_INCREF(item) # <<<<<<<<<<<<<<
* __Pyx_PyList_SET_ITEM(o, i, item)
*
*/
Py_INCREF(__pyx_v_item);
/* "vector.to_py":90
* item = v[i]
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item) # <<<<<<<<<<<<<<
*
* return o
*/
__pyx_t_6 = __Pyx_PyList_SET_ITEM(__pyx_v_o, __pyx_v_i, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 90, __pyx_L1_error)
}
/* "vector.to_py":92
* __Pyx_PyList_SET_ITEM(o, i, item)
*
* return o # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_o);
__pyx_r = __pyx_v_o;
goto __pyx_L0;
/* "vector.to_py":76
* const Py_ssize_t PY_SSIZE_T_MAX
*
* @cname("__pyx_convert_vector_to_py_int") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_vector_to_py_int(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_o);
__Pyx_XDECREF(__pyx_v_item);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(std::vector<std::vector<int> > const &__pyx_v_v) {
Py_ssize_t __pyx_v_v_size_signed;
PyObject *__pyx_v_o = NULL;
Py_ssize_t __pyx_v_i;
PyObject *__pyx_v_item = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", 0);
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
* cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
__pyx_t_1 = (__pyx_v_v.size() > ((size_t)PY_SSIZE_T_MAX));
if (unlikely(__pyx_t_1)) {
/* "vector.to_py":79
* cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError() # <<<<<<<<<<<<<<
* v_size_signed = <Py_ssize_t> v.size()
*
*/
PyErr_NoMemory(); __PYX_ERR(1, 79, __pyx_L1_error)
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
* cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
}
/* "vector.to_py":80
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size() # <<<<<<<<<<<<<<
*
* o = PyList_New(v_size_signed)
*/
__pyx_v_v_size_signed = ((Py_ssize_t)__pyx_v_v.size());
/* "vector.to_py":82
* v_size_signed = <Py_ssize_t> v.size()
*
* o = PyList_New(v_size_signed) # <<<<<<<<<<<<<<
*
* cdef Py_ssize_t i
*/
__pyx_t_2 = PyList_New(__pyx_v_v_size_signed); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_o = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":87
* cdef object item
*
* for i in range(v_size_signed): # <<<<<<<<<<<<<<
* item = v[i]
* Py_INCREF(item)
*/
__pyx_t_3 = __pyx_v_v_size_signed;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
/* "vector.to_py":88
*
* for i in range(v_size_signed):
* item = v[i] # <<<<<<<<<<<<<<
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item)
*/
__pyx_t_2 = __pyx_convert_vector_to_py_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":89
* for i in range(v_size_signed):
* item = v[i]
* Py_INCREF(item) # <<<<<<<<<<<<<<
* __Pyx_PyList_SET_ITEM(o, i, item)
*
*/
Py_INCREF(__pyx_v_item);
/* "vector.to_py":90
* item = v[i]
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item) # <<<<<<<<<<<<<<
*
* return o
*/
__pyx_t_6 = __Pyx_PyList_SET_ITEM(__pyx_v_o, __pyx_v_i, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 90, __pyx_L1_error)
}
/* "vector.to_py":92
* __Pyx_PyList_SET_ITEM(o, i, item)
*
* return o # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_o);
__pyx_r = __pyx_v_o;
goto __pyx_L0;
/* "vector.to_py":76
* const Py_ssize_t PY_SSIZE_T_MAX
*
* @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_o);
__Pyx_XDECREF(__pyx_v_item);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_convert_vector_to_py_double(std::vector<double> const &__pyx_v_v) {
Py_ssize_t __pyx_v_v_size_signed;
PyObject *__pyx_v_o = NULL;
Py_ssize_t __pyx_v_i;
PyObject *__pyx_v_item = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0);
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_double")
* cdef object __pyx_convert_vector_to_py_double(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
__pyx_t_1 = (__pyx_v_v.size() > ((size_t)PY_SSIZE_T_MAX));
if (unlikely(__pyx_t_1)) {
/* "vector.to_py":79
* cdef object __pyx_convert_vector_to_py_double(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError() # <<<<<<<<<<<<<<
* v_size_signed = <Py_ssize_t> v.size()
*
*/
PyErr_NoMemory(); __PYX_ERR(1, 79, __pyx_L1_error)
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_double")
* cdef object __pyx_convert_vector_to_py_double(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
}
/* "vector.to_py":80
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size() # <<<<<<<<<<<<<<
*
* o = PyList_New(v_size_signed)
*/
__pyx_v_v_size_signed = ((Py_ssize_t)__pyx_v_v.size());
/* "vector.to_py":82
* v_size_signed = <Py_ssize_t> v.size()
*
* o = PyList_New(v_size_signed) # <<<<<<<<<<<<<<
*
* cdef Py_ssize_t i
*/
__pyx_t_2 = PyList_New(__pyx_v_v_size_signed); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_o = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":87
* cdef object item
*
* for i in range(v_size_signed): # <<<<<<<<<<<<<<
* item = v[i]
* Py_INCREF(item)
*/
__pyx_t_3 = __pyx_v_v_size_signed;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
/* "vector.to_py":88
*
* for i in range(v_size_signed):
* item = v[i] # <<<<<<<<<<<<<<
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item)
*/
__pyx_t_2 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":89
* for i in range(v_size_signed):
* item = v[i]
* Py_INCREF(item) # <<<<<<<<<<<<<<
* __Pyx_PyList_SET_ITEM(o, i, item)
*
*/
Py_INCREF(__pyx_v_item);
/* "vector.to_py":90
* item = v[i]
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item) # <<<<<<<<<<<<<<
*
* return o
*/
__pyx_t_6 = __Pyx_PyList_SET_ITEM(__pyx_v_o, __pyx_v_i, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 90, __pyx_L1_error)
}
/* "vector.to_py":92
* __Pyx_PyList_SET_ITEM(o, i, item)
*
* return o # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_o);
__pyx_r = __pyx_v_o;
goto __pyx_L0;
/* "vector.to_py":76
* const Py_ssize_t PY_SSIZE_T_MAX
*
* @cname("__pyx_convert_vector_to_py_double") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_vector_to_py_double(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_o);
__Pyx_XDECREF(__pyx_v_item);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "pair.to_py":200
* U second
*
* @cname("__pyx_convert_pair_to_py_double____double") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_pair_to_py_double____double(const pair[X,Y]& p):
* return p.first, p.second
*/
static PyObject *__pyx_convert_pair_to_py_double____double(std::pair<double,double> const &__pyx_v_p) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_double____double", 0);
/* "pair.to_py":202
* @cname("__pyx_convert_pair_to_py_double____double")
* cdef object __pyx_convert_pair_to_py_double____double(const pair[X,Y]& p):
* return p.first, p.second # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyFloat_FromDouble(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 202, __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(1, 202, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 202, __pyx_L1_error);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "pair.to_py":200
* U second
*
* @cname("__pyx_convert_pair_to_py_double____double") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_pair_to_py_double____double(const pair[X,Y]& p):
* return p.first, p.second
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_double____double", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "vector.to_py":76
* const Py_ssize_t PY_SSIZE_T_MAX
*
* @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
*/
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(std::vector<std::vector<double> > const &__pyx_v_v) {
Py_ssize_t __pyx_v_v_size_signed;
PyObject *__pyx_v_o = NULL;
Py_ssize_t __pyx_v_i;
PyObject *__pyx_v_item = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", 0);
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
* cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
__pyx_t_1 = (__pyx_v_v.size() > ((size_t)PY_SSIZE_T_MAX));
if (unlikely(__pyx_t_1)) {
/* "vector.to_py":79
* cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError() # <<<<<<<<<<<<<<
* v_size_signed = <Py_ssize_t> v.size()
*
*/
PyErr_NoMemory(); __PYX_ERR(1, 79, __pyx_L1_error)
/* "vector.to_py":78
* @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
* cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX: # <<<<<<<<<<<<<<
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size()
*/
}
/* "vector.to_py":80
* if v.size() > <size_t> PY_SSIZE_T_MAX:
* raise MemoryError()
* v_size_signed = <Py_ssize_t> v.size() # <<<<<<<<<<<<<<
*
* o = PyList_New(v_size_signed)
*/
__pyx_v_v_size_signed = ((Py_ssize_t)__pyx_v_v.size());
/* "vector.to_py":82
* v_size_signed = <Py_ssize_t> v.size()
*
* o = PyList_New(v_size_signed) # <<<<<<<<<<<<<<
*
* cdef Py_ssize_t i
*/
__pyx_t_2 = PyList_New(__pyx_v_v_size_signed); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_o = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":87
* cdef object item
*
* for i in range(v_size_signed): # <<<<<<<<<<<<<<
* item = v[i]
* Py_INCREF(item)
*/
__pyx_t_3 = __pyx_v_v_size_signed;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
/* "vector.to_py":88
*
* for i in range(v_size_signed):
* item = v[i] # <<<<<<<<<<<<<<
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item)
*/
__pyx_t_2 = __pyx_convert_vector_to_py_double((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
__pyx_t_2 = 0;
/* "vector.to_py":89
* for i in range(v_size_signed):
* item = v[i]
* Py_INCREF(item) # <<<<<<<<<<<<<<
* __Pyx_PyList_SET_ITEM(o, i, item)
*
*/
Py_INCREF(__pyx_v_item);
/* "vector.to_py":90
* item = v[i]
* Py_INCREF(item)
* __Pyx_PyList_SET_ITEM(o, i, item) # <<<<<<<<<<<<<<
*
* return o
*/
__pyx_t_6 = __Pyx_PyList_SET_ITEM(__pyx_v_o, __pyx_v_i, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 90, __pyx_L1_error)
}
/* "vector.to_py":92
* __Pyx_PyList_SET_ITEM(o, i, item)
*
* return o # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_o);
__pyx_r = __pyx_v_o;
goto __pyx_L0;
/* "vector.to_py":76
* const Py_ssize_t PY_SSIZE_T_MAX
*
* @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const vector[X]& v):
* if v.size() > <size_t> PY_SSIZE_T_MAX:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_o);
__Pyx_XDECREF(__pyx_v_item);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "string.to_py":30
* cdef object __Pyx_PyObject_FromStringAndSize(const char*, size_t)
*
* @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
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("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 0);
/* "string.to_py":32
* @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
* cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
* cdef extern from *:
* cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "string.to_py":30
* cdef object __Pyx_PyObject_FromStringAndSize(const char*, size_t)
*
* @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "string.to_py":36
* cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
*
* @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
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("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 0);
/* "string.to_py":38
* @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
* cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
* cdef extern from *:
* cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "string.to_py":36
* cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
*
* @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "string.to_py":42
* cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
*
* @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
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("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 0);
/* "string.to_py":44
* @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
* cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
* cdef extern from *:
* cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "string.to_py":42
* cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
*
* @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "string.to_py":48
* cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
*
* @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
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("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 0);
/* "string.to_py":50
* @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
* cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "string.to_py":48
* cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
*
* @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
* return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "map.to_py":242
* const_iterator end()
*
* @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____int") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____int(const map[X,Y]& s):
* o = {}
*/
static PyObject *__pyx_convert_unordered_map_to_py_std_3a__3a_string____int(std::unordered_map<std::string,int> const &__pyx_v_s) {
PyObject *__pyx_v_o = NULL;
std::unordered_map<std::string,int> ::value_type const *__pyx_v_key_value;
std::unordered_map<std::string,int> ::const_iterator __pyx_v_iter;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_std_3a__3a_string____int", 0);
/* "map.to_py":244
* @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____int")
* cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____int(const map[X,Y]& s):
* o = {} # <<<<<<<<<<<<<<
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin()
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_o = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "map.to_py":246
* o = {}
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
* while iter != s.end():
* key_value = &cython.operator.dereference(iter)
*/
__pyx_v_iter = __pyx_v_s.begin();
/* "map.to_py":247
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin()
* while iter != s.end(): # <<<<<<<<<<<<<<
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second
*/
while (1) {
__pyx_t_2 = (__pyx_v_iter != __pyx_v_s.end());
if (!__pyx_t_2) break;
/* "map.to_py":248
* cdef map[X,Y].const_iterator iter = s.begin()
* while iter != s.end():
* key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter)
*/
__pyx_v_key_value = (&(*__pyx_v_iter));
/* "map.to_py":249
* while iter != s.end():
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
* cython.operator.preincrement(iter)
* return o
*/
__pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely((PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "map.to_py":250
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
* return o
*
*/
(void)((++__pyx_v_iter));
}
/* "map.to_py":251
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter)
* return o # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_o);
__pyx_r = __pyx_v_o;
goto __pyx_L0;
/* "map.to_py":242
* const_iterator end()
*
* @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____int") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____int(const map[X,Y]& s):
* o = {}
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_std_3a__3a_string____int", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_o);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_convert_unordered_map_to_py_std_3a__3a_string____double(std::unordered_map<std::string,double> const &__pyx_v_s) {
PyObject *__pyx_v_o = NULL;
std::unordered_map<std::string,double> ::value_type const *__pyx_v_key_value;
std::unordered_map<std::string,double> ::const_iterator __pyx_v_iter;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_std_3a__3a_string____double", 0);
/* "map.to_py":244
* @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____double")
* cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____double(const map[X,Y]& s):
* o = {} # <<<<<<<<<<<<<<
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin()
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_o = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "map.to_py":246
* o = {}
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
* while iter != s.end():
* key_value = &cython.operator.dereference(iter)
*/
__pyx_v_iter = __pyx_v_s.begin();
/* "map.to_py":247
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin()
* while iter != s.end(): # <<<<<<<<<<<<<<
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second
*/
while (1) {
__pyx_t_2 = (__pyx_v_iter != __pyx_v_s.end());
if (!__pyx_t_2) break;
/* "map.to_py":248
* cdef map[X,Y].const_iterator iter = s.begin()
* while iter != s.end():
* key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter)
*/
__pyx_v_key_value = (&(*__pyx_v_iter));
/* "map.to_py":249
* while iter != s.end():
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
* cython.operator.preincrement(iter)
* return o
*/
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely((PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "map.to_py":250
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
* return o
*
*/
(void)((++__pyx_v_iter));
}
/* "map.to_py":251
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter)
* return o # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_o);
__pyx_r = __pyx_v_o;
goto __pyx_L0;
/* "map.to_py":242
* const_iterator end()
*
* @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____double") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____double(const map[X,Y]& s):
* o = {}
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_std_3a__3a_string____double", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_o);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_double_3e___(std::unordered_map<std::string,std::vector<double> > const &__pyx_v_s) {
PyObject *__pyx_v_o = NULL;
std::unordered_map<std::string,std::vector<double> > ::value_type const *__pyx_v_key_value;
std::unordered_map<std::string,std::vector<double> > ::const_iterator __pyx_v_iter;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_double_3e___", 0);
/* "map.to_py":244
* @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_double_3e___")
* cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_double_3e___(const map[X,Y]& s):
* o = {} # <<<<<<<<<<<<<<
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin()
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_o = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "map.to_py":246
* o = {}
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
* while iter != s.end():
* key_value = &cython.operator.dereference(iter)
*/
__pyx_v_iter = __pyx_v_s.begin();
/* "map.to_py":247
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin()
* while iter != s.end(): # <<<<<<<<<<<<<<
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second
*/
while (1) {
__pyx_t_2 = (__pyx_v_iter != __pyx_v_s.end());
if (!__pyx_t_2) break;
/* "map.to_py":248
* cdef map[X,Y].const_iterator iter = s.begin()
* while iter != s.end():
* key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter)
*/
__pyx_v_key_value = (&(*__pyx_v_iter));
/* "map.to_py":249
* while iter != s.end():
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
* cython.operator.preincrement(iter)
* return o
*/
__pyx_t_1 = __pyx_convert_vector_to_py_double(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely((PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "map.to_py":250
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
* return o
*
*/
(void)((++__pyx_v_iter));
}
/* "map.to_py":251
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter)
* return o # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_o);
__pyx_r = __pyx_v_o;
goto __pyx_L0;
/* "map.to_py":242
* const_iterator end()
*
* @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_double_3e___") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_double_3e___(const map[X,Y]& s):
* o = {}
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_o);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_int_3e___(std::unordered_map<std::string,std::vector<int> > const &__pyx_v_s) {
PyObject *__pyx_v_o = NULL;
std::unordered_map<std::string,std::vector<int> > ::value_type const *__pyx_v_key_value;
std::unordered_map<std::string,std::vector<int> > ::const_iterator __pyx_v_iter;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_int_3e___", 0);
/* "map.to_py":244
* @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_int_3e___")
* cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_int_3e___(const map[X,Y]& s):
* o = {} # <<<<<<<<<<<<<<
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin()
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_o = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "map.to_py":246
* o = {}
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
* while iter != s.end():
* key_value = &cython.operator.dereference(iter)
*/
__pyx_v_iter = __pyx_v_s.begin();
/* "map.to_py":247
* cdef const map[X,Y].value_type *key_value
* cdef map[X,Y].const_iterator iter = s.begin()
* while iter != s.end(): # <<<<<<<<<<<<<<
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second
*/
while (1) {
__pyx_t_2 = (__pyx_v_iter != __pyx_v_s.end());
if (!__pyx_t_2) break;
/* "map.to_py":248
* cdef map[X,Y].const_iterator iter = s.begin()
* while iter != s.end():
* key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter)
*/
__pyx_v_key_value = (&(*__pyx_v_iter));
/* "map.to_py":249
* while iter != s.end():
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
* cython.operator.preincrement(iter)
* return o
*/
__pyx_t_1 = __pyx_convert_vector_to_py_int(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely((PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(1, 249, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "map.to_py":250
* key_value = &cython.operator.dereference(iter)
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
* return o
*
*/
(void)((++__pyx_v_iter));
}
/* "map.to_py":251
* o[key_value.first] = key_value.second
* cython.operator.preincrement(iter)
* return o # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_o);
__pyx_r = __pyx_v_o;
goto __pyx_L0;
/* "map.to_py":242
* const_iterator end()
*
* @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_int_3e___") # <<<<<<<<<<<<<<
* cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_int_3e___(const map[X,Y]& s):
* o = {}
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_vector_3c_int_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_o);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "string.from_py":12
* cdef const char* __Pyx_PyObject_AsStringAndSize(object, Py_ssize_t*) except NULL
*
* @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
* cdef Py_ssize_t length = 0
*/
static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *__pyx_v_o) {
Py_ssize_t __pyx_v_length;
char const *__pyx_v_data;
std::string __pyx_r;
char const *__pyx_t_1;
std::string __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* "string.from_py":14
* @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
* cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
* cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
* return string(data, length)
*/
__pyx_v_length = 0;
/* "string.from_py":15
* cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
* cdef Py_ssize_t length = 0
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
* return string(data, length)
*
*/
__pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)0))) __PYX_ERR(1, 15, __pyx_L1_error)
__pyx_v_data = __pyx_t_1;
/* "string.from_py":16
* cdef Py_ssize_t length = 0
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
* return string(data, length) # <<<<<<<<<<<<<<
*
*
*/
try {
__pyx_t_2 = std::string(__pyx_v_data, __pyx_v_length);
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 16, __pyx_L1_error)
}
__pyx_r = __pyx_t_2;
goto __pyx_L0;
/* "string.from_py":12
* cdef const char* __Pyx_PyObject_AsStringAndSize(object, Py_ssize_t*) except NULL
*
* @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string") # <<<<<<<<<<<<<<
* cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
* cdef Py_ssize_t length = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":129
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
* mode="c", bint allocate_buffer=True):
*
*/
/* Python wrapper */
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_shape = 0;
Py_ssize_t __pyx_v_itemsize;
PyObject *__pyx_v_format = 0;
PyObject *__pyx_v_mode = 0;
int __pyx_v_allocate_buffer;
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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;
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);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shape,&__pyx_mstate_global->__pyx_n_u_itemsize,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_allocate_buffer,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 129, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 5:
values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 129, __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(1, 129, __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(1, 129, __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(1, 129, __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(1, 129, __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, "__cinit__", 0) < 0) __PYX_ERR(1, 129, __pyx_L3_error)
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, i); __PYX_ERR(1, 129, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 5:
values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 129, __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(1, 129, __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(1, 129, __pyx_L3_error)
values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 129, __pyx_L3_error)
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 129, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
}
__pyx_v_shape = ((PyObject*)values[0]);
__pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 129, __pyx_L3_error)
__pyx_v_format = values[2];
__pyx_v_mode = values[3];
if (values[4]) {
__pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 130, __pyx_L3_error)
} else {
/* "View.MemoryView":130
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
*
* cdef int idx
*/
__pyx_v_allocate_buffer = ((int)1);
}
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 129, __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("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 129, __pyx_L1_error)
if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 129, __pyx_L1_error)
}
__pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
/* "View.MemoryView":129
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
* mode="c", bint allocate_buffer=True):
*
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
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 int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
int __pyx_v_idx;
Py_ssize_t __pyx_v_dim;
char __pyx_v_order;
int __pyx_r;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
size_t __pyx_t_6;
char *__pyx_t_7;
int __pyx_t_8;
Py_ssize_t __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11[5];
PyObject *__pyx_t_12 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
__Pyx_INCREF(__pyx_v_format);
/* "View.MemoryView":135
* cdef Py_ssize_t dim
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
* self.itemsize = itemsize
*
*/
if (unlikely(__pyx_v_shape == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 135, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 135, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
/* "View.MemoryView":136
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
*
* if not self.ndim:
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
/* "View.MemoryView":138
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
* raise ValueError, "Empty shape tuple for cython.array"
*
*/
__pyx_t_2 = (!(__pyx_v_self->ndim != 0));
if (unlikely(__pyx_t_2)) {
/* "View.MemoryView":139
*
* if not self.ndim:
* raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Empty_shape_tuple_for_cython_arr, 0, 0);
__PYX_ERR(1, 139, __pyx_L1_error)
/* "View.MemoryView":138
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
* raise ValueError, "Empty shape tuple for cython.array"
*
*/
}
/* "View.MemoryView":141
* raise ValueError, "Empty shape tuple for cython.array"
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
* raise ValueError, "itemsize <= 0 for cython.array"
*
*/
__pyx_t_2 = (__pyx_v_itemsize <= 0);
if (unlikely(__pyx_t_2)) {
/* "View.MemoryView":142
*
* if itemsize <= 0:
* raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<<
*
* if not isinstance(format, bytes):
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_itemsize_0_for_cython_array, 0, 0);
__PYX_ERR(1, 142, __pyx_L1_error)
/* "View.MemoryView":141
* raise ValueError, "Empty shape tuple for cython.array"
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
* raise ValueError, "itemsize <= 0 for cython.array"
*
*/
}
/* "View.MemoryView":144
* raise ValueError, "itemsize <= 0 for cython.array"
*
* if not isinstance(format, bytes): # <<<<<<<<<<<<<<
* format = format.encode('ASCII')
* self._format = format # keep a reference to the byte string
*/
__pyx_t_2 = PyBytes_Check(__pyx_v_format);
__pyx_t_3 = (!__pyx_t_2);
if (__pyx_t_3) {
/* "View.MemoryView":145
*
* if not isinstance(format, bytes):
* format = format.encode('ASCII') # <<<<<<<<<<<<<<
* self._format = format # keep a reference to the byte string
* self.format = self._format
*/
__pyx_t_5 = __pyx_v_format;
__Pyx_INCREF(__pyx_t_5);
__pyx_t_6 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 145, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
__pyx_t_4 = 0;
/* "View.MemoryView":144
* raise ValueError, "itemsize <= 0 for cython.array"
*
* if not isinstance(format, bytes): # <<<<<<<<<<<<<<
* format = format.encode('ASCII')
* self._format = format # keep a reference to the byte string
*/
}
/* "View.MemoryView":146
* if not isinstance(format, bytes):
* format = format.encode('ASCII')
* self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
* self.format = self._format
*
*/
__pyx_t_4 = __pyx_v_format;
__Pyx_INCREF(__pyx_t_4);
if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 146, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
__pyx_v_self->_format = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "View.MemoryView":147
* format = format.encode('ASCII')
* self._format = format # keep a reference to the byte string
* self.format = self._format # <<<<<<<<<<<<<<
*
*
*/
if (unlikely(__pyx_v_self->_format == Py_None)) {
PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
__PYX_ERR(1, 147, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error)
__pyx_v_self->format = __pyx_t_7;
/* "View.MemoryView":150
*
*
* self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
* self._strides = self._shape + self.ndim
*
*/
__pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
/* "View.MemoryView":151
*
* self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
* self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
*
* if not self._shape:
*/
__pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
/* "View.MemoryView":153
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
* raise MemoryError, "unable to allocate shape and strides."
*
*/
__pyx_t_3 = (!(__pyx_v_self->_shape != 0));
if (unlikely(__pyx_t_3)) {
/* "View.MemoryView":154
*
* if not self._shape:
* raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
*
*
*/
__Pyx_Raise(__pyx_builtin_MemoryError, __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
__PYX_ERR(1, 154, __pyx_L1_error)
/* "View.MemoryView":153
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
* raise MemoryError, "unable to allocate shape and strides."
*
*/
}
/* "View.MemoryView":157
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
* if dim <= 0:
* raise ValueError, f"Invalid shape in axis {idx}: {dim}."
*/
__pyx_t_8 = 0;
__pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
__pyx_t_1 = 0;
for (;;) {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 157, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1));
#else
__pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1);
#endif
++__pyx_t_1;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 157, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_dim = __pyx_t_9;
__pyx_v_idx = __pyx_t_8;
__pyx_t_8 = (__pyx_t_8 + 1);
/* "View.MemoryView":158
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
* raise ValueError, f"Invalid shape in axis {idx}: {dim}."
* self._shape[idx] = dim
*/
__pyx_t_3 = (__pyx_v_dim <= 0);
if (unlikely(__pyx_t_3)) {
/* "View.MemoryView":159
* for idx, dim in enumerate(shape):
* if dim <= 0:
* raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
* self._shape[idx] = dim
*
*/
__pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_10 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
__pyx_t_11[1] = __pyx_t_5;
__pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_;
__pyx_t_11[3] = __pyx_t_10;
__pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__2;
__pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 1, 127);
if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_12, 0, 0);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__PYX_ERR(1, 159, __pyx_L1_error)
/* "View.MemoryView":158
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
* raise ValueError, f"Invalid shape in axis {idx}: {dim}."
* self._shape[idx] = dim
*/
}
/* "View.MemoryView":160
* if dim <= 0:
* raise ValueError, f"Invalid shape in axis {idx}: {dim}."
* self._shape[idx] = dim # <<<<<<<<<<<<<<
*
* cdef char order
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
/* "View.MemoryView":157
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
* if dim <= 0:
* raise ValueError, f"Invalid shape in axis {idx}: {dim}."
*/
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "View.MemoryView":163
*
* cdef char order
* if mode == 'c': # <<<<<<<<<<<<<<
* order = b'C'
* self.mode = u'c'
*/
__pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 163, __pyx_L1_error)
if (__pyx_t_3) {
/* "View.MemoryView":164
* cdef char order
* if mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
* self.mode = u'c'
* elif mode == 'fortran':
*/
__pyx_v_order = 'C';
/* "View.MemoryView":165
* if mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
* elif mode == 'fortran':
* order = b'F'
*/
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;
/* "View.MemoryView":163
*
* cdef char order
* if mode == 'c': # <<<<<<<<<<<<<<
* order = b'C'
* self.mode = u'c'
*/
goto __pyx_L11;
}
/* "View.MemoryView":166
* order = b'C'
* self.mode = u'c'
* elif mode == 'fortran': # <<<<<<<<<<<<<<
* order = b'F'
* self.mode = u'fortran'
*/
__pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 166, __pyx_L1_error)
if (likely(__pyx_t_3)) {
/* "View.MemoryView":167
* self.mode = u'c'
* elif mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
* self.mode = u'fortran'
* else:
*/
__pyx_v_order = 'F';
/* "View.MemoryView":168
* elif mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
* else:
* raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
*/
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;
/* "View.MemoryView":166
* order = b'C'
* self.mode = u'c'
* elif mode == 'fortran': # <<<<<<<<<<<<<<
* order = b'F'
* self.mode = u'fortran'
*/
goto __pyx_L11;
}
/* "View.MemoryView":170
* self.mode = u'fortran'
* else:
* raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
*
* self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
*/
/*else*/ {
__pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_12, 0, 0);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__PYX_ERR(1, 170, __pyx_L1_error)
}
__pyx_L11:;
/* "View.MemoryView":172
* raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
*
* self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
*
* self.free_data = allocate_buffer
*/
__pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
/* "View.MemoryView":174
* self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
* self.dtype_is_object = format == b'O'
*
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
/* "View.MemoryView":175
*
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
*
* if allocate_buffer:
*/
__pyx_t_12 = PyObject_RichCompare(__pyx_v_format, __pyx_mstate_global->__pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 175, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_3;
/* "View.MemoryView":177
* self.dtype_is_object = format == b'O'
*
* if allocate_buffer: # <<<<<<<<<<<<<<
* _allocate_buffer(self)
*
*/
if (__pyx_v_allocate_buffer) {
/* "View.MemoryView":178
*
* if allocate_buffer:
* _allocate_buffer(self) # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
__pyx_t_8 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 178, __pyx_L1_error)
/* "View.MemoryView":177
* self.dtype_is_object = format == b'O'
*
* if allocate_buffer: # <<<<<<<<<<<<<<
* _allocate_buffer(self)
*
*/
}
/* "View.MemoryView":129
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
* mode="c", bint allocate_buffer=True):
*
*/
/* 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_10);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_format);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":180
* _allocate_buffer(self)
*
* @cname('getbuffer') # <<<<<<<<<<<<<<
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1
*/
/* Python wrapper */
CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
int __pyx_v_bufmode;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
char *__pyx_t_2;
Py_ssize_t __pyx_t_3;
int __pyx_t_4;
Py_ssize_t *__pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
if (unlikely(__pyx_v_info == NULL)) {
PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
return -1;
}
__Pyx_RefNannySetupContext("__getbuffer__", 0);
__pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
__Pyx_GIVEREF(__pyx_v_info->obj);
/* "View.MemoryView":182
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
* if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
* if self.mode == u"c":
*/
__pyx_v_bufmode = -1;
/* "View.MemoryView":183
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1
* if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
if (__pyx_t_1) {
/* "View.MemoryView":184
* cdef int bufmode = -1
* if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
* if self.mode == u"c": # <<<<<<<<<<<<<<
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
*/
__pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 184, __pyx_L1_error)
if (__pyx_t_1) {
/* "View.MemoryView":185
* if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
/* "View.MemoryView":184
* cdef int bufmode = -1
* if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
* if self.mode == u"c": # <<<<<<<<<<<<<<
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
*/
goto __pyx_L4;
}
/* "View.MemoryView":186
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran": # <<<<<<<<<<<<<<
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode):
*/
__pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
if (__pyx_t_1) {
/* "View.MemoryView":187
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
* if not (flags & bufmode):
* raise ValueError, "Can only create a buffer that is contiguous in memory."
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
/* "View.MemoryView":186
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran": # <<<<<<<<<<<<<<
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode):
*/
}
__pyx_L4:;
/* "View.MemoryView":188
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
* raise ValueError, "Can only create a buffer that is contiguous in memory."
* info.buf = self.data
*/
__pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
if (unlikely(__pyx_t_1)) {
/* "View.MemoryView":189
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode):
* raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<<
* info.buf = self.data
* info.len = self.len
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Can_only_create_a_buffer_that_is, 0, 0);
__PYX_ERR(1, 189, __pyx_L1_error)
/* "View.MemoryView":188
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
* raise ValueError, "Can only create a buffer that is contiguous in memory."
* info.buf = self.data
*/
}
/* "View.MemoryView":183
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1
* if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
}
/* "View.MemoryView":190
* if not (flags & bufmode):
* raise ValueError, "Can only create a buffer that is contiguous in memory."
* info.buf = self.data # <<<<<<<<<<<<<<
* info.len = self.len
*
*/
__pyx_t_2 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_2;
/* "View.MemoryView":191
* raise ValueError, "Can only create a buffer that is contiguous in memory."
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
__pyx_t_3 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_3;
/* "View.MemoryView":193
* info.len = self.len
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
* info.ndim = self.ndim
* info.shape = self._shape
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
/* "View.MemoryView":194
*
* if flags & PyBUF_STRIDES:
* info.ndim = self.ndim # <<<<<<<<<<<<<<
* info.shape = self._shape
* info.strides = self._strides
*/
__pyx_t_4 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_4;
/* "View.MemoryView":195
* if flags & PyBUF_STRIDES:
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
* info.strides = self._strides
* else:
*/
__pyx_t_5 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_5;
/* "View.MemoryView":196
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
* else:
* info.ndim = 1
*/
__pyx_t_5 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_5;
/* "View.MemoryView":193
* info.len = self.len
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
* info.ndim = self.ndim
* info.shape = self._shape
*/
goto __pyx_L6;
}
/* "View.MemoryView":198
* info.strides = self._strides
* else:
* info.ndim = 1 # <<<<<<<<<<<<<<
* info.shape = &self.len if flags & PyBUF_ND else NULL
* info.strides = NULL
*/
/*else*/ {
__pyx_v_info->ndim = 1;
/* "View.MemoryView":199
* else:
* info.ndim = 1
* info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
* info.strides = NULL
*
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
if (__pyx_t_1) {
__pyx_t_5 = (&__pyx_v_self->len);
} else {
__pyx_t_5 = NULL;
}
__pyx_v_info->shape = __pyx_t_5;
/* "View.MemoryView":200
* info.ndim = 1
* info.shape = &self.len if flags & PyBUF_ND else NULL
* info.strides = NULL # <<<<<<<<<<<<<<
*
* info.suboffsets = NULL
*/
__pyx_v_info->strides = NULL;
}
__pyx_L6:;
/* "View.MemoryView":202
* info.strides = NULL
*
* info.suboffsets = NULL # <<<<<<<<<<<<<<
* info.itemsize = self.itemsize
* info.readonly = 0
*/
__pyx_v_info->suboffsets = NULL;
/* "View.MemoryView":203
*
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
* info.readonly = 0
* info.format = self.format if flags & PyBUF_FORMAT else NULL
*/
__pyx_t_3 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_3;
/* "View.MemoryView":204
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
* info.format = self.format if flags & PyBUF_FORMAT else NULL
* info.obj = self
*/
__pyx_v_info->readonly = 0;
/* "View.MemoryView":205
* info.itemsize = self.itemsize
* info.readonly = 0
* info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
* info.obj = self
*
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
__pyx_t_2 = __pyx_v_self->format;
} else {
__pyx_t_2 = NULL;
}
__pyx_v_info->format = __pyx_t_2;
/* "View.MemoryView":206
* info.readonly = 0
* info.format = self.format if flags & PyBUF_FORMAT else NULL
* info.obj = self # <<<<<<<<<<<<<<
*
* def __dealloc__(array self):
*/
__Pyx_INCREF((PyObject *)__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_v_self);
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
/* "View.MemoryView":180
* _allocate_buffer(self)
*
* @cname('getbuffer') # <<<<<<<<<<<<<<
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
if (__pyx_v_info->obj != NULL) {
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
}
goto __pyx_L2;
__pyx_L0:;
if (__pyx_v_info->obj == Py_None) {
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
}
__pyx_L2:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":208
* info.obj = self
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
*/
/* Python wrapper */
static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_array___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_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
int __pyx_t_1;
int __pyx_t_2;
/* "View.MemoryView":209
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
* self.callback_free_data(self.data)
* elif self.free_data and self.data is not NULL:
*/
__pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
if (__pyx_t_1) {
/* "View.MemoryView":210
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
* elif self.free_data and self.data is not NULL:
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
/* "View.MemoryView":209
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
* self.callback_free_data(self.data)
* elif self.free_data and self.data is not NULL:
*/
goto __pyx_L3;
}
/* "View.MemoryView":211
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
*/
if (__pyx_v_self->free_data) {
} else {
__pyx_t_1 = __pyx_v_self->free_data;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_self->data != NULL);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "View.MemoryView":212
* self.callback_free_data(self.data)
* elif self.free_data and self.data is not NULL:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
* refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
* free(self.data)
*/
if (__pyx_v_self->dtype_is_object) {
/* "View.MemoryView":213
* elif self.free_data and self.data is not NULL:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
* free(self.data)
* PyObject_Free(self._shape)
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
/* "View.MemoryView":212
* self.callback_free_data(self.data)
* elif self.free_data and self.data is not NULL:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
* refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
* free(self.data)
*/
}
/* "View.MemoryView":214
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
* free(self.data) # <<<<<<<<<<<<<<
* PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
/* "View.MemoryView":211
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
*/
}
__pyx_L3:;
/* "View.MemoryView":215
* refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
* free(self.data)
* PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
* @property
*/
PyObject_Free(__pyx_v_self->_shape);
/* "View.MemoryView":208
* info.obj = self
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
*/
/* function exit code */
}
/* "View.MemoryView":217
* PyObject_Free(self._shape)
*
* @property # <<<<<<<<<<<<<<
* def memview(self):
* return self.get_memview()
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_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_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__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);
/* "View.MemoryView":219
* @property
* def memview(self):
* return self.get_memview() # <<<<<<<<<<<<<<
*
* @cname('get_memview')
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "View.MemoryView":217
* PyObject_Free(self._shape)
*
* @property # <<<<<<<<<<<<<<
* def memview(self):
* return self.get_memview()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":221
* return self.get_memview()
*
* @cname('get_memview') # <<<<<<<<<<<<<<
* cdef get_memview(self):
* flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
int __pyx_v_flags;
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_memview", 0);
/* "View.MemoryView":223
* @cname('get_memview')
* cdef get_memview(self):
* flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
* return memoryview(self, flags, self.dtype_is_object)
*
*/
__pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
/* "View.MemoryView":224
* cdef get_memview(self):
* flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
* return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = NULL;
__Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
__pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
__pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_4, __pyx_t_5};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_1);
}
__pyx_r = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
/* "View.MemoryView":221
* return self.get_memview()
*
* @cname('get_memview') # <<<<<<<<<<<<<<
* cdef get_memview(self):
* flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
*/
/* 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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":226
* return memoryview(self, flags, self.dtype_is_object)
*
* def __len__(self): # <<<<<<<<<<<<<<
* return self._shape[0]
*
*/
/* Python wrapper */
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
Py_ssize_t __pyx_r;
/* "View.MemoryView":227
*
* def __len__(self):
* return self._shape[0] # <<<<<<<<<<<<<<
*
* def __getattr__(self, attr):
*/
__pyx_r = (__pyx_v_self->_shape[0]);
goto __pyx_L0;
/* "View.MemoryView":226
* return memoryview(self, flags, self.dtype_is_object)
*
* def __len__(self): # <<<<<<<<<<<<<<
* return self._shape[0]
*
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":229
* return self._shape[0]
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
* return getattr(self.memview, attr)
*
*/
/* Python wrapper */
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
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("__getattr__", 0);
/* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
*
* def __getitem__(self, item):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":229
* return self._shape[0]
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
* return getattr(self.memview, attr)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
* return self.memview[item]
*
*/
/* Python wrapper */
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
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("__getitem__", 0);
/* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
*
* def __setitem__(self, item, value):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
* return self.memview[item]
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
* self.memview[item] = value
*
*/
/* Python wrapper */
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
/* "View.MemoryView":236
*
* def __setitem__(self, item, value):
* self.memview[item] = value # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
* self.memview[item] = value
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__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___pyx_array_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 PyObject *__pyx_pw___pyx_array_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___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__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(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(1, 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("View.MemoryView.array.__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___pyx_array_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 PyObject *__pyx_pw___pyx_array_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
) {
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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__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___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__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(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(1, 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("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":245
* pass
*
* @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
* cdef int _allocate_buffer(array self) except -1:
*
*/
static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
Py_ssize_t __pyx_v_i;
PyObject **__pyx_v_p;
int __pyx_r;
int __pyx_t_1;
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* "View.MemoryView":252
* cdef PyObject **p
*
* self.free_data = True # <<<<<<<<<<<<<<
* self.data = <char *>malloc(self.len)
* if not self.data:
*/
__pyx_v_self->free_data = 1;
/* "View.MemoryView":253
*
* self.free_data = True
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
* if not self.data:
* raise MemoryError, "unable to allocate array data."
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
/* "View.MemoryView":254
* self.free_data = True
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
* raise MemoryError, "unable to allocate array data."
*
*/
__pyx_t_1 = (!(__pyx_v_self->data != 0));
if (unlikely(__pyx_t_1)) {
/* "View.MemoryView":255
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
__Pyx_Raise(__pyx_builtin_MemoryError, __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
__PYX_ERR(1, 255, __pyx_L1_error)
/* "View.MemoryView":254
* self.free_data = True
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
* raise MemoryError, "unable to allocate array data."
*
*/
}
/* "View.MemoryView":257
* raise MemoryError, "unable to allocate array data."
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
* p = <PyObject **> self.data
* for i in range(self.len // self.itemsize):
*/
if (__pyx_v_self->dtype_is_object) {
/* "View.MemoryView":258
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
* for i in range(self.len // self.itemsize):
* p[i] = Py_None
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
/* "View.MemoryView":259
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
* p[i] = Py_None
* Py_INCREF(Py_None)
*/
if (unlikely(__pyx_v_self->itemsize == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(1, 259, __pyx_L1_error)
}
else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
__PYX_ERR(1, 259, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
__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;
/* "View.MemoryView":260
* p = <PyObject **> self.data
* for i in range(self.len // self.itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
* Py_INCREF(Py_None)
* return 0
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
/* "View.MemoryView":261
* for i in range(self.len // self.itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
* return 0
*
*/
Py_INCREF(Py_None);
}
/* "View.MemoryView":257
* raise MemoryError, "unable to allocate array data."
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
* p = <PyObject **> self.data
* for i in range(self.len // self.itemsize):
*/
}
/* "View.MemoryView":262
* p[i] = Py_None
* Py_INCREF(Py_None)
* return 0 # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = 0;
goto __pyx_L0;
/* "View.MemoryView":245
* pass
*
* @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
* cdef int _allocate_buffer(array self) except -1:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":265
*
*
* @cname("__pyx_array_new") # <<<<<<<<<<<<<<
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
* cdef array result
*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char const *__pyx_v_c_mode, char *__pyx_v_buf) {
struct __pyx_array_obj *__pyx_v_result = 0;
PyObject *__pyx_v_mode = 0;
struct __pyx_array_obj *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("array_cwrapper", 0);
/* "View.MemoryView":268
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
* cdef array result
* cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
*
* if buf is NULL:
*/
__pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
__pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
} else {
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
__pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
}
__pyx_v_mode = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "View.MemoryView":270
* cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
*
* if buf is NULL: # <<<<<<<<<<<<<<
* result = array.__new__(array, shape, itemsize, format, mode)
* else:
*/
__pyx_t_2 = (__pyx_v_buf == NULL);
if (__pyx_t_2) {
/* "View.MemoryView":271
*
* if buf is NULL:
* result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
* else:
* result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
*/
__pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_shape);
__Pyx_GIVEREF(__pyx_v_shape);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 271, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 271, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_3);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 271, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_mode);
__Pyx_GIVEREF(__pyx_v_mode);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 271, __pyx_L1_error);
__pyx_t_1 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 271, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
__pyx_t_3 = 0;
/* "View.MemoryView":270
* cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
*
* if buf is NULL: # <<<<<<<<<<<<<<
* result = array.__new__(array, shape, itemsize, format, mode)
* else:
*/
goto __pyx_L3;
}
/* "View.MemoryView":273
* result = array.__new__(array, shape, itemsize, format, mode)
* else:
* result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
* result.data = buf
*
*/
/*else*/ {
__pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_shape);
__Pyx_GIVEREF(__pyx_v_shape);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 273, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_3);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 273, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 273, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_mode);
__Pyx_GIVEREF(__pyx_v_mode);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 273, __pyx_L1_error);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 273, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
__pyx_t_3 = 0;
/* "View.MemoryView":274
* else:
* result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
*
* return result
*/
__pyx_v_result->data = __pyx_v_buf;
}
__pyx_L3:;
/* "View.MemoryView":276
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF((PyObject *)__pyx_r);
__Pyx_INCREF((PyObject *)__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;
/* "View.MemoryView":265
*
*
* @cname("__pyx_array_new") # <<<<<<<<<<<<<<
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
* cdef array result
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
__Pyx_XDECREF(__pyx_v_mode);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":302
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
* self.name = name
* def __repr__(self):
*/
/* Python wrapper */
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[1] = {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_name,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 302, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 302, __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(1, 302, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(1, 302, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 302, __pyx_L3_error)
}
__pyx_v_name = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 302, __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("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
/* 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_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
/* "View.MemoryView":303
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
* def __repr__(self):
* return self.name
*/
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
__Pyx_GOTREF(__pyx_v_self->name);
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
/* "View.MemoryView":302
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
* self.name = name
* def __repr__(self):
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":304
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
* return self.name
*
*/
/* Python wrapper */
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
/* "View.MemoryView":305
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
*
* cdef generic = Enum("<strided and direct or indirect>")
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->name);
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
/* "View.MemoryView":304
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
* return self.name
*
*/
/* 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___pyx_MemviewEnum_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 PyObject *__pyx_pw___pyx_MemviewEnum_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___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
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.name,) # <<<<<<<<<<<<<<
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_self->name);
__Pyx_GIVEREF(__pyx_v_self->name);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
__pyx_v_state = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "(tree fragment)":6
* cdef bint use_setstate
* state = (self.name,)
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
* if _dict is not None:
* state += (_dict,)
*/
__pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__dict = __pyx_t_1;
__pyx_t_1 = 0;
/* "(tree fragment)":7
* state = (self.name,)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
__pyx_t_2 = (__pyx_v__dict != Py_None);
if (__pyx_t_2) {
/* "(tree fragment)":8
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
* state += (_dict,) # <<<<<<<<<<<<<<
* use_setstate = True
* else:
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v__dict);
__Pyx_GIVEREF(__pyx_v__dict);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
__pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
__pyx_t_3 = 0;
/* "(tree fragment)":9
* if _dict is not None:
* state += (_dict,)
* use_setstate = True # <<<<<<<<<<<<<<
* else:
* use_setstate = self.name is not None
*/
__pyx_v_use_setstate = 1;
/* "(tree fragment)":7
* state = (self.name,)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
goto __pyx_L3;
}
/* "(tree fragment)":11
* use_setstate = True
* else:
* use_setstate = self.name is not None # <<<<<<<<<<<<<<
* if use_setstate:
* return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
*/
/*else*/ {
__pyx_t_2 = (__pyx_v_self->name != Py_None);
__pyx_v_use_setstate = __pyx_t_2;
}
__pyx_L3:;
/* "(tree fragment)":12
* else:
* use_setstate = self.name is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
* else:
*/
if (__pyx_v_use_setstate) {
/* "(tree fragment)":13
* use_setstate = self.name is not None
* if use_setstate:
* return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
* else:
* return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__pyx_t_3 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "(tree fragment)":12
* else:
* use_setstate = self.name is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
* else:
*/
}
/* "(tree fragment)":15
* return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
* else:
* return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_Enum__set_state(self, __pyx_state)
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__pyx_t_4 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("View.MemoryView.Enum.__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_Enum, (type(self), 0x82a3537, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_Enum__set_state(self, __pyx_state)
*/
/* Python wrapper */
static PyObject *__pyx_pw___pyx_MemviewEnum_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 PyObject *__pyx_pw___pyx_MemviewEnum_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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__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___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
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("__setstate_cython__", 0);
/* "(tree fragment)":17
* return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
__pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_Enum__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_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":347
* cdef const __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
* self.obj = obj
* self.flags = flags
*/
/* Python wrapper */
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_obj = 0;
int __pyx_v_flags;
int __pyx_v_dtype_is_object;
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[3] = {0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
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);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_dtype_is_object,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 347, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 347, __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(1, 347, __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(1, 347, __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, "__cinit__", 0) < 0) __PYX_ERR(1, 347, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(1, 347, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 347, __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(1, 347, __pyx_L3_error)
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 347, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_obj = values[0];
__pyx_v_flags = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 347, __pyx_L3_error)
if (values[2]) {
__pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 347, __pyx_L3_error)
} else {
__pyx_v_dtype_is_object = ((int)0);
}
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 347, __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("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
/* 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_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
Py_intptr_t __pyx_t_4;
size_t __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "View.MemoryView":348
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
* self.flags = flags
* if type(self) is memoryview or obj is not None:
*/
__Pyx_INCREF(__pyx_v_obj);
__Pyx_GIVEREF(__pyx_v_obj);
__Pyx_GOTREF(__pyx_v_self->obj);
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
/* "View.MemoryView":349
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
* if type(self) is memoryview or obj is not None:
* PyObject_GetBuffer(obj, &self.view, flags)
*/
__pyx_v_self->flags = __pyx_v_flags;
/* "View.MemoryView":350
* self.obj = obj
* self.flags = flags
* if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
* PyObject_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
*/
__pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_obj != Py_None);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "View.MemoryView":351
* self.flags = flags
* if type(self) is memoryview or obj is not None:
* PyObject_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
*/
__pyx_t_3 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 351, __pyx_L1_error)
/* "View.MemoryView":352
* if type(self) is memoryview or obj is not None:
* PyObject_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None)
*/
__pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
if (__pyx_t_1) {
/* "View.MemoryView":353
* PyObject_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
* Py_INCREF(Py_None)
*
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
/* "View.MemoryView":354
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
* if not __PYX_CYTHON_ATOMICS_ENABLED():
*/
Py_INCREF(Py_None);
/* "View.MemoryView":352
* if type(self) is memoryview or obj is not None:
* PyObject_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None)
*/
}
/* "View.MemoryView":350
* self.obj = obj
* self.flags = flags
* if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
* PyObject_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
*/
}
/* "View.MemoryView":356
* Py_INCREF(Py_None)
*
* if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
* global __pyx_memoryview_thread_locks_used
* if (__pyx_memoryview_thread_locks_used < 8 and
*/
__pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
if (__pyx_t_1) {
/* "View.MemoryView":358
* if not __PYX_CYTHON_ATOMICS_ENABLED():
* global __pyx_memoryview_thread_locks_used
* if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
*
* not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
__pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L9_bool_binop_done;
}
/* "View.MemoryView":360
* if (__pyx_memoryview_thread_locks_used < 8 and
*
* not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()): # <<<<<<<<<<<<<<
* self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
* __pyx_memoryview_thread_locks_used += 1
*/
__pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
__pyx_t_1 = __pyx_t_2;
__pyx_L9_bool_binop_done:;
/* "View.MemoryView":358
* if not __PYX_CYTHON_ATOMICS_ENABLED():
* global __pyx_memoryview_thread_locks_used
* if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
*
* not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
if (__pyx_t_1) {
/* "View.MemoryView":361
*
* not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
* self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
* __pyx_memoryview_thread_locks_used += 1
* if self.lock is NULL:
*/
__pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
/* "View.MemoryView":362
* not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
* self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
* __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
* if self.lock is NULL:
* self.lock = PyThread_allocate_lock()
*/
__pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
/* "View.MemoryView":358
* if not __PYX_CYTHON_ATOMICS_ENABLED():
* global __pyx_memoryview_thread_locks_used
* if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
*
* not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
}
/* "View.MemoryView":363
* self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
* __pyx_memoryview_thread_locks_used += 1
* if self.lock is NULL: # <<<<<<<<<<<<<<
* self.lock = PyThread_allocate_lock()
* if self.lock is NULL:
*/
__pyx_t_1 = (__pyx_v_self->lock == NULL);
if (__pyx_t_1) {
/* "View.MemoryView":364
* __pyx_memoryview_thread_locks_used += 1
* if self.lock is NULL:
* self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
* if self.lock is NULL:
* raise MemoryError
*/
__pyx_v_self->lock = PyThread_allocate_lock();
/* "View.MemoryView":365
* if self.lock is NULL:
* self.lock = PyThread_allocate_lock()
* if self.lock is NULL: # <<<<<<<<<<<<<<
* raise MemoryError
*
*/
__pyx_t_1 = (__pyx_v_self->lock == NULL);
if (unlikely(__pyx_t_1)) {
/* "View.MemoryView":366
* self.lock = PyThread_allocate_lock()
* if self.lock is NULL:
* raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)
/* "View.MemoryView":365
* if self.lock is NULL:
* self.lock = PyThread_allocate_lock()
* if self.lock is NULL: # <<<<<<<<<<<<<<
* raise MemoryError
*
*/
}
/* "View.MemoryView":363
* self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
* __pyx_memoryview_thread_locks_used += 1
* if self.lock is NULL: # <<<<<<<<<<<<<<
* self.lock = PyThread_allocate_lock()
* if self.lock is NULL:
*/
}
/* "View.MemoryView":356
* Py_INCREF(Py_None)
*
* if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
* global __pyx_memoryview_thread_locks_used
* if (__pyx_memoryview_thread_locks_used < 8 and
*/
}
/* "View.MemoryView":368
* raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
* self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
/* "View.MemoryView":369
*
* if flags & PyBUF_FORMAT:
* self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* else:
* self.dtype_is_object = dtype_is_object
*/
__pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L14_bool_binop_done;
}
__pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
__pyx_t_1 = __pyx_t_2;
__pyx_L14_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
/* "View.MemoryView":368
* raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
* self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
goto __pyx_L13;
}
/* "View.MemoryView":371
* self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
*/
/*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
__pyx_L13:;
/* "View.MemoryView":373
* self.dtype_is_object = dtype_is_object
*
* assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
* self.typeinfo = NULL
*
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(__pyx_assertions_enabled())) {
__pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
__pyx_t_5 = (sizeof(__pyx_atomic_int_type));
if (unlikely(__pyx_t_5 == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(1, 373, __pyx_L1_error)
}
__pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
if (unlikely(!__pyx_t_1)) {
__Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
__PYX_ERR(1, 373, __pyx_L1_error)
}
}
#else
if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
#endif
/* "View.MemoryView":374
*
* assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
* self.typeinfo = NULL # <<<<<<<<<<<<<<
*
* def __dealloc__(memoryview self):
*/
__pyx_v_self->typeinfo = NULL;
/* "View.MemoryView":347
* cdef const __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
* self.obj = obj
* self.flags = flags
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":376
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
* if self.obj is not None:
* PyBuffer_Release(&self.view)
*/
/* Python wrapper */
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryview___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_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
int __pyx_v_i;
int __pyx_t_1;
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
int __pyx_t_4;
PyThread_type_lock __pyx_t_5;
PyThread_type_lock __pyx_t_6;
/* "View.MemoryView":377
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
* PyBuffer_Release(&self.view)
* elif (<__pyx_buffer *> &self.view).obj == Py_None:
*/
__pyx_t_1 = (__pyx_v_self->obj != Py_None);
if (__pyx_t_1) {
/* "View.MemoryView":378
* def __dealloc__(memoryview self):
* if self.obj is not None:
* PyBuffer_Release(&self.view) # <<<<<<<<<<<<<<
* elif (<__pyx_buffer *> &self.view).obj == Py_None:
*
*/
PyBuffer_Release((&__pyx_v_self->view));
/* "View.MemoryView":377
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
* PyBuffer_Release(&self.view)
* elif (<__pyx_buffer *> &self.view).obj == Py_None:
*/
goto __pyx_L3;
}
/* "View.MemoryView":379
* if self.obj is not None:
* PyBuffer_Release(&self.view)
* elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
*
* (<__pyx_buffer *> &self.view).obj = NULL
*/
__pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
if (__pyx_t_1) {
/* "View.MemoryView":381
* elif (<__pyx_buffer *> &self.view).obj == Py_None:
*
* (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
* Py_DECREF(Py_None)
*
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
/* "View.MemoryView":382
*
* (<__pyx_buffer *> &self.view).obj = NULL
* Py_DECREF(Py_None) # <<<<<<<<<<<<<<
*
* cdef int i
*/
Py_DECREF(Py_None);
/* "View.MemoryView":379
* if self.obj is not None:
* PyBuffer_Release(&self.view)
* elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
*
* (<__pyx_buffer *> &self.view).obj = NULL
*/
}
__pyx_L3:;
/* "View.MemoryView":386
* cdef int i
* global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
* for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
* if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_1 = (__pyx_v_self->lock != NULL);
if (__pyx_t_1) {
/* "View.MemoryView":387
* global __pyx_memoryview_thread_locks_used
* if self.lock != NULL:
* for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
* if __pyx_memoryview_thread_locks[i] is self.lock:
* __pyx_memoryview_thread_locks_used -= 1
*/
__pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
if (__pyx_t_1) {
__pyx_t_2 = 0;
} else {
__pyx_t_2 = __pyx_memoryview_thread_locks_used;
}
__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;
/* "View.MemoryView":388
* if self.lock != NULL:
* for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
* if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
* __pyx_memoryview_thread_locks_used -= 1
* if i != __pyx_memoryview_thread_locks_used:
*/
__pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
if (__pyx_t_1) {
/* "View.MemoryView":389
* for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
* if __pyx_memoryview_thread_locks[i] is self.lock:
* __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
* if i != __pyx_memoryview_thread_locks_used:
* __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
*/
__pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
/* "View.MemoryView":390
* if __pyx_memoryview_thread_locks[i] is self.lock:
* __pyx_memoryview_thread_locks_used -= 1
* if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
* __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
* __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
*/
__pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
if (__pyx_t_1) {
/* "View.MemoryView":392
* if i != __pyx_memoryview_thread_locks_used:
* __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
* __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
* break
* else:
*/
__pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
__pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
/* "View.MemoryView":391
* __pyx_memoryview_thread_locks_used -= 1
* if i != __pyx_memoryview_thread_locks_used:
* __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
* __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
* break
*/
(__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
(__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
/* "View.MemoryView":390
* if __pyx_memoryview_thread_locks[i] is self.lock:
* __pyx_memoryview_thread_locks_used -= 1
* if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
* __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
* __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
*/
}
/* "View.MemoryView":393
* __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
* __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
* break # <<<<<<<<<<<<<<
* else:
* PyThread_free_lock(self.lock)
*/
goto __pyx_L6_break;
/* "View.MemoryView":388
* if self.lock != NULL:
* for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
* if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
* __pyx_memoryview_thread_locks_used -= 1
* if i != __pyx_memoryview_thread_locks_used:
*/
}
}
/*else*/ {
/* "View.MemoryView":395
* break
* else:
* PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
*/
PyThread_free_lock(__pyx_v_self->lock);
}
__pyx_L6_break:;
/* "View.MemoryView":386
* cdef int i
* global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
* for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
* if __pyx_memoryview_thread_locks[i] is self.lock:
*/
}
/* "View.MemoryView":376
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
* if self.obj is not None:
* PyBuffer_Release(&self.view)
*/
/* function exit code */
}
/* "View.MemoryView":397
* PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf
*/
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
Py_ssize_t __pyx_v_dim;
char *__pyx_v_itemp;
PyObject *__pyx_v_idx = NULL;
char *__pyx_r;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
PyObject *(*__pyx_t_4)(PyObject *);
PyObject *__pyx_t_5 = NULL;
Py_ssize_t __pyx_t_6;
char *__pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_item_pointer", 0);
/* "View.MemoryView":399
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
*
* for dim, idx in enumerate(index):
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
/* "View.MemoryView":401
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
*/
__pyx_t_1 = 0;
if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
__pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
__pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
#endif
if (__pyx_t_3 >= __pyx_temp) break;
}
__pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
++__pyx_t_3;
} else {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
#endif
if (__pyx_t_3 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
#else
__pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
#endif
++__pyx_t_3;
}
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_2);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 401, __pyx_L1_error)
PyErr_Clear();
}
break;
}
}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
/* "View.MemoryView":402
*
* for dim, idx in enumerate(index):
* itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
*
* return itemp
*/
__pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
__pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)0))) __PYX_ERR(1, 402, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
/* "View.MemoryView":401
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "View.MemoryView":404
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
/* "View.MemoryView":397
* PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_idx);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":407
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
* if index is Ellipsis:
* return self
*/
/* Python wrapper */
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
PyObject *__pyx_v_have_slices = NULL;
PyObject *__pyx_v_indices = NULL;
char *__pyx_v_itemp;
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;
char *__pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
/* "View.MemoryView":408
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
if (__pyx_t_1) {
/* "View.MemoryView":409
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
*
* have_slices, indices = _unellipsify(index, self.view.ndim)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF((PyObject *)__pyx_v_self);
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "View.MemoryView":408
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
* return self
*
*/
}
/* "View.MemoryView":411
* return self
*
* have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
*
* cdef char *itemp
*/
__pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (likely(__pyx_t_2 != Py_None)) {
PyObject* sequence = __pyx_t_2;
Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(1, 411, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__Pyx_INCREF(__pyx_t_3);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
__Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
}
__pyx_v_have_slices = __pyx_t_3;
__pyx_t_3 = 0;
__pyx_v_indices = __pyx_t_4;
__pyx_t_4 = 0;
/* "View.MemoryView":414
*
* cdef char *itemp
* if have_slices: # <<<<<<<<<<<<<<
* return memview_slice(self, indices)
* else:
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
if (__pyx_t_1) {
/* "View.MemoryView":415
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
* else:
* itemp = self.get_item_pointer(indices)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":414
*
* cdef char *itemp
* if have_slices: # <<<<<<<<<<<<<<
* return memview_slice(self, indices)
* else:
*/
}
/* "View.MemoryView":417
* return memview_slice(self, indices)
* else:
* itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
* return self.convert_item_to_object(itemp)
*
*/
/*else*/ {
__pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)0))) __PYX_ERR(1, 417, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_5;
/* "View.MemoryView":418
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
*
* def __setitem__(memoryview self, object index, object value):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "View.MemoryView":407
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
* if index is Ellipsis:
* return self
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_have_slices);
__Pyx_XDECREF(__pyx_v_indices);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":420
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
* if self.view.readonly:
* raise TypeError, "Cannot assign to read-only memoryview"
*/
/* Python wrapper */
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
PyObject *__pyx_v_have_slices = NULL;
PyObject *__pyx_v_obj = NULL;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
__Pyx_INCREF(__pyx_v_index);
/* "View.MemoryView":421
*
* def __setitem__(memoryview self, object index, object value):
* if self.view.readonly: # <<<<<<<<<<<<<<
* raise TypeError, "Cannot assign to read-only memoryview"
*
*/
if (unlikely(__pyx_v_self->view.readonly)) {
/* "View.MemoryView":422
* def __setitem__(memoryview self, object index, object value):
* if self.view.readonly:
* raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
*
* have_slices, index = _unellipsify(index, self.view.ndim)
*/
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
__PYX_ERR(1, 422, __pyx_L1_error)
/* "View.MemoryView":421
*
* def __setitem__(memoryview self, object index, object value):
* if self.view.readonly: # <<<<<<<<<<<<<<
* raise TypeError, "Cannot assign to read-only memoryview"
*
*/
}
/* "View.MemoryView":424
* raise TypeError, "Cannot assign to read-only memoryview"
*
* have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
*
* if have_slices:
*/
__pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(__pyx_t_1 != Py_None)) {
PyObject* sequence = __pyx_t_1;
Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(1, 424, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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);
#else
__pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
__Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
}
__pyx_v_have_slices = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
__pyx_t_3 = 0;
/* "View.MemoryView":426
* have_slices, index = _unellipsify(index, self.view.ndim)
*
* if have_slices: # <<<<<<<<<<<<<<
* obj = self.is_slice(value)
* if obj is not None:
*/
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
if (__pyx_t_4) {
/* "View.MemoryView":427
*
* if have_slices:
* obj = self.is_slice(value) # <<<<<<<<<<<<<<
* if obj is not None:
* self.setitem_slice_assignment(self[index], obj)
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
/* "View.MemoryView":428
* if have_slices:
* obj = self.is_slice(value)
* if obj is not None: # <<<<<<<<<<<<<<
* self.setitem_slice_assignment(self[index], obj)
* else:
*/
__pyx_t_4 = (__pyx_v_obj != Py_None);
if (__pyx_t_4) {
/* "View.MemoryView":429
* obj = self.is_slice(value)
* if obj is not None:
* self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
* else:
* self.setitem_slice_assign_scalar(self[index], value)
*/
__pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "View.MemoryView":428
* if have_slices:
* obj = self.is_slice(value)
* if obj is not None: # <<<<<<<<<<<<<<
* self.setitem_slice_assignment(self[index], obj)
* else:
*/
goto __pyx_L5;
}
/* "View.MemoryView":431
* self.setitem_slice_assignment(self[index], obj)
* else:
* self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
* else:
* self.setitem_indexed(index, value)
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
__pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L5:;
/* "View.MemoryView":426
* have_slices, index = _unellipsify(index, self.view.ndim)
*
* if have_slices: # <<<<<<<<<<<<<<
* obj = self.is_slice(value)
* if obj is not None:
*/
goto __pyx_L4;
}
/* "View.MemoryView":433
* self.setitem_slice_assign_scalar(self[index], value)
* else:
* self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
*
* cdef is_slice(self, obj):
*/
/*else*/ {
__pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L4:;
/* "View.MemoryView":420
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
* if self.view.readonly:
* raise TypeError, "Cannot assign to read-only memoryview"
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_have_slices);
__Pyx_XDECREF(__pyx_v_obj);
__Pyx_XDECREF(__pyx_v_index);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":435
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
* if not isinstance(obj, memoryview):
* try:
*/
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __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 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
size_t __pyx_t_11;
int __pyx_t_12;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("is_slice", 0);
__Pyx_INCREF(__pyx_v_obj);
/* "View.MemoryView":436
*
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
* try:
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
__pyx_t_2 = (!__pyx_t_1);
if (__pyx_t_2) {
/* "View.MemoryView":437
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
/* "View.MemoryView":438
* if not isinstance(obj, memoryview):
* try:
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
* self.dtype_is_object)
* except TypeError:
*/
__pyx_t_7 = NULL;
__Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
__pyx_t_8 = ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
__pyx_t_9 = __Pyx_PyLong_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 438, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_9);
/* "View.MemoryView":439
* try:
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object) # <<<<<<<<<<<<<<
* except TypeError:
* return None
*/
__pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 439, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = 1;
{
PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_9, __pyx_t_10};
__pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
__Pyx_GOTREF((PyObject *)__pyx_t_6);
}
__Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
__pyx_t_6 = 0;
/* "View.MemoryView":437
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
*/
}
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L9_try_end;
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "View.MemoryView":440
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
__pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_12) {
__Pyx_ErrRestore(0,0,0);
/* "View.MemoryView":441
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
*
* return obj
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L7_except_return;
}
goto __pyx_L6_except_error;
/* "View.MemoryView":437
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
*/
__pyx_L6_except_error:;
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L0;
__pyx_L9_try_end:;
}
/* "View.MemoryView":436
*
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
* try:
* obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
*/
}
/* "View.MemoryView":443
* return None
*
* return obj # <<<<<<<<<<<<<<
*
* cdef setitem_slice_assignment(self, dst, src):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_obj);
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
/* "View.MemoryView":435
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
* if not isinstance(obj, memoryview):
* try:
*/
/* function exit code */
__pyx_L1_error:;
__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_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_obj);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":445
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice dst_slice
* cdef __Pyx_memviewslice src_slice
*/
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
__Pyx_memviewslice __pyx_v_dst_slice;
__Pyx_memviewslice __pyx_v_src_slice;
__Pyx_memviewslice __pyx_v_msrc;
__Pyx_memviewslice __pyx_v_mdst;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_memviewslice *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
/* "View.MemoryView":448
* cdef __Pyx_memviewslice dst_slice
* cdef __Pyx_memviewslice src_slice
* cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
*
*/
if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
__pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 448, __pyx_L1_error)
__pyx_v_msrc = (__pyx_t_1[0]);
/* "View.MemoryView":449
* cdef __Pyx_memviewslice src_slice
* cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
* cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
*
* memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
*/
if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
__pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 449, __pyx_L1_error)
__pyx_v_mdst = (__pyx_t_1[0]);
/* "View.MemoryView":451
* cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
*
* memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
/* "View.MemoryView":445
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice dst_slice
* cdef __Pyx_memviewslice src_slice
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":453
* memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
* cdef int array[128]
* cdef void *tmp = NULL
*/
static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
__Pyx_memviewslice __pyx_v_tmp_slice;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_memviewslice *__pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_t_5;
char const *__pyx_t_6;
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
/* "View.MemoryView":455
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
* cdef void *item
*
*/
__pyx_v_tmp = NULL;
/* "View.MemoryView":460
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
*
* if <size_t>self.view.itemsize > sizeof(array):
*/
__pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 460, __pyx_L1_error)
__pyx_v_dst_slice = __pyx_t_1;
/* "View.MemoryView":462
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL:
*/
__pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
if (__pyx_t_2) {
/* "View.MemoryView":463
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
* if tmp == NULL:
* raise MemoryError
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
/* "View.MemoryView":464
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
* raise MemoryError
* item = tmp
*/
__pyx_t_2 = (__pyx_v_tmp == NULL);
if (unlikely(__pyx_t_2)) {
/* "View.MemoryView":465
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL:
* raise MemoryError # <<<<<<<<<<<<<<
* item = tmp
* else:
*/
PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)
/* "View.MemoryView":464
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
* raise MemoryError
* item = tmp
*/
}
/* "View.MemoryView":466
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
* else:
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
/* "View.MemoryView":462
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL:
*/
goto __pyx_L3;
}
/* "View.MemoryView":468
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
/*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
/* "View.MemoryView":470
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value
*/
/*try:*/ {
/* "View.MemoryView":471
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
* (<PyObject **> item)[0] = <PyObject *> value
* else:
*/
if (__pyx_v_self->dtype_is_object) {
/* "View.MemoryView":472
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
* else:
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
/* "View.MemoryView":471
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
* (<PyObject **> item)[0] = <PyObject *> value
* else:
*/
goto __pyx_L8;
}
/* "View.MemoryView":474
* (<PyObject **> item)[0] = <PyObject *> value
* else:
* self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
*
*
*/
/*else*/ {
__pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L8:;
/* "View.MemoryView":478
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
* assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
* slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
*/
__pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
if (__pyx_t_2) {
/* "View.MemoryView":479
*
* if self.view.suboffsets != NULL:
* assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
* slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
* item, self.dtype_is_object)
*/
__pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)
/* "View.MemoryView":478
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
* assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
* slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
*/
}
/* "View.MemoryView":480
* if self.view.suboffsets != NULL:
* assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
* slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
* item, self.dtype_is_object)
* finally:
*/
__pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
}
/* "View.MemoryView":483
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
*
* cdef setitem_indexed(self, index, value):
*/
/*finally:*/ {
/*normal exit:*/{
PyMem_Free(__pyx_v_tmp);
goto __pyx_L7;
}
__pyx_L6_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
{
PyMem_Free(__pyx_v_tmp);
}
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
__pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
__pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
goto __pyx_L1_error;
}
__pyx_L7:;
}
/* "View.MemoryView":453
* memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
* cdef int array[128]
* cdef void *tmp = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":485
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
* cdef char *itemp = self.get_item_pointer(index)
* self.assign_item_from_object(itemp, value)
*/
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
char *__pyx_v_itemp;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
char *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setitem_indexed", 0);
/* "View.MemoryView":486
*
* cdef setitem_indexed(self, index, value):
* cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
* self.assign_item_from_object(itemp, value)
*
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)0))) __PYX_ERR(1, 486, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
/* "View.MemoryView":487
* cdef setitem_indexed(self, index, value):
* cdef char *itemp = self.get_item_pointer(index)
* self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
*
* cdef convert_item_to_object(self, char *itemp):
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "View.MemoryView":485
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
* cdef char *itemp = self.get_item_pointer(index)
* self.assign_item_from_object(itemp, value)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":489
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
* """Only used if instantiated manually by the user, or if Cython doesn't
* know how to convert the type"""
*/
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
PyObject *__pyx_v_struct = NULL;
PyObject *__pyx_v_bytesitem = 0;
PyObject *__pyx_v_result = 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;
PyObject *__pyx_t_6 = NULL;
size_t __pyx_t_7;
Py_ssize_t __pyx_t_8;
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
int __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("convert_item_to_object", 0);
/* "View.MemoryView":492
* """Only used if instantiated manually by the user, or if Cython doesn't
* know how to convert the type"""
* import struct # <<<<<<<<<<<<<<
* cdef bytes bytesitem
*
*/
__pyx_t_1 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
/* "View.MemoryView":495
* cdef bytes bytesitem
*
* bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
* try:
* result = struct.unpack(self.view.format, bytesitem)
*/
__pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "View.MemoryView":496
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
* result = struct.unpack(self.view.format, bytesitem)
* except struct.error:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
/*try:*/ {
/* "View.MemoryView":497
* bytesitem = itemp[:self.view.itemsize]
* try:
* result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
* except struct.error:
* raise ValueError, "Unable to convert item to object"
*/
__pyx_t_5 = __pyx_v_struct;
__Pyx_INCREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_unpack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_v_result = __pyx_t_1;
__pyx_t_1 = 0;
/* "View.MemoryView":496
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
* result = struct.unpack(self.view.format, bytesitem)
* except struct.error:
*/
}
/* "View.MemoryView":501
* raise ValueError, "Unable to convert item to object"
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
/*else:*/ {
__pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
__pyx_t_9 = (__pyx_t_8 == 1);
if (__pyx_t_9) {
/* "View.MemoryView":502
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
* return result
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L6_except_return;
/* "View.MemoryView":501
* raise ValueError, "Unable to convert item to object"
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
}
/* "View.MemoryView":503
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
*
* cdef assign_item_from_object(self, char *itemp, object value):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "View.MemoryView":498
* try:
* result = struct.unpack(self.view.format, bytesitem)
* except struct.error: # <<<<<<<<<<<<<<
* raise ValueError, "Unable to convert item to object"
* else:
*/
__Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 498, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
__pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
if (__pyx_t_11) {
__Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_1);
/* "View.MemoryView":499
* result = struct.unpack(self.view.format, bytesitem)
* except struct.error:
* raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<<
* else:
* if len(self.view.format) == 1:
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Unable_to_convert_item_to_object, 0, 0);
__PYX_ERR(1, 499, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
/* "View.MemoryView":496
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
* result = struct.unpack(self.view.format, bytesitem)
* except struct.error:
*/
__pyx_L5_except_error:;
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
goto __pyx_L1_error;
__pyx_L6_except_return:;
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
goto __pyx_L0;
}
/* "View.MemoryView":489
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
* """Only used if instantiated manually by the user, or if Cython doesn't
* know how to convert the type"""
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_struct);
__Pyx_XDECREF(__pyx_v_bytesitem);
__Pyx_XDECREF(__pyx_v_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":505
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
* """Only used if instantiated manually by the user, or if Cython doesn't
* know how to convert the type"""
*/
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
PyObject *__pyx_v_struct = NULL;
char __pyx_v_c;
PyObject *__pyx_v_bytesvalue = 0;
Py_ssize_t __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
size_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
char *__pyx_t_9;
char *__pyx_t_10;
Py_ssize_t __pyx_t_11;
char *__pyx_t_12;
char *__pyx_t_13;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
/* "View.MemoryView":508
* """Only used if instantiated manually by the user, or if Cython doesn't
* know how to convert the type"""
* import struct # <<<<<<<<<<<<<<
* cdef char c
* cdef bytes bytesvalue
*/
__pyx_t_1 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
/* "View.MemoryView":513
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
* bytesvalue = struct.pack(self.view.format, *value)
* else:
*/
__pyx_t_2 = PyTuple_Check(__pyx_v_value);
if (__pyx_t_2) {
/* "View.MemoryView":514
*
* if isinstance(value, tuple):
* bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
* else:
* bytesvalue = struct.pack(self.view.format, value)
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __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(1, 514, __pyx_L1_error);
__pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "View.MemoryView":513
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
* bytesvalue = struct.pack(self.view.format, *value)
* else:
*/
goto __pyx_L3;
}
/* "View.MemoryView":516
* bytesvalue = struct.pack(self.view.format, *value)
* else:
* bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
*
* for i, c in enumerate(bytesvalue):
*/
/*else*/ {
__pyx_t_5 = __pyx_v_struct;
__Pyx_INCREF(__pyx_t_5);
__pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pack, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
}
__pyx_L3:;
/* "View.MemoryView":518
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
__pyx_t_7 = 0;
if (unlikely(__pyx_v_bytesvalue == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
__PYX_ERR(1, 518, __pyx_L1_error)
}
__Pyx_INCREF(__pyx_v_bytesvalue);
__pyx_t_8 = __pyx_v_bytesvalue;
__pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_t_8); if (unlikely(__pyx_t_10 == ((char *)NULL))) __PYX_ERR(1, 518, __pyx_L1_error)
__pyx_t_11 = __Pyx_PyBytes_GET_SIZE(__pyx_t_8); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(1, 518, __pyx_L1_error)
__pyx_t_12 = (__pyx_t_10 + __pyx_t_11);
for (__pyx_t_13 = __pyx_t_10; __pyx_t_13 < __pyx_t_12; __pyx_t_13++) {
__pyx_t_9 = __pyx_t_13;
__pyx_v_c = (__pyx_t_9[0]);
/* "View.MemoryView":519
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
__pyx_v_i = __pyx_t_7;
/* "View.MemoryView":518
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
__pyx_t_7 = (__pyx_t_7 + 1);
/* "View.MemoryView":519
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "View.MemoryView":505
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
* """Only used if instantiated manually by the user, or if Cython doesn't
* know how to convert the type"""
*/
/* 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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_struct);
__Pyx_XDECREF(__pyx_v_bytesvalue);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":521
* itemp[i] = c
*
* @cname('getbuffer') # <<<<<<<<<<<<<<
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_WRITABLE and self.view.readonly:
*/
/* Python wrapper */
CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
Py_ssize_t *__pyx_t_3;
char *__pyx_t_4;
void *__pyx_t_5;
int __pyx_t_6;
Py_ssize_t __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
if (unlikely(__pyx_v_info == NULL)) {
PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
return -1;
}
__Pyx_RefNannySetupContext("__getbuffer__", 0);
__pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
__Pyx_GIVEREF(__pyx_v_info->obj);
/* "View.MemoryView":523
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
* raise ValueError, "Cannot create writable memory view from read-only memoryview"
*
*/
__pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_1 = __pyx_v_self->view.readonly;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
/* "View.MemoryView":524
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_WRITABLE and self.view.readonly:
* raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<<
*
* if flags & PyBUF_ND:
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Cannot_create_writable_memory_vi, 0, 0);
__PYX_ERR(1, 524, __pyx_L1_error)
/* "View.MemoryView":523
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
* raise ValueError, "Cannot create writable memory view from read-only memoryview"
*
*/
}
/* "View.MemoryView":526
* raise ValueError, "Cannot create writable memory view from read-only memoryview"
*
* if flags & PyBUF_ND: # <<<<<<<<<<<<<<
* info.shape = self.view.shape
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
if (__pyx_t_1) {
/* "View.MemoryView":527
*
* if flags & PyBUF_ND:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
* else:
* info.shape = NULL
*/
__pyx_t_3 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_3;
/* "View.MemoryView":526
* raise ValueError, "Cannot create writable memory view from read-only memoryview"
*
* if flags & PyBUF_ND: # <<<<<<<<<<<<<<
* info.shape = self.view.shape
* else:
*/
goto __pyx_L6;
}
/* "View.MemoryView":529
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
/*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L6:;
/* "View.MemoryView":531
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
* info.strides = self.view.strides
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
/* "View.MemoryView":532
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
* else:
* info.strides = NULL
*/
__pyx_t_3 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_3;
/* "View.MemoryView":531
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
* info.strides = self.view.strides
* else:
*/
goto __pyx_L7;
}
/* "View.MemoryView":534
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
/*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L7:;
/* "View.MemoryView":536
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
* info.suboffsets = self.view.suboffsets
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
/* "View.MemoryView":537
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
* else:
* info.suboffsets = NULL
*/
__pyx_t_3 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_3;
/* "View.MemoryView":536
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
* info.suboffsets = self.view.suboffsets
* else:
*/
goto __pyx_L8;
}
/* "View.MemoryView":539
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
/*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L8:;
/* "View.MemoryView":541
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
* info.format = self.view.format
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
/* "View.MemoryView":542
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
* else:
* info.format = NULL
*/
__pyx_t_4 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_4;
/* "View.MemoryView":541
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
* info.format = self.view.format
* else:
*/
goto __pyx_L9;
}
/* "View.MemoryView":544
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
/*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L9:;
/* "View.MemoryView":546
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
*/
__pyx_t_5 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_5;
/* "View.MemoryView":547
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
* info.itemsize = self.view.itemsize
* info.len = self.view.len
*/
__pyx_t_6 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_6;
/* "View.MemoryView":548
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
* info.len = self.view.len
* info.readonly = self.view.readonly
*/
__pyx_t_7 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_7;
/* "View.MemoryView":549
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
* info.readonly = self.view.readonly
* info.obj = self
*/
__pyx_t_7 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_7;
/* "View.MemoryView":550
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = self.view.readonly # <<<<<<<<<<<<<<
* info.obj = self
*
*/
__pyx_t_1 = __pyx_v_self->view.readonly;
__pyx_v_info->readonly = __pyx_t_1;
/* "View.MemoryView":551
* info.len = self.view.len
* info.readonly = self.view.readonly
* info.obj = self # <<<<<<<<<<<<<<
*
*
*/
__Pyx_INCREF((PyObject *)__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_v_self);
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
/* "View.MemoryView":521
* itemp[i] = c
*
* @cname('getbuffer') # <<<<<<<<<<<<<<
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_WRITABLE and self.view.readonly:
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
if (__pyx_v_info->obj != NULL) {
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
}
goto __pyx_L2;
__pyx_L0:;
if (__pyx_v_info->obj == Py_None) {
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
}
__pyx_L2:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":554
*
*
* @property # <<<<<<<<<<<<<<
* def T(self):
* cdef _memoryviewslice result = memoryview_copy(self)
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_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_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "View.MemoryView":556
* @property
* def T(self):
* cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
* transpose_memslice(&result.from_slice)
* return result
*/
__pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __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_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
__pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
__pyx_t_1 = 0;
/* "View.MemoryView":557
* def T(self):
* cdef _memoryviewslice result = memoryview_copy(self)
* transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
* return result
*
*/
__pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)
/* "View.MemoryView":558
* cdef _memoryviewslice result = memoryview_copy(self)
* transpose_memslice(&result.from_slice)
* return result # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF((PyObject *)__pyx_v_result);
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "View.MemoryView":554
*
*
* @property # <<<<<<<<<<<<<<
* def T(self):
* cdef _memoryviewslice result = memoryview_copy(self)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":560
* return result
*
* @property # <<<<<<<<<<<<<<
* def base(self):
* return self._get_base()
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_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_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__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);
/* "View.MemoryView":562
* @property
* def base(self):
* return self._get_base() # <<<<<<<<<<<<<<
*
* cdef _get_base(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "View.MemoryView":560
* return result
*
* @property # <<<<<<<<<<<<<<
* def base(self):
* return self._get_base()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":564
* return self._get_base()
*
* cdef _get_base(self): # <<<<<<<<<<<<<<
* return self.obj
*
*/
static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_get_base", 0);
/* "View.MemoryView":565
*
* cdef _get_base(self):
* return self.obj # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->obj);
__pyx_r = __pyx_v_self->obj;
goto __pyx_L0;
/* "View.MemoryView":564
* return self._get_base()
*
* cdef _get_base(self): # <<<<<<<<<<<<<<
* return self.obj
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":567
* return self.obj
*
* @property # <<<<<<<<<<<<<<
* def shape(self):
* return tuple([length for length in self.view.shape[:self.view.ndim]])
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_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_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
Py_ssize_t __pyx_7genexpr__pyx_v_length;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t *__pyx_t_2;
Py_ssize_t *__pyx_t_3;
Py_ssize_t *__pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "View.MemoryView":569
* @property
* def shape(self):
* return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
{ /* enter inner scope */
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
__pyx_t_2 = __pyx_t_4;
__pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
__pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
} /* exit inner scope */
__pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "View.MemoryView":567
* return self.obj
*
* @property # <<<<<<<<<<<<<<
* def shape(self):
* return tuple([length for length in self.view.shape[:self.view.ndim]])
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":571
* return tuple([length for length in self.view.shape[:self.view.ndim]])
*
* @property # <<<<<<<<<<<<<<
* def strides(self):
* if self.view.strides == NULL:
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_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_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t *__pyx_t_3;
Py_ssize_t *__pyx_t_4;
Py_ssize_t *__pyx_t_5;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "View.MemoryView":573
* @property
* def strides(self):
* if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
* raise ValueError, "Buffer view does not expose strides"
*/
__pyx_t_1 = (__pyx_v_self->view.strides == NULL);
if (unlikely(__pyx_t_1)) {
/* "View.MemoryView":575
* if self.view.strides == NULL:
*
* raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<<
*
* return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Buffer_view_does_not_expose_stri, 0, 0);
__PYX_ERR(1, 575, __pyx_L1_error)
/* "View.MemoryView":573
* @property
* def strides(self):
* if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
* raise ValueError, "Buffer view does not expose strides"
*/
}
/* "View.MemoryView":577
* raise ValueError, "Buffer view does not expose strides"
*
* return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
{ /* enter inner scope */
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
__pyx_t_3 = __pyx_t_5;
__pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
__pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
} /* exit inner scope */
__pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "View.MemoryView":571
* return tuple([length for length in self.view.shape[:self.view.ndim]])
*
* @property # <<<<<<<<<<<<<<
* def strides(self):
* if self.view.strides == NULL:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":579
* return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*
* @property # <<<<<<<<<<<<<<
* def suboffsets(self):
* if self.view.suboffsets == NULL:
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_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_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t *__pyx_t_3;
Py_ssize_t *__pyx_t_4;
Py_ssize_t *__pyx_t_5;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "View.MemoryView":581
* @property
* def suboffsets(self):
* if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
* return (-1,) * self.view.ndim
*
*/
__pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
if (__pyx_t_1) {
/* "View.MemoryView":582
* def suboffsets(self):
* if self.view.suboffsets == NULL:
* return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
* return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[0], __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":581
* @property
* def suboffsets(self):
* if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
* return (-1,) * self.view.ndim
*
*/
}
/* "View.MemoryView":584
* return (-1,) * self.view.ndim
*
* return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
{ /* enter inner scope */
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
__pyx_t_3 = __pyx_t_5;
__pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
__pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
} /* exit inner scope */
__pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "View.MemoryView":579
* return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*
* @property # <<<<<<<<<<<<<<
* def suboffsets(self):
* if self.view.suboffsets == NULL:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":586
* return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
*
* @property # <<<<<<<<<<<<<<
* def ndim(self):
* return self.view.ndim
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_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_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__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);
/* "View.MemoryView":588
* @property
* def ndim(self):
* return self.view.ndim # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "View.MemoryView":586
* return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
*
* @property # <<<<<<<<<<<<<<
* def ndim(self):
* return self.view.ndim
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":590
* return self.view.ndim
*
* @property # <<<<<<<<<<<<<<
* def itemsize(self):
* return self.view.itemsize
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_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_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__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);
/* "View.MemoryView":592
* @property
* def itemsize(self):
* return self.view.itemsize # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "View.MemoryView":590
* return self.view.ndim
*
* @property # <<<<<<<<<<<<<<
* def itemsize(self):
* return self.view.itemsize
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":594
* return self.view.itemsize
*
* @property # <<<<<<<<<<<<<<
* def nbytes(self):
* return self.size * self.view.itemsize
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_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_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "View.MemoryView":596
* @property
* def nbytes(self):
* return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "View.MemoryView":594
* return self.view.itemsize
*
* @property # <<<<<<<<<<<<<<
* def nbytes(self):
* return self.size * self.view.itemsize
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":598
* return self.size * self.view.itemsize
*
* @property # <<<<<<<<<<<<<<
* def size(self):
* if self._size is None:
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_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_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
PyObject *__pyx_v_result = NULL;
PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
Py_ssize_t *__pyx_t_2;
Py_ssize_t *__pyx_t_3;
Py_ssize_t *__pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "View.MemoryView":600
* @property
* def size(self):
* if self._size is None: # <<<<<<<<<<<<<<
* result = 1
*
*/
__pyx_t_1 = (__pyx_v_self->_size == Py_None);
if (__pyx_t_1) {
/* "View.MemoryView":601
* def size(self):
* if self._size is None:
* result = 1 # <<<<<<<<<<<<<<
*
* for length in self.view.shape[:self.view.ndim]:
*/
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
__pyx_v_result = __pyx_mstate_global->__pyx_int_1;
/* "View.MemoryView":603
* result = 1
*
* for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
* result *= length
*
*/
__pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
__pyx_t_2 = __pyx_t_4;
__pyx_t_5 = PyLong_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
__pyx_t_5 = 0;
/* "View.MemoryView":604
*
* for length in self.view.shape[:self.view.ndim]:
* result *= length # <<<<<<<<<<<<<<
*
* self._size = result
*/
__pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
__pyx_t_5 = 0;
}
/* "View.MemoryView":606
* result *= length
*
* self._size = result # <<<<<<<<<<<<<<
*
* return self._size
*/
__Pyx_INCREF(__pyx_v_result);
__Pyx_GIVEREF(__pyx_v_result);
__Pyx_GOTREF(__pyx_v_self->_size);
__Pyx_DECREF(__pyx_v_self->_size);
__pyx_v_self->_size = __pyx_v_result;
/* "View.MemoryView":600
* @property
* def size(self):
* if self._size is None: # <<<<<<<<<<<<<<
* result = 1
*
*/
}
/* "View.MemoryView":608
* self._size = result
*
* return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_size);
__pyx_r = __pyx_v_self->_size;
goto __pyx_L0;
/* "View.MemoryView":598
* return self.size * self.view.itemsize
*
* @property # <<<<<<<<<<<<<<
* def size(self):
* if self._size is None:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_result);
__Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":610
* return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
* return self.view.shape[0]
*/
/* Python wrapper */
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
Py_ssize_t __pyx_r;
int __pyx_t_1;
/* "View.MemoryView":611
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
* return self.view.shape[0]
*
*/
__pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
if (__pyx_t_1) {
/* "View.MemoryView":612
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
*
* return 0
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
/* "View.MemoryView":611
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
* return self.view.shape[0]
*
*/
}
/* "View.MemoryView":614
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__pyx_r = 0;
goto __pyx_L0;
/* "View.MemoryView":610
* return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
* return self.view.shape[0]
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":616
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
* id(self))
*/
/* Python wrapper */
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
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[5];
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "View.MemoryView":617
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
* id(self))
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "View.MemoryView":618
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
* id(self)) # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
__pyx_t_4[1] = __pyx_t_2;
__pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
__pyx_t_4[3] = __pyx_t_3;
__pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__3;
/* "View.MemoryView":617
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
* id(self))
*
*/
__pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "View.MemoryView":616
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
* id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":620
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
*
*/
/* Python wrapper */
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3[3];
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
/* "View.MemoryView":621
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
__pyx_t_3[1] = __pyx_t_2;
__pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object;
__pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __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;
/* "View.MemoryView":620
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":624
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
*/
/* Python wrapper */
static PyObject *__pyx_memoryview_is_c_contig(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 PyObject *__pyx_memoryview_is_c_contig(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("is_c_contig (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("is_c_contig", 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("is_c_contig", __pyx_kwds); return NULL;}
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
__Pyx_memviewslice *__pyx_v_mslice;
__Pyx_memviewslice __pyx_v_tmp;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_memviewslice *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("is_c_contig", 0);
/* "View.MemoryView":627
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
* return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 627, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
/* "View.MemoryView":628
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
* return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
*
* def is_f_contig(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":624
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":630
* return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
*/
/* Python wrapper */
static PyObject *__pyx_memoryview_is_f_contig(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 PyObject *__pyx_memoryview_is_f_contig(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("is_f_contig (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("is_f_contig", 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("is_f_contig", __pyx_kwds); return NULL;}
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
__Pyx_memviewslice *__pyx_v_mslice;
__Pyx_memviewslice __pyx_v_tmp;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_memviewslice *__pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("is_f_contig", 0);
/* "View.MemoryView":633
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
* return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)0))) __PYX_ERR(1, 633, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
/* "View.MemoryView":634
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
* return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
*
* def copy(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":630
* return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":636
* return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*/
/* Python wrapper */
static PyObject *__pyx_memoryview_copy(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 PyObject *__pyx_memoryview_copy(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("copy (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("copy", 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("copy", __pyx_kwds); return NULL;}
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
__Pyx_memviewslice __pyx_v_mslice;
int __pyx_v_flags;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_memviewslice __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
/* "View.MemoryView":638
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
*
* slice_copy(self, &mslice)
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
/* "View.MemoryView":640
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
* mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
* self.view.itemsize,
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
/* "View.MemoryView":641
*
* slice_copy(self, &mslice)
* mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
* self.view.itemsize,
* flags|PyBUF_C_CONTIGUOUS,
*/
__pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char const *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
/* "View.MemoryView":646
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
*
* def copy_fortran(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":636
* return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":648
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*/
/* Python wrapper */
static PyObject *__pyx_memoryview_copy_fortran(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 PyObject *__pyx_memoryview_copy_fortran(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("copy_fortran (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("copy_fortran", 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("copy_fortran", __pyx_kwds); return NULL;}
__pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
__Pyx_memviewslice __pyx_v_src;
__Pyx_memviewslice __pyx_v_dst;
int __pyx_v_flags;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_memviewslice __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy_fortran", 0);
/* "View.MemoryView":650
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
*
* slice_copy(self, &src)
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
/* "View.MemoryView":652
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
* dst = slice_copy_contig(&src, "fortran", self.view.ndim,
* self.view.itemsize,
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
/* "View.MemoryView":653
*
* slice_copy(self, &src)
* dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
* self.view.itemsize,
* flags|PyBUF_F_CONTIGUOUS,
*/
__pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char const *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
/* "View.MemoryView":658
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":648
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__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___pyx_memoryview_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 PyObject *__pyx_pw___pyx_memoryview_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___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__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(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(1, 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("View.MemoryView.memoryview.__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___pyx_memoryview_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 PyObject *__pyx_pw___pyx_memoryview_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
) {
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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__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___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__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(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(1, 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("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":661
*
*
* @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
*/
static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo const *__pyx_v_typeinfo) {
struct __pyx_memoryview_obj *__pyx_v_result = 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
/* "View.MemoryView":663
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
* cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
* result.typeinfo = typeinfo
* return result
*/
__pyx_t_2 = NULL;
__Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
__pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
__pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_4, __pyx_t_5};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_1);
}
__pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
__pyx_t_1 = 0;
/* "View.MemoryView":664
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo # <<<<<<<<<<<<<<
* return result
*
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
/* "View.MemoryView":665
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_check')
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF((PyObject *)__pyx_v_result);
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "View.MemoryView":661
*
*
* @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
*/
/* 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_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":667
* return result
*
* @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;
/* "View.MemoryView":669
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o) noexcept:
* return isinstance(o, memoryview) # <<<<<<<<<<<<<<
*
* cdef tuple _unellipsify(object index, int ndim):
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
/* "View.MemoryView":667
* return result
*
* @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
* cdef inline bint memoryview_check(object o) noexcept:
* return isinstance(o, memoryview)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":671
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
* """
* Replace all ellipses with full slices and fill incomplete indices with
*/
static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
Py_ssize_t __pyx_v_idx;
PyObject *__pyx_v_tup = NULL;
PyObject *__pyx_v_result = NULL;
int __pyx_v_have_slices;
int __pyx_v_seen_ellipsis;
PyObject *__pyx_v_item = NULL;
Py_ssize_t __pyx_v_nslices;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
PyObject *__pyx_t_6[3];
PyObject *__pyx_t_7 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_unellipsify", 0);
/* "View.MemoryView":677
* """
* cdef Py_ssize_t idx
* tup = <tuple>index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<<
*
* result = [slice(None)] * ndim
*/
__pyx_t_2 = PyTuple_Check(__pyx_v_index);
if (__pyx_t_2) {
__Pyx_INCREF(((PyObject*)__pyx_v_index));
__pyx_t_1 = __pyx_v_index;
} else {
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_index);
__Pyx_GIVEREF(__pyx_v_index);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 677, __pyx_L1_error);
__pyx_t_1 = __pyx_t_3;
__pyx_t_3 = 0;
}
__pyx_v_tup = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "View.MemoryView":679
* tup = <tuple>index if isinstance(index, tuple) else (index,)
*
* result = [slice(None)] * ndim # <<<<<<<<<<<<<<
* have_slices = False
* seen_ellipsis = False
*/
__pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
{ Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
__Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 679, __pyx_L1_error);
}
}
__pyx_v_result = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "View.MemoryView":680
*
* result = [slice(None)] * ndim
* have_slices = False # <<<<<<<<<<<<<<
* seen_ellipsis = False
* idx = 0
*/
__pyx_v_have_slices = 0;
/* "View.MemoryView":681
* result = [slice(None)] * ndim
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
* idx = 0
* for item in tup:
*/
__pyx_v_seen_ellipsis = 0;
/* "View.MemoryView":682
* have_slices = False
* seen_ellipsis = False
* idx = 0 # <<<<<<<<<<<<<<
* for item in tup:
* if item is Ellipsis:
*/
__pyx_v_idx = 0;
/* "View.MemoryView":683
* seen_ellipsis = False
* idx = 0
* for item in tup: # <<<<<<<<<<<<<<
* if item is Ellipsis:
* if not seen_ellipsis:
*/
if (unlikely(__pyx_v_tup == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(1, 683, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = 0;
for (;;) {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
#endif
if (__pyx_t_4 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4));
#else
__pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4);
#endif
++__pyx_t_4;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
__pyx_t_3 = 0;
/* "View.MemoryView":684
* idx = 0
* for item in tup:
* if item is Ellipsis: # <<<<<<<<<<<<<<
* if not seen_ellipsis:
* idx += ndim - len(tup)
*/
__pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
if (__pyx_t_2) {
/* "View.MemoryView":685
* for item in tup:
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
* idx += ndim - len(tup)
* seen_ellipsis = True
*/
__pyx_t_2 = (!__pyx_v_seen_ellipsis);
if (__pyx_t_2) {
/* "View.MemoryView":686
* if item is Ellipsis:
* if not seen_ellipsis:
* idx += ndim - len(tup) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* have_slices = True
*/
if (unlikely(__pyx_v_tup == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 686, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
__pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));
/* "View.MemoryView":687
* if not seen_ellipsis:
* idx += ndim - len(tup)
* seen_ellipsis = True # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
__pyx_v_seen_ellipsis = 1;
/* "View.MemoryView":685
* for item in tup:
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
* idx += ndim - len(tup)
* seen_ellipsis = True
*/
}
/* "View.MemoryView":688
* idx += ndim - len(tup)
* seen_ellipsis = True
* have_slices = True # <<<<<<<<<<<<<<
* else:
* if isinstance(item, slice):
*/
__pyx_v_have_slices = 1;
/* "View.MemoryView":684
* idx = 0
* for item in tup:
* if item is Ellipsis: # <<<<<<<<<<<<<<
* if not seen_ellipsis:
* idx += ndim - len(tup)
*/
goto __pyx_L5;
}
/* "View.MemoryView":690
* have_slices = True
* else:
* if isinstance(item, slice): # <<<<<<<<<<<<<<
* have_slices = True
* elif not PyIndex_Check(item):
*/
/*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
if (__pyx_t_2) {
/* "View.MemoryView":691
* else:
* if isinstance(item, slice):
* have_slices = True # <<<<<<<<<<<<<<
* elif not PyIndex_Check(item):
* raise TypeError, f"Cannot index with type '{type(item)}'"
*/
__pyx_v_have_slices = 1;
/* "View.MemoryView":690
* have_slices = True
* else:
* if isinstance(item, slice): # <<<<<<<<<<<<<<
* have_slices = True
* elif not PyIndex_Check(item):
*/
goto __pyx_L7;
}
/* "View.MemoryView":692
* if isinstance(item, slice):
* have_slices = True
* elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError, f"Cannot index with type '{type(item)}'"
* result[idx] = item
*/
__pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
if (unlikely(__pyx_t_2)) {
/* "View.MemoryView":693
* have_slices = True
* elif not PyIndex_Check(item):
* raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<<
* result[idx] = item
* idx += 1
*/
__pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type;
__pyx_t_6[1] = __pyx_t_3;
__pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__4;
__pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__PYX_ERR(1, 693, __pyx_L1_error)
/* "View.MemoryView":692
* if isinstance(item, slice):
* have_slices = True
* elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError, f"Cannot index with type '{type(item)}'"
* result[idx] = item
*/
}
__pyx_L7:;
/* "View.MemoryView":694
* elif not PyIndex_Check(item):
* raise TypeError, f"Cannot index with type '{type(item)}'"
* result[idx] = item # <<<<<<<<<<<<<<
* idx += 1
*
*/
if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
}
__pyx_L5:;
/* "View.MemoryView":695
* raise TypeError, f"Cannot index with type '{type(item)}'"
* result[idx] = item
* idx += 1 # <<<<<<<<<<<<<<
*
* nslices = ndim - idx
*/
__pyx_v_idx = (__pyx_v_idx + 1);
/* "View.MemoryView":683
* seen_ellipsis = False
* idx = 0
* for item in tup: # <<<<<<<<<<<<<<
* if item is Ellipsis:
* if not seen_ellipsis:
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "View.MemoryView":697
* idx += 1
*
* nslices = ndim - idx # <<<<<<<<<<<<<<
* return have_slices or nslices, tuple(result)
*
*/
__pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);
/* "View.MemoryView":698
*
* nslices = ndim - idx
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
*
* cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
*/
__Pyx_XDECREF(__pyx_r);
if (!__pyx_v_have_slices) {
} else {
__pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_7 = PyLong_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = __pyx_t_7;
__pyx_t_7 = 0;
__pyx_L9_bool_binop_done:;
__pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __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(1, 698, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_7);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7) != (0)) __PYX_ERR(1, 698, __pyx_L1_error);
__pyx_t_1 = 0;
__pyx_t_7 = 0;
__pyx_r = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
/* "View.MemoryView":671
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
* """
* Replace all ellipses with full slices and fill incomplete indices with
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tup);
__Pyx_XDECREF(__pyx_v_result);
__Pyx_XDECREF(__pyx_v_item);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":700
* return have_slices or nslices, tuple(result)
*
* cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
* for suboffset in suboffsets[:ndim]:
* if suboffset >= 0:
*/
static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
Py_ssize_t __pyx_v_suboffset;
int __pyx_r;
Py_ssize_t *__pyx_t_1;
Py_ssize_t *__pyx_t_2;
Py_ssize_t *__pyx_t_3;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* "View.MemoryView":701
*
* cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
* for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
* if suboffset >= 0:
* raise ValueError, "Indirect dimensions not supported"
*/
__pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
__pyx_t_1 = __pyx_t_3;
__pyx_v_suboffset = (__pyx_t_1[0]);
/* "View.MemoryView":702
* cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
* for suboffset in suboffsets[:ndim]:
* if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError, "Indirect dimensions not supported"
* return 0 # return type just used as an error flag
*/
__pyx_t_4 = (__pyx_v_suboffset >= 0);
if (unlikely(__pyx_t_4)) {
/* "View.MemoryView":703
* for suboffset in suboffsets[:ndim]:
* if suboffset >= 0:
* raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<<
* return 0 # return type just used as an error flag
*
*/
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_kp_u_Indirect_dimensions_not_supporte, 0, 0);
__PYX_ERR(1, 703, __pyx_L1_error)
/* "View.MemoryView":702
* cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
* for suboffset in suboffsets[:ndim]:
* if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError, "Indirect dimensions not supported"
* return 0 # return type just used as an error flag
*/
}
}
/* "View.MemoryView":704
* if suboffset >= 0:
* raise ValueError, "Indirect dimensions not supported"
* return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = 0;
goto __pyx_L0;
/* "View.MemoryView":700
* return have_slices or nslices, tuple(result)
*
* cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
* for suboffset in suboffsets[:ndim]:
* if suboffset >= 0:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":710
*
*
* @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim
*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
int __pyx_v_new_ndim;
int __pyx_v_suboffset_dim;
int __pyx_v_dim;
__Pyx_memviewslice __pyx_v_src;
__Pyx_memviewslice __pyx_v_dst;
__Pyx_memviewslice *__pyx_v_p_src;
struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
__Pyx_memviewslice *__pyx_v_p_dst;
int *__pyx_v_p_suboffset_dim;
Py_ssize_t __pyx_v_start;
Py_ssize_t __pyx_v_stop;
Py_ssize_t __pyx_v_step;
Py_ssize_t __pyx_v_cindex;
int __pyx_v_have_start;
int __pyx_v_have_stop;
int __pyx_v_have_step;
PyObject *__pyx_v_index = NULL;
struct __pyx_memoryview_obj *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
struct __pyx_memoryview_obj *__pyx_t_3;
char *__pyx_t_4;
int __pyx_t_5;
Py_ssize_t __pyx_t_6;
PyObject *(*__pyx_t_7)(PyObject *);
PyObject *__pyx_t_8 = NULL;
Py_ssize_t __pyx_t_9;
int __pyx_t_10;
Py_ssize_t __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("memview_slice", 0);
/* "View.MemoryView":712
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
* cdef bint negative_step
* cdef __Pyx_memviewslice src, dst
*/
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
/* "View.MemoryView":719
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
*
* cdef _memoryviewslice memviewsliceobj
*/
(void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
/* "View.MemoryView":723
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
*
* if isinstance(memview, _memoryviewslice):
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(__pyx_assertions_enabled())) {
__pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
if (unlikely(!__pyx_t_1)) {
__Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
__PYX_ERR(1, 723, __pyx_L1_error)
}
}
#else
if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
#endif
/* "View.MemoryView":725
* assert memview.view.ndim > 0
*
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice
*/
__pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
if (__pyx_t_1) {
/* "View.MemoryView":726
*
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview # <<<<<<<<<<<<<<
* p_src = &memviewsliceobj.from_slice
* else:
*/
__pyx_t_2 = ((PyObject *)__pyx_v_memview);
__Pyx_INCREF(__pyx_t_2);
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
__pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
__pyx_t_2 = 0;
/* "View.MemoryView":727
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
* else:
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
/* "View.MemoryView":725
* assert memview.view.ndim > 0
*
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice
*/
goto __pyx_L3;
}
/* "View.MemoryView":729
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
/*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
/* "View.MemoryView":730
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_p_src = (&__pyx_v_src);
}
__pyx_L3:;
/* "View.MemoryView":736
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
* dst.data = p_src.data
*
*/
__pyx_t_3 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_3;
/* "View.MemoryView":737
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_4 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_4;
/* "View.MemoryView":742
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
* cdef int *p_suboffset_dim = &suboffset_dim
* cdef Py_ssize_t start, stop, step, cindex
*/
__pyx_v_p_dst = (&__pyx_v_dst);
/* "View.MemoryView":743
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
* cdef Py_ssize_t start, stop, step, cindex
* cdef bint have_start, have_stop, have_step
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
/* "View.MemoryView":747
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
* if PyIndex_Check(index):
* cindex = index
*/
__pyx_t_5 = 0;
if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
__pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
__pyx_t_6 = 0;
__pyx_t_7 = NULL;
} else {
__pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_7)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
#endif
if (__pyx_t_6 >= __pyx_temp) break;
}
__pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6);
++__pyx_t_6;
} else {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
#endif
if (__pyx_t_6 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
#else
__pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
#endif
++__pyx_t_6;
}
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
} else {
__pyx_t_8 = __pyx_t_7(__pyx_t_2);
if (unlikely(!__pyx_t_8)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 747, __pyx_L1_error)
PyErr_Clear();
}
break;
}
}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
__pyx_t_8 = 0;
__pyx_v_dim = __pyx_t_5;
__pyx_t_5 = (__pyx_t_5 + 1);
/* "View.MemoryView":748
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
* cindex = index
* slice_memviewslice(
*/
__pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_1) {
/* "View.MemoryView":749
* for dim, index in enumerate(indices):
* if PyIndex_Check(index):
* cindex = index # <<<<<<<<<<<<<<
* slice_memviewslice(
* p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
*/
__pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
__pyx_v_cindex = __pyx_t_9;
/* "View.MemoryView":750
* if PyIndex_Check(index):
* cindex = index
* slice_memviewslice( # <<<<<<<<<<<<<<
* p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
* dim, new_ndim, p_suboffset_dim,
*/
__pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
/* "View.MemoryView":748
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
* cindex = index
* slice_memviewslice(
*/
goto __pyx_L6;
}
/* "View.MemoryView":756
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0
*/
__pyx_t_1 = (__pyx_v_index == Py_None);
if (__pyx_t_1) {
/* "View.MemoryView":757
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
/* "View.MemoryView":758
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
/* "View.MemoryView":759
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
* new_ndim += 1
* else:
*/
(__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
/* "View.MemoryView":760
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
* else:
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
/* "View.MemoryView":756
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0
*/
goto __pyx_L6;
}
/* "View.MemoryView":762
* new_ndim += 1
* else:
* start = index.start or 0 # <<<<<<<<<<<<<<
* stop = index.stop or 0
* step = index.step or 0
*/
/*else*/ {
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
if (!__pyx_t_1) {
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
__pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
__pyx_t_9 = __pyx_t_11;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L7_bool_binop_done;
}
__pyx_t_9 = 0;
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_9;
/* "View.MemoryView":763
* else:
* start = index.start or 0
* stop = index.stop or 0 # <<<<<<<<<<<<<<
* step = index.step or 0
*
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
if (!__pyx_t_1) {
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
__pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
__pyx_t_9 = __pyx_t_11;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_9 = 0;
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_9;
/* "View.MemoryView":764
* start = index.start or 0
* stop = index.stop or 0
* step = index.step or 0 # <<<<<<<<<<<<<<
*
* have_start = index.start is not None
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
if (!__pyx_t_1) {
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
__pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
__pyx_t_9 = __pyx_t_11;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L11_bool_binop_done;
}
__pyx_t_9 = 0;
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_9;
/* "View.MemoryView":766
* step = index.step or 0
*
* have_start = index.start is not None # <<<<<<<<<<<<<<
* have_stop = index.stop is not None
* have_step = index.step is not None
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_1 = (__pyx_t_8 != Py_None);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_have_start = __pyx_t_1;
/* "View.MemoryView":767
*
* have_start = index.start is not None
* have_stop = index.stop is not None # <<<<<<<<<<<<<<
* have_step = index.step is not None
*
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_1 = (__pyx_t_8 != Py_None);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_have_stop = __pyx_t_1;
/* "View.MemoryView":768
* have_start = index.start is not None
* have_stop = index.stop is not None
* have_step = index.step is not None # <<<<<<<<<<<<<<
*
* slice_memviewslice(
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_1 = (__pyx_t_8 != Py_None);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_have_step = __pyx_t_1;
/* "View.MemoryView":770
* have_step = index.step is not None
*
* slice_memviewslice( # <<<<<<<<<<<<<<
* p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
* dim, new_ndim, p_suboffset_dim,
*/
__pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
/* "View.MemoryView":776
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
*
* if isinstance(memview, _memoryviewslice):
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
}
__pyx_L6:;
/* "View.MemoryView":747
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
* if PyIndex_Check(index):
* cindex = index
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "View.MemoryView":778
* new_ndim += 1
*
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
* return memoryview_fromslice(dst, new_ndim,
* memviewsliceobj.to_object_func,
*/
__pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
if (__pyx_t_1) {
/* "View.MemoryView":779
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
* memviewsliceobj.to_object_func,
* memviewsliceobj.to_dtype_func,
*/
__Pyx_XDECREF((PyObject *)__pyx_r);
/* "View.MemoryView":780
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim,
* memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
* memviewsliceobj.to_dtype_func,
* memview.dtype_is_object)
*/
if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
/* "View.MemoryView":781
* return memoryview_fromslice(dst, new_ndim,
* memviewsliceobj.to_object_func,
* memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
* else:
*/
if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
/* "View.MemoryView":779
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
* memviewsliceobj.to_object_func,
* memviewsliceobj.to_dtype_func,
*/
__pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __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_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":778
* new_ndim += 1
*
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
* return memoryview_fromslice(dst, new_ndim,
* memviewsliceobj.to_object_func,
*/
}
/* "View.MemoryView":784
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
/*else*/ {
__Pyx_XDECREF((PyObject *)__pyx_r);
/* "View.MemoryView":785
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL,
* memview.dtype_is_object) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "View.MemoryView":784
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "View.MemoryView":710
*
*
* @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
__Pyx_XDECREF(__pyx_v_index);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":792
*
*
* @cname('__pyx_memoryview_slice_memviewslice') # <<<<<<<<<<<<<<
* cdef int slice_memviewslice(
* __Pyx_memviewslice *dst,
*/
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
Py_ssize_t __pyx_v_new_shape;
int __pyx_v_negative_step;
int __pyx_r;
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyGILState_STATE __pyx_gilstate_save;
/* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
*
* if start < 0:
*/
__pyx_t_1 = (!__pyx_v_is_slice);
if (__pyx_t_1) {
/* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
* start += shape
* if not 0 <= start < shape:
*/
__pyx_t_1 = (__pyx_v_start < 0);
if (__pyx_t_1) {
/* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
* if not 0 <= start < shape:
* _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
/* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
* start += shape
* if not 0 <= start < shape:
*/
}
/* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
* _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
* else:
*/
__pyx_t_1 = (0 <= __pyx_v_start);
if (__pyx_t_1) {
__pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
}
__pyx_t_2 = (!__pyx_t_1);
if (__pyx_t_2) {
/* "View.MemoryView":818
* start += shape
* if not 0 <= start < shape:
* _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
* else:
*
*/
__pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_mstate_global->__pyx_kp_u_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)
/* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
* _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
* else:
*/
}
/* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
*
* if start < 0:
*/
goto __pyx_L3;
}
/* "View.MemoryView":821
* else:
*
* if have_step: # <<<<<<<<<<<<<<
* negative_step = step < 0
* if step == 0:
*/
/*else*/ {
__pyx_t_2 = (__pyx_v_have_step != 0);
if (__pyx_t_2) {
/* "View.MemoryView":822
*
* if have_step:
* negative_step = step < 0 # <<<<<<<<<<<<<<
* if step == 0:
* _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
*/
__pyx_v_negative_step = (__pyx_v_step < 0);
/* "View.MemoryView":823
* if have_step:
* negative_step = step < 0
* if step == 0: # <<<<<<<<<<<<<<
* _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
* else:
*/
__pyx_t_2 = (__pyx_v_step == 0);
if (__pyx_t_2) {
/* "View.MemoryView":824
* negative_step = step < 0
* if step == 0:
* _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
* else:
* negative_step = False
*/
__pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_mstate_global->__pyx_kp_u_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)
/* "View.MemoryView":823
* if have_step:
* negative_step = step < 0
* if step == 0: # <<<<<<<<<<<<<<
* _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
* else:
*/
}
/* "View.MemoryView":821
* else:
*
* if have_step: # <<<<<<<<<<<<<<
* negative_step = step < 0
* if step == 0:
*/
goto __pyx_L6;
}
/* "View.MemoryView":826
* _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
* else:
* negative_step = False # <<<<<<<<<<<<<<
* step = 1
*
*/
/*else*/ {
__pyx_v_negative_step = 0;
/* "View.MemoryView":827
* else:
* negative_step = False
* step = 1 # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_step = 1;
}
__pyx_L6:;
/* "View.MemoryView":830
*
*
* if have_start: # <<<<<<<<<<<<<<
* if start < 0:
* start += shape
*/
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
/* "View.MemoryView":831
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
* start += shape
* if start < 0:
*/
__pyx_t_2 = (__pyx_v_start < 0);
if (__pyx_t_2) {
/* "View.MemoryView":832
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
* if start < 0:
* start = 0
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
/* "View.MemoryView":833
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
* start = 0
* elif start >= shape:
*/
__pyx_t_2 = (__pyx_v_start < 0);
if (__pyx_t_2) {
/* "View.MemoryView":834
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
* elif start >= shape:
* if negative_step:
*/
__pyx_v_start = 0;
/* "View.MemoryView":833
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
* start = 0
* elif start >= shape:
*/
}
/* "View.MemoryView":831
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
* start += shape
* if start < 0:
*/
goto __pyx_L9;
}
/* "View.MemoryView":835
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
* if negative_step:
* start = shape - 1
*/
__pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
if (__pyx_t_2) {
/* "View.MemoryView":836
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
if (__pyx_v_negative_step) {
/* "View.MemoryView":837
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
* else:
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
/* "View.MemoryView":836
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
goto __pyx_L11;
}
/* "View.MemoryView":839
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
/*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L11:;
/* "View.MemoryView":835
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
* if negative_step:
* start = shape - 1
*/
}
__pyx_L9:;
/* "View.MemoryView":830
*
*
* if have_start: # <<<<<<<<<<<<<<
* if start < 0:
* start += shape
*/
goto __pyx_L8;
}
/* "View.MemoryView":841
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
/*else*/ {
if (__pyx_v_negative_step) {
/* "View.MemoryView":842
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
* else:
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
/* "View.MemoryView":841
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
goto __pyx_L12;
}
/* "View.MemoryView":844
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
/*else*/ {
__pyx_v_start = 0;
}
__pyx_L12:;
}
__pyx_L8:;
/* "View.MemoryView":846
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
* if stop < 0:
* stop += shape
*/
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
/* "View.MemoryView":847
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
* stop += shape
* if stop < 0:
*/
__pyx_t_2 = (__pyx_v_stop < 0);
if (__pyx_t_2) {
/* "View.MemoryView":848
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
* if stop < 0:
* stop = 0
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
/* "View.MemoryView":849
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
* stop = 0
* elif stop > shape:
*/
__pyx_t_2 = (__pyx_v_stop < 0);
if (__pyx_t_2) {
/* "View.MemoryView":850
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
* elif stop > shape:
* stop = shape
*/
__pyx_v_stop = 0;
/* "View.MemoryView":849
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
* stop = 0
* elif stop > shape:
*/
}
/* "View.MemoryView":847
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
* stop += shape
* if stop < 0:
*/
goto __pyx_L14;
}
/* "View.MemoryView":851
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
* stop = shape
* else:
*/
__pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
if (__pyx_t_2) {
/* "View.MemoryView":852
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
/* "View.MemoryView":851
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
* stop = shape
* else:
*/
}
__pyx_L14:;
/* "View.MemoryView":846
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
* if stop < 0:
* stop += shape
*/
goto __pyx_L13;
}
/* "View.MemoryView":854
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
/*else*/ {
if (__pyx_v_negative_step) {
/* "View.MemoryView":855
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
__pyx_v_stop = -1L;
/* "View.MemoryView":854
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
goto __pyx_L16;
}
/* "View.MemoryView":857
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
*
*/
/*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L16:;
}
__pyx_L13:;
/* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
*
* if (stop - start) - step * new_shape:
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
/* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
* new_shape += 1
*
*/
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
/* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
*
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
/* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
* new_shape += 1
*
*/
}
/* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
* new_shape = 0
*
*/
__pyx_t_2 = (__pyx_v_new_shape < 0);
if (__pyx_t_2) {
/* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_new_shape = 0;
/* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
* new_shape = 0
*
*/
}
/* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
/* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
* dst.suboffsets[new_ndim] = suboffset
*
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
/* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
*
*
*/
(__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
}
__pyx_L3:;
/* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
* dst.data += start * stride
* else:
*/
__pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
if (__pyx_t_2) {
/* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
/* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
* dst.data += start * stride
* else:
*/
goto __pyx_L19;
}
/* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
/*else*/ {
__pyx_t_3 = (__pyx_v_suboffset_dim[0]);
(__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
}
__pyx_L19:;
/* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
* if not is_slice:
* if new_ndim == 0:
*/
__pyx_t_2 = (__pyx_v_suboffset >= 0);
if (__pyx_t_2) {
/* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset
*/
__pyx_t_2 = (!__pyx_v_is_slice);
if (__pyx_t_2) {
/* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
* dst.data = (<char **> dst.data)[0] + suboffset
* else:
*/
__pyx_t_2 = (__pyx_v_new_ndim == 0);
if (__pyx_t_2) {
/* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
* else:
* _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
/* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
* dst.data = (<char **> dst.data)[0] + suboffset
* else:
*/
goto __pyx_L22;
}
/* "View.MemoryView":885
* dst.data = (<char **> dst.data)[0] + suboffset
* else:
* _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
* "must be indexed and not sliced", dim)
* else:
*/
/*else*/ {
/* "View.MemoryView":886
* else:
* _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
* "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
* else:
* suboffset_dim[0] = new_ndim
*/
__pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_mstate_global->__pyx_kp_u_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
}
__pyx_L22:;
/* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset
*/
goto __pyx_L21;
}
/* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
/*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L21:;
/* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
* if not is_slice:
* if new_ndim == 0:
*/
}
/* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = 0;
goto __pyx_L0;
/* "View.MemoryView":792
*
*
* @cname('__pyx_memoryview_slice_memviewslice') # <<<<<<<<<<<<<<
* cdef int slice_memviewslice(
* __Pyx_memviewslice *dst,
*/
/* function exit code */
__pyx_L1_error:;
__pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":895
*
*
* @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
* Py_ssize_t dim) except NULL:
*/
static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
Py_ssize_t __pyx_v_shape;
Py_ssize_t __pyx_v_stride;
Py_ssize_t __pyx_v_suboffset;
Py_ssize_t __pyx_v_itemsize;
char *__pyx_v_resultp;
char *__pyx_r;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4[3];
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pybuffer_index", 0);
/* "View.MemoryView":898
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
* cdef Py_ssize_t itemsize = view.itemsize
* cdef char *resultp
*/
__pyx_v_suboffset = -1L;
/* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
* cdef char *resultp
*
*/
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
/* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
* shape = view.len // itemsize
* stride = itemsize
*/
__pyx_t_2 = (__pyx_v_view->ndim == 0);
if (__pyx_t_2) {
/* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len // itemsize # <<<<<<<<<<<<<<
* stride = itemsize
* else:
*/
if (unlikely(__pyx_v_itemsize == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(1, 903, __pyx_L1_error)
}
else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
__PYX_ERR(1, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
/* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len // itemsize
* stride = itemsize # <<<<<<<<<<<<<<
* else:
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
/* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
* shape = view.len // itemsize
* stride = itemsize
*/
goto __pyx_L3;
}
/* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
/*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
/* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim]
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
/* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
* suboffset = view.suboffsets[dim]
*
*/
__pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
if (__pyx_t_2) {
/* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
*
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
/* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
* suboffset = view.suboffsets[dim]
*
*/
}
}
__pyx_L3:;
/* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
* index += view.shape[dim]
* if index < 0:
*/
__pyx_t_2 = (__pyx_v_index < 0);
if (__pyx_t_2) {
/* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
* if index < 0:
* raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
/* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
* raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*
*/
__pyx_t_2 = (__pyx_v_index < 0);
if (unlikely(__pyx_t_2)) {
/* "View.MemoryView":914
* index += view.shape[dim]
* if index < 0:
* raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
*
* if index >= shape:
*/
__pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
__pyx_t_4[1] = __pyx_t_3;
__pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__5;
__pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(1, 914, __pyx_L1_error)
/* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
* raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*
*/
}
/* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
* index += view.shape[dim]
* if index < 0:
*/
}
/* "View.MemoryView":916
* raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*
* if index >= shape: # <<<<<<<<<<<<<<
* raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*
*/
__pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
if (unlikely(__pyx_t_2)) {
/* "View.MemoryView":917
*
* if index >= shape:
* raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
*
* resultp = bufp + index * stride
*/
__pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
__pyx_t_4[1] = __pyx_t_5;
__pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__5;
__pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(1, 917, __pyx_L1_error)
/* "View.MemoryView":916
* raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*
* if index >= shape: # <<<<<<<<<<<<<<
* raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*
*/
}
/* "View.MemoryView":919
* raise IndexError, f"Out of bounds on buffer access (axis {dim})"
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
/* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
* resultp = (<char **> resultp)[0] + suboffset
*
*/
__pyx_t_2 = (__pyx_v_suboffset >= 0);
if (__pyx_t_2) {
/* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
*
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
/* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
* resultp = (<char **> resultp)[0] + suboffset
*
*/
}
/* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
/* "View.MemoryView":895
*
*
* @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
* Py_ssize_t dim) except NULL:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":928
*
*
* @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
* cdef int ndim = memslice.memview.view.ndim
*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
int __pyx_v_ndim;
Py_ssize_t *__pyx_v_shape;
Py_ssize_t *__pyx_v_strides;
int __pyx_v_i;
int __pyx_v_j;
int __pyx_r;
int __pyx_t_1;
Py_ssize_t *__pyx_t_2;
long __pyx_t_3;
long __pyx_t_4;
Py_ssize_t __pyx_t_5;
Py_ssize_t __pyx_t_6;
int __pyx_t_7;
int __pyx_t_8;
int __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyGILState_STATE __pyx_gilstate_save;
/* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
*
* cdef Py_ssize_t *shape = memslice.shape
*/
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
/* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
* cdef Py_ssize_t *strides = memslice.strides
*
*/
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
/* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
/* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim // 2): # <<<<<<<<<<<<<<
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
*/
__pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
/* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim // 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i]
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
/* "View.MemoryView":939
* for i in range(ndim // 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
* shape[i], shape[j] = shape[j], shape[i]
*
*/
__pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
__pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
/* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
*/
__pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
__pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
/* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
* _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
*
*/
__pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
if (!__pyx_t_8) {
} else {
__pyx_t_7 = __pyx_t_8;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
__pyx_t_7 = __pyx_t_8;
__pyx_L6_bool_binop_done:;
if (__pyx_t_7) {
/* "View.MemoryView":943
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
* _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
*
* return 0
*/
__pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_mstate_global->__pyx_kp_u_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)
/* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
* _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
*
*/
}
}
/* "View.MemoryView":945
* _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 0 # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = 0;
goto __pyx_L0;
/* "View.MemoryView":928
*
*
* @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
* cdef int ndim = memslice.memview.view.ndim
*/
/* function exit code */
__pyx_L1_error:;
__pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":963
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
*
*/
/* Python wrapper */
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryviewslice___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_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
/* "View.MemoryView":964
*
* def __dealloc__(self):
* __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
*
* cdef convert_item_to_object(self, char *itemp):
*/
__PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
/* "View.MemoryView":963
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
*
*/
/* function exit code */
}
/* "View.MemoryView":966
* __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
* if self.to_object_func != NULL:
* return self.to_object_func(itemp)
*/
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("convert_item_to_object", 0);
/* "View.MemoryView":967
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
* return self.to_object_func(itemp)
* else:
*/
__pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
if (__pyx_t_1) {
/* "View.MemoryView":968
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
* else:
* return memoryview.convert_item_to_object(self, itemp)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "View.MemoryView":967
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
* return self.to_object_func(itemp)
* else:
*/
}
/* "View.MemoryView":970
* return self.to_object_func(itemp)
* else:
* return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
*
* cdef assign_item_from_object(self, char *itemp, object value):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "View.MemoryView":966
* __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
* if self.to_object_func != NULL:
* return self.to_object_func(itemp)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":972
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
* if self.to_dtype_func != NULL:
* self.to_dtype_func(itemp, value)
*/
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __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("assign_item_from_object", 0);
/* "View.MemoryView":973
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
* self.to_dtype_func(itemp, value)
* else:
*/
__pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
if (__pyx_t_1) {
/* "View.MemoryView":974
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL:
* self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
* else:
* memoryview.assign_item_from_object(self, itemp, value)
*/
__pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)
/* "View.MemoryView":973
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
* self.to_dtype_func(itemp, value)
* else:
*/
goto __pyx_L3;
}
/* "View.MemoryView":976
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
* cdef _get_base(self):
*/
/*else*/ {
__pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
/* "View.MemoryView":972
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
* if self.to_dtype_func != NULL:
* self.to_dtype_func(itemp, value)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":978
* memoryview.assign_item_from_object(self, itemp, value)
*
* cdef _get_base(self): # <<<<<<<<<<<<<<
* return self.from_object
*
*/
static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_get_base", 0);
/* "View.MemoryView":979
*
* cdef _get_base(self):
* return self.from_object # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->from_object);
__pyx_r = __pyx_v_self->from_object;
goto __pyx_L0;
/* "View.MemoryView":978
* memoryview.assign_item_from_object(self, itemp, value)
*
* cdef _get_base(self): # <<<<<<<<<<<<<<
* return self.from_object
*
*/
/* 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___pyx_memoryviewslice_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 PyObject *__pyx_pw___pyx_memoryviewslice_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___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__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(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(1, 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("View.MemoryView._memoryviewslice.__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___pyx_memoryviewslice_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 PyObject *__pyx_pw___pyx_memoryviewslice_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
) {
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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__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___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__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(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
__PYX_ERR(1, 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("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":998
* pass # ignore failure, it's a minor issue
*
* @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
* int ndim,
*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
Py_ssize_t __pyx_v_suboffset;
PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_TypeInfo const *__pyx_t_4;
Py_buffer __pyx_t_5;
Py_ssize_t *__pyx_t_6;
Py_ssize_t *__pyx_t_7;
Py_ssize_t *__pyx_t_8;
Py_ssize_t __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
/* "View.MemoryView":1007
* cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
*
*/
__pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
if (__pyx_t_1) {
/* "View.MemoryView":1008
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "View.MemoryView":1007
* cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
*
*/
}
/* "View.MemoryView":1013
*
*
* result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
*
* result.from_slice = memviewslice
*/
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1013, __pyx_L1_error);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1013, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1013, __pyx_L1_error);
__pyx_t_2 = 0;
__pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_mstate_global->__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
__pyx_t_2 = 0;
/* "View.MemoryView":1015
* result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
* __PYX_INC_MEMVIEW(&memviewslice, 1)
*
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
/* "View.MemoryView":1016
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
*
* result.from_object = (<memoryview> memviewslice.memview)._get_base()
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
/* "View.MemoryView":1018
* __PYX_INC_MEMVIEW(&memviewslice, 1)
*
* result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
* result.typeinfo = memviewslice.memview.typeinfo
*
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
__Pyx_DECREF(__pyx_v_result->from_object);
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
/* "View.MemoryView":1019
*
* result.from_object = (<memoryview> memviewslice.memview)._get_base()
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
*
* result.view = memviewslice.memview.view
*/
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
/* "View.MemoryView":1021
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
*/
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
/* "View.MemoryView":1022
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
/* "View.MemoryView":1023
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None)
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
/* "View.MemoryView":1024
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
* Py_INCREF(Py_None)
*
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
/* "View.MemoryView":1025
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
*/
Py_INCREF(Py_None);
/* "View.MemoryView":1027
* Py_INCREF(Py_None)
*
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
* result.flags = PyBUF_RECORDS
* else:
*/
__pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
if (__pyx_t_1) {
/* "View.MemoryView":1028
*
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
* else:
* result.flags = PyBUF_RECORDS_RO
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
/* "View.MemoryView":1027
* Py_INCREF(Py_None)
*
* if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
* result.flags = PyBUF_RECORDS
* else:
*/
goto __pyx_L4;
}
/* "View.MemoryView":1030
* result.flags = PyBUF_RECORDS
* else:
* result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
*
* result.view.shape = <Py_ssize_t *> result.from_slice.shape
*/
/*else*/ {
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
}
__pyx_L4:;
/* "View.MemoryView":1032
* result.flags = PyBUF_RECORDS_RO
*
* result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
* result.view.strides = <Py_ssize_t *> result.from_slice.strides
*
*/
__pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
/* "View.MemoryView":1033
*
* result.view.shape = <Py_ssize_t *> result.from_slice.shape
* result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
/* "View.MemoryView":1036
*
*
* result.view.suboffsets = NULL # <<<<<<<<<<<<<<
* for suboffset in result.from_slice.suboffsets[:ndim]:
* if suboffset >= 0:
*/
__pyx_v_result->__pyx_base.view.suboffsets = NULL;
/* "View.MemoryView":1037
*
* result.view.suboffsets = NULL
* for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
* if suboffset >= 0:
* result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
*/
__pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
__pyx_t_6 = __pyx_t_8;
__pyx_v_suboffset = (__pyx_t_6[0]);
/* "View.MemoryView":1038
* result.view.suboffsets = NULL
* for suboffset in result.from_slice.suboffsets[:ndim]:
* if suboffset >= 0: # <<<<<<<<<<<<<<
* result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
* break
*/
__pyx_t_1 = (__pyx_v_suboffset >= 0);
if (__pyx_t_1) {
/* "View.MemoryView":1039
* for suboffset in result.from_slice.suboffsets[:ndim]:
* if suboffset >= 0:
* result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
* break
*
*/
__pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
/* "View.MemoryView":1040
* if suboffset >= 0:
* result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
* break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
goto __pyx_L6_break;
/* "View.MemoryView":1038
* result.view.suboffsets = NULL
* for suboffset in result.from_slice.suboffsets[:ndim]:
* if suboffset >= 0: # <<<<<<<<<<<<<<
* result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
* break
*/
}
}
__pyx_L6_break:;
/* "View.MemoryView":1042
* break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
* for length in result.view.shape[:ndim]:
* result.view.len *= length
*/
__pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
__pyx_v_result->__pyx_base.view.len = __pyx_t_9;
/* "View.MemoryView":1043
*
* result.view.len = result.view.itemsize
* for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
* result.view.len *= length
*
*/
__pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
__pyx_t_6 = __pyx_t_8;
__pyx_t_2 = PyLong_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
__pyx_t_2 = 0;
/* "View.MemoryView":1044
* result.view.len = result.view.itemsize
* for length in result.view.shape[:ndim]:
* result.view.len *= length # <<<<<<<<<<<<<<
*
* result.to_object_func = to_object_func
*/
__pyx_t_2 = PyLong_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
/* "View.MemoryView":1046
* result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
*
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
/* "View.MemoryView":1047
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
*
* return result
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
/* "View.MemoryView":1049
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF((PyObject *)__pyx_v_result);
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "View.MemoryView":998
* pass # ignore failure, it's a minor issue
*
* @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
* int ndim,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
__Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":1051
* return result
*
* @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
* __Pyx_memviewslice *mslice) except NULL:
*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
__Pyx_memviewslice *__pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_slice_from_memview", 0);
/* "View.MemoryView":1055
* __Pyx_memviewslice *mslice) except NULL:
* cdef _memoryviewslice obj
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
* obj = memview
* return &obj.from_slice
*/
__pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
if (__pyx_t_1) {
/* "View.MemoryView":1056
* cdef _memoryviewslice obj
* if isinstance(memview, _memoryviewslice):
* obj = memview # <<<<<<<<<<<<<<
* return &obj.from_slice
* else:
*/
__pyx_t_2 = ((PyObject *)__pyx_v_memview);
__Pyx_INCREF(__pyx_t_2);
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
__pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
__pyx_t_2 = 0;
/* "View.MemoryView":1057
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
* else:
* slice_copy(memview, mslice)
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
/* "View.MemoryView":1055
* __Pyx_memviewslice *mslice) except NULL:
* cdef _memoryviewslice obj
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
* obj = memview
* return &obj.from_slice
*/
}
/* "View.MemoryView":1059
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
/*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
/* "View.MemoryView":1060
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_slice_copy')
*/
__pyx_r = __pyx_v_mslice;
goto __pyx_L0;
}
/* "View.MemoryView":1051
* return result
*
* @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
* __Pyx_memviewslice *mslice) except NULL:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":1062
* return mslice
*
* @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
* cdef int dim
*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
int __pyx_v_dim;
Py_ssize_t *__pyx_v_shape;
Py_ssize_t *__pyx_v_strides;
Py_ssize_t *__pyx_v_suboffsets;
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
Py_ssize_t __pyx_t_5;
int __pyx_t_6;
/* "View.MemoryView":1067
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets
*/
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
/* "View.MemoryView":1068
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
* suboffsets = memview.view.suboffsets
*
*/
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
/* "View.MemoryView":1069
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
*
* dst.memview = <__pyx_memoryview *> memview
*/
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
/* "View.MemoryView":1071
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
* dst.data = <char *> memview.view.buf
*
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
/* "View.MemoryView":1072
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
*
* for dim in range(memview.view.ndim):
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
/* "View.MemoryView":1074
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim]
*/
__pyx_t_2 = __pyx_v_memview->view.ndim;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_dim = __pyx_t_4;
/* "View.MemoryView":1075
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
* dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
/* "View.MemoryView":1076
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
* dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
/* "View.MemoryView":1077
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim]
* dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
__pyx_t_6 = (__pyx_v_suboffsets != 0);
if (__pyx_t_6) {
__pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
} else {
__pyx_t_5 = -1L;
}
(__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
}
/* "View.MemoryView":1062
* return mslice
*
* @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
* cdef int dim
*/
/* function exit code */
}
/* "View.MemoryView":1079
* dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*
* @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
* cdef memoryview_copy(memoryview memview):
* "Create a new memoryview object"
*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
__Pyx_memviewslice __pyx_v_memviewslice;
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("memoryview_copy", 0);
/* "View.MemoryView":1083
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
* return memoryview_copy_from_slice(memview, &memviewslice)
*
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
/* "View.MemoryView":1084
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object_from_slice')
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "View.MemoryView":1079
* dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*
* @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
* cdef memoryview_copy(memoryview memview):
* "Create a new memoryview object"
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":1086
* return memoryview_copy_from_slice(memview, &memviewslice)
*
* @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
* """
*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
PyObject *(*__pyx_v_to_object_func)(char *);
int (*__pyx_v_to_dtype_func)(char *, PyObject *);
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *(*__pyx_t_2)(char *);
int (*__pyx_t_3)(char *, PyObject *);
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
/* "View.MemoryView":1094
* cdef int (*to_dtype_func)(char *, object) except 0
*
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
*/
__pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
if (__pyx_t_1) {
/* "View.MemoryView":1095
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
*/
__pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_2;
/* "View.MemoryView":1096
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
* else:
* to_object_func = NULL
*/
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_3;
/* "View.MemoryView":1094
* cdef int (*to_dtype_func)(char *, object) except 0
*
* if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
*/
goto __pyx_L3;
}
/* "View.MemoryView":1098
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
/*else*/ {
__pyx_v_to_object_func = NULL;
/* "View.MemoryView":1099
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim,
*/
__pyx_v_to_dtype_func = NULL;
}
__pyx_L3:;
/* "View.MemoryView":1101
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
* to_object_func, to_dtype_func,
* memview.dtype_is_object)
*/
__Pyx_XDECREF(__pyx_r);
/* "View.MemoryView":1103
* return memoryview_fromslice(memviewslice[0], memview.view.ndim,
* to_object_func, to_dtype_func,
* memview.dtype_is_object) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "View.MemoryView":1086
* return memoryview_copy_from_slice(memview, &memviewslice)
*
* @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
* """
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "View.MemoryView":1109
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
* return -arg if arg < 0 else arg
*
*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
Py_ssize_t __pyx_r;
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
/* "View.MemoryView":1110
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
* return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
__pyx_t_2 = (__pyx_v_arg < 0);
if (__pyx_t_2) {
__pyx_t_1 = (-__pyx_v_arg);
} else {
__pyx_t_1 = __pyx_v_arg;
}
__pyx_r = __pyx_t_1;
goto __pyx_L0;
/* "View.MemoryView":1109
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
* return -arg if arg < 0 else arg
*
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":1112
* return -arg if arg < 0 else arg
*
* @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
* """
*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
int __pyx_v_i;
Py_ssize_t __pyx_v_c_stride;
Py_ssize_t __pyx_v_f_stride;
char __pyx_r;
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
/* "View.MemoryView":1118
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
* cdef Py_ssize_t f_stride = 0
*
*/
__pyx_v_c_stride = 0;
/* "View.MemoryView":1119
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
*
* for i in range(ndim - 1, -1, -1):
*/
__pyx_v_f_stride = 0;
/* "View.MemoryView":1121
* cdef Py_ssize_t f_stride = 0
*
* for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
*/
for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
/* "View.MemoryView":1122
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
* c_stride = mslice.strides[i]
* break
*/
__pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
if (__pyx_t_2) {
/* "View.MemoryView":1123
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
* break
*
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
/* "View.MemoryView":1124
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
*
* for i in range(ndim):
*/
goto __pyx_L4_break;
/* "View.MemoryView":1122
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
* c_stride = mslice.strides[i]
* break
*/
}
}
__pyx_L4_break:;
/* "View.MemoryView":1126
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
*/
__pyx_t_1 = __pyx_v_ndim;
__pyx_t_3 = __pyx_t_1;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
/* "View.MemoryView":1127
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
* f_stride = mslice.strides[i]
* break
*/
__pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
if (__pyx_t_2) {
/* "View.MemoryView":1128
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
* break
*
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
/* "View.MemoryView":1129
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
/* "View.MemoryView":1127
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
* f_stride = mslice.strides[i]
* break
*/
}
}
__pyx_L7_break:;
/* "View.MemoryView":1131
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
* return 'C'
* else:
*/
__pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
if (__pyx_t_2) {
/* "View.MemoryView":1132
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
* else:
* return 'F'
*/
__pyx_r = 'C';
goto __pyx_L0;
/* "View.MemoryView":1131
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
* return 'C'
* else:
*/
}
/* "View.MemoryView":1134
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
/*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
/* "View.MemoryView":1112
* return -arg if arg < 0 else arg
*
* @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
* """
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":1136
* return 'F'
*
* @cython.cdivision(True) # <<<<<<<<<<<<<<
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
* char *dst_data, Py_ssize_t *dst_strides,
*/
static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
CYTHON_UNUSED Py_ssize_t __pyx_v_i;
CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
Py_ssize_t __pyx_v_dst_extent;
Py_ssize_t __pyx_v_src_stride;
Py_ssize_t __pyx_v_dst_stride;
int __pyx_t_1;
int __pyx_t_2;
Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
/* "View.MemoryView":1144
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
* cdef Py_ssize_t dst_extent = dst_shape[0]
* cdef Py_ssize_t src_stride = src_strides[0]
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
/* "View.MemoryView":1145
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
* cdef Py_ssize_t src_stride = src_strides[0]
* cdef Py_ssize_t dst_stride = dst_strides[0]
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
/* "View.MemoryView":1146
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0]
* cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
/* "View.MemoryView":1147
* cdef Py_ssize_t dst_extent = dst_shape[0]
* cdef Py_ssize_t src_stride = src_strides[0]
* cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
*
* if ndim == 1:
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
/* "View.MemoryView":1149
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride):
*/
__pyx_t_1 = (__pyx_v_ndim == 1);
if (__pyx_t_1) {
/* "View.MemoryView":1150
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
* <size_t> src_stride == itemsize == <size_t> dst_stride):
* memcpy(dst_data, src_data, itemsize * dst_extent)
*/
__pyx_t_2 = (__pyx_v_src_stride > 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_dst_stride > 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
/* "View.MemoryView":1151
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
* memcpy(dst_data, src_data, itemsize * dst_extent)
* else:
*/
__pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
if (__pyx_t_2) {
__pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
}
__pyx_t_1 = __pyx_t_2;
__pyx_L5_bool_binop_done:;
/* "View.MemoryView":1150
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
* <size_t> src_stride == itemsize == <size_t> dst_stride):
* memcpy(dst_data, src_data, itemsize * dst_extent)
*/
if (__pyx_t_1) {
/* "View.MemoryView":1152
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride):
* memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
* else:
* for i in range(dst_extent):
*/
(void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
/* "View.MemoryView":1150
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
* <size_t> src_stride == itemsize == <size_t> dst_stride):
* memcpy(dst_data, src_data, itemsize * dst_extent)
*/
goto __pyx_L4;
}
/* "View.MemoryView":1154
* memcpy(dst_data, src_data, itemsize * dst_extent)
* else:
* for i in range(dst_extent): # <<<<<<<<<<<<<<
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
*/
/*else*/ {
__pyx_t_3 = __pyx_v_dst_extent;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
/* "View.MemoryView":1155
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
* src_data += src_stride
* dst_data += dst_stride
*/
(void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
/* "View.MemoryView":1156
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
* dst_data += dst_stride
* else:
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
/* "View.MemoryView":1157
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
* else:
* for i in range(dst_extent):
*/
__pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
}
}
__pyx_L4:;
/* "View.MemoryView":1149
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride):
*/
goto __pyx_L3;
}
/* "View.MemoryView":1159
* dst_data += dst_stride
* else:
* for i in range(dst_extent): # <<<<<<<<<<<<<<
* _copy_strided_to_strided(src_data, src_strides + 1,
* dst_data, dst_strides + 1,
*/
/*else*/ {
__pyx_t_3 = __pyx_v_dst_extent;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
/* "View.MemoryView":1160
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
* dst_data, dst_strides + 1,
* src_shape + 1, dst_shape + 1,
*/
_copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
/* "View.MemoryView":1164
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
* dst_data += dst_stride
*
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
/* "View.MemoryView":1165
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
*/
__pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
}
}
__pyx_L3:;
/* "View.MemoryView":1136
* return 'F'
*
* @cython.cdivision(True) # <<<<<<<<<<<<<<
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
* char *dst_data, Py_ssize_t *dst_strides,
*/
/* function exit code */
}
/* "View.MemoryView":1167
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) noexcept nogil:
*/
static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
/* "View.MemoryView":1170
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) noexcept nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
* src.shape, dst.shape, ndim, itemsize)
*
*/
_copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
/* "View.MemoryView":1167
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) noexcept nogil:
*/
/* function exit code */
}
/* "View.MemoryView":1173
* src.shape, dst.shape, ndim, itemsize)
*
* @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
* "Return the size of the memory occupied by the slice in number of bytes"
*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
Py_ssize_t __pyx_v_shape;
Py_ssize_t __pyx_v_size;
Py_ssize_t __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t *__pyx_t_2;
Py_ssize_t *__pyx_t_3;
Py_ssize_t *__pyx_t_4;
/* "View.MemoryView":1176
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
* "Return the size of the memory occupied by the slice in number of bytes"
* cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
*
* for shape in src.shape[:ndim]:
*/
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
/* "View.MemoryView":1178
* cdef Py_ssize_t shape, size = src.memview.view.itemsize
*
* for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
* size *= shape
*
*/
__pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
__pyx_t_2 = __pyx_t_4;
__pyx_v_shape = (__pyx_t_2[0]);
/* "View.MemoryView":1179
*
* for shape in src.shape[:ndim]:
* size *= shape # <<<<<<<<<<<<<<
*
* return size
*/
__pyx_v_size = (__pyx_v_size * __pyx_v_shape);
}
/* "View.MemoryView":1181
* size *= shape
*
* return size # <<<<<<<<<<<<<<
*
* @cname('__pyx_fill_contig_strides_array')
*/
__pyx_r = __pyx_v_size;
goto __pyx_L0;
/* "View.MemoryView":1173
* src.shape, dst.shape, ndim, itemsize)
*
* @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
* "Return the size of the memory occupied by the slice in number of bytes"
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":1183
* return size
*
* @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
* cdef Py_ssize_t fill_contig_strides_array(
* Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
int __pyx_v_idx;
Py_ssize_t __pyx_r;
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
/* "View.MemoryView":1193
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
* for idx in range(ndim):
* strides[idx] = stride
*/
__pyx_t_1 = (__pyx_v_order == 'F');
if (__pyx_t_1) {
/* "View.MemoryView":1194
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
* strides[idx] = stride
* stride *= shape[idx]
*/
__pyx_t_2 = __pyx_v_ndim;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_idx = __pyx_t_4;
/* "View.MemoryView":1195
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
* stride *= shape[idx]
* else:
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
/* "View.MemoryView":1196
* for idx in range(ndim):
* strides[idx] = stride
* stride *= shape[idx] # <<<<<<<<<<<<<<
* else:
* for idx in range(ndim - 1, -1, -1):
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
/* "View.MemoryView":1193
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
* for idx in range(ndim):
* strides[idx] = stride
*/
goto __pyx_L3;
}
/* "View.MemoryView":1198
* stride *= shape[idx]
* else:
* for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
* strides[idx] = stride
* stride *= shape[idx]
*/
/*else*/ {
for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
/* "View.MemoryView":1199
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
* stride *= shape[idx]
*
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
/* "View.MemoryView":1200
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride *= shape[idx] # <<<<<<<<<<<<<<
*
* return stride
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
}
__pyx_L3:;
/* "View.MemoryView":1202
* stride *= shape[idx]
*
* return stride # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_data_to_temp')
*/
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
/* "View.MemoryView":1183
* return size
*
* @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
* cdef Py_ssize_t fill_contig_strides_array(
* Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":1204
* return stride
*
* @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
* __Pyx_memviewslice *tmpslice,
*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
int __pyx_v_i;
void *__pyx_v_result;
size_t __pyx_v_itemsize;
size_t __pyx_v_size;
void *__pyx_r;
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
struct __pyx_memoryview_obj *__pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyGILState_STATE __pyx_gilstate_save;
/* "View.MemoryView":1216
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
* cdef size_t size = slice_get_size(src, ndim)
*
*/
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
/* "View.MemoryView":1217
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
*
* result = malloc(size)
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
/* "View.MemoryView":1219
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
* if not result:
* _err_no_memory()
*/
__pyx_v_result = malloc(__pyx_v_size);
/* "View.MemoryView":1220
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
* _err_no_memory()
*
*/
__pyx_t_2 = (!(__pyx_v_result != 0));
if (__pyx_t_2) {
/* "View.MemoryView":1221
* result = malloc(size)
* if not result:
* _err_no_memory() # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
/* "View.MemoryView":1220
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
* _err_no_memory()
*
*/
}
/* "View.MemoryView":1224
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
* tmpslice.memview = src.memview
* for i in range(ndim):
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
/* "View.MemoryView":1225
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i]
*/
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
/* "View.MemoryView":1226
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
* tmpslice.shape[i] = src.shape[i]
* tmpslice.suboffsets[i] = -1
*/
__pyx_t_3 = __pyx_v_ndim;
__pyx_t_5 = __pyx_t_3;
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
/* "View.MemoryView":1227
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
* tmpslice.suboffsets[i] = -1
*
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
/* "View.MemoryView":1228
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i]
* tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
*/
(__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
/* "View.MemoryView":1230
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) # <<<<<<<<<<<<<<
*
*
*/
(void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
/* "View.MemoryView":1233
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0
*/
__pyx_t_3 = __pyx_v_ndim;
__pyx_t_5 = __pyx_t_3;
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
/* "View.MemoryView":1234
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
* tmpslice.strides[i] = 0
*
*/
__pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
if (__pyx_t_2) {
/* "View.MemoryView":1235
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
* if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
/* "View.MemoryView":1234
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
* tmpslice.strides[i] = 0
*
*/
}
}
/* "View.MemoryView":1237
* tmpslice.strides[i] = 0
*
* if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
* memcpy(result, src.data, size)
* else:
*/
__pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
if (__pyx_t_2) {
/* "View.MemoryView":1238
*
* if slice_is_contig(src[0], order, ndim):
* memcpy(result, src.data, size) # <<<<<<<<<<<<<<
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*/
(void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
/* "View.MemoryView":1237
* tmpslice.strides[i] = 0
*
* if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
* memcpy(result, src.data, size)
* else:
*/
goto __pyx_L9;
}
/* "View.MemoryView":1240
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
/*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
/* "View.MemoryView":1242
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_result;
goto __pyx_L0;
/* "View.MemoryView":1204
* return stride
*
* @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
* __Pyx_memviewslice *tmpslice,
*/
/* function exit code */
__pyx_L1_error:;
__pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":1246
*
*
* @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
* cdef int _err_extents(int i, Py_ssize_t extent1,
* Py_ssize_t extent2) except -1 with gil:
*/
static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4[7];
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_RefNannySetupContext("_err_extents", 0);
/* "View.MemoryView":1249
* cdef int _err_extents(int i, Py_ssize_t extent1,
* Py_ssize_t extent2) except -1 with gil:
* raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_err_dim')
*/
__pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi;
__pyx_t_4[1] = __pyx_t_1;
__pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_got;
__pyx_t_4[3] = __pyx_t_2;
__pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_and;
__pyx_t_4[5] = __pyx_t_3;
__pyx_t_4[6] = __pyx_mstate_global->__pyx_kp_u__5;
__pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, 35 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_5, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(1, 1249, __pyx_L1_error)
/* "View.MemoryView":1246
*
*
* @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
* cdef int _err_extents(int i, Py_ssize_t extent1,
* Py_ssize_t extent2) except -1 with gil:
*/
/* 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_5);
__Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_RefNannyFinishContext();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
return __pyx_r;
}
/* "View.MemoryView":1251
* raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
*
* @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
* cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
* raise <object>error, msg % dim
*/
static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
int __pyx_r;
__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;
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_RefNannySetupContext("_err_dim", 0);
__Pyx_INCREF(__pyx_v_msg);
/* "View.MemoryView":1253
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
* raise <object>error, msg % dim # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_err')
*/
__pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 1253, __pyx_L1_error)
/* "View.MemoryView":1251
* raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
*
* @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
* cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
* raise <object>error, msg % dim
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_XDECREF(__pyx_v_msg);
__Pyx_RefNannyFinishContext();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
return __pyx_r;
}
/* "View.MemoryView":1255
* raise <object>error, msg % dim
*
* @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
* cdef int _err(PyObject *error, str msg) except -1 with gil:
* raise <object>error, msg
*/
static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_RefNannySetupContext("_err", 0);
__Pyx_INCREF(__pyx_v_msg);
/* "View.MemoryView":1257
* @cname('__pyx_memoryview_err')
* cdef int _err(PyObject *error, str msg) except -1 with gil:
* raise <object>error, msg # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_err_no_memory')
*/
__Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
__PYX_ERR(1, 1257, __pyx_L1_error)
/* "View.MemoryView":1255
* raise <object>error, msg % dim
*
* @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
* cdef int _err(PyObject *error, str msg) except -1 with gil:
* raise <object>error, msg
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_XDECREF(__pyx_v_msg);
__Pyx_RefNannyFinishContext();
__Pyx_PyGILState_Release(__pyx_gilstate_save);
return __pyx_r;
}
/* "View.MemoryView":1259
* raise <object>error, msg
*
* @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
* cdef int _err_no_memory() except -1 with gil:
* raise MemoryError
*/
static int __pyx_memoryview_err_no_memory(void) {
int __pyx_r;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
/* "View.MemoryView":1261
* @cname('__pyx_memoryview_err_no_memory')
* cdef int _err_no_memory() except -1 with gil:
* raise MemoryError # <<<<<<<<<<<<<<
*
*
*/
PyErr_NoMemory(); __PYX_ERR(1, 1261, __pyx_L1_error)
/* "View.MemoryView":1259
* raise <object>error, msg
*
* @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
* cdef int _err_no_memory() except -1 with gil:
* raise MemoryError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_PyGILState_Release(__pyx_gilstate_save);
return __pyx_r;
}
/* "View.MemoryView":1264
*
*
* @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
* cdef int memoryview_copy_contents(__Pyx_memviewslice src,
* __Pyx_memviewslice dst,
*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
void *__pyx_v_tmpdata;
size_t __pyx_v_itemsize;
int __pyx_v_i;
char __pyx_v_order;
int __pyx_v_broadcasting;
int __pyx_v_direct_copy;
__Pyx_memviewslice __pyx_v_tmp;
int __pyx_v_ndim;
int __pyx_r;
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
void *__pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyGILState_STATE __pyx_gilstate_save;
/* "View.MemoryView":1273
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
*/
__pyx_v_tmpdata = NULL;
/* "View.MemoryView":1274
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
*/
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
/* "View.MemoryView":1276
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
* cdef bint broadcasting = False
* cdef bint direct_copy = False
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
/* "View.MemoryView":1277
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
* cdef bint direct_copy = False
* cdef __Pyx_memviewslice tmp
*/
__pyx_v_broadcasting = 0;
/* "View.MemoryView":1278
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice tmp
*
*/
__pyx_v_direct_copy = 0;
/* "View.MemoryView":1281
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
*/
__pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
if (__pyx_t_2) {
/* "View.MemoryView":1282
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
/* "View.MemoryView":1281
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
*/
goto __pyx_L3;
}
/* "View.MemoryView":1283
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
*/
__pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
if (__pyx_t_2) {
/* "View.MemoryView":1284
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
*
* cdef int ndim = max(src_ndim, dst_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
/* "View.MemoryView":1283
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
*/
}
__pyx_L3:;
/* "View.MemoryView":1286
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
*
* for i in range(ndim):
*/
__pyx_t_3 = __pyx_v_dst_ndim;
__pyx_t_4 = __pyx_v_src_ndim;
__pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
if (__pyx_t_2) {
__pyx_t_5 = __pyx_t_3;
} else {
__pyx_t_5 = __pyx_t_4;
}
__pyx_v_ndim = __pyx_t_5;
/* "View.MemoryView":1288
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
*/
__pyx_t_5 = __pyx_v_ndim;
__pyx_t_3 = __pyx_t_5;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
/* "View.MemoryView":1289
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
* if src.shape[i] == 1:
* broadcasting = True
*/
__pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
if (__pyx_t_2) {
/* "View.MemoryView":1290
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
* broadcasting = True
* src.strides[i] = 0
*/
__pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
if (__pyx_t_2) {
/* "View.MemoryView":1291
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
* src.strides[i] = 0
* else:
*/
__pyx_v_broadcasting = 1;
/* "View.MemoryView":1292
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
* else:
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
/* "View.MemoryView":1290
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
* broadcasting = True
* src.strides[i] = 0
*/
goto __pyx_L7;
}
/* "View.MemoryView":1294
* src.strides[i] = 0
* else:
* _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
*
* if src.suboffsets[i] >= 0:
*/
/*else*/ {
__pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
}
__pyx_L7:;
/* "View.MemoryView":1289
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
* if src.shape[i] == 1:
* broadcasting = True
*/
}
/* "View.MemoryView":1296
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
* _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
*
*/
__pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
if (__pyx_t_2) {
/* "View.MemoryView":1297
*
* if src.suboffsets[i] >= 0:
* _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
*
* if slices_overlap(&src, &dst, ndim, itemsize):
*/
__pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_mstate_global->__pyx_kp_u_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
/* "View.MemoryView":1296
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
* _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
*
*/
}
}
/* "View.MemoryView":1299
* _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
* if not slice_is_contig(src, order, ndim):
*/
__pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
if (__pyx_t_2) {
/* "View.MemoryView":1301
* if slices_overlap(&src, &dst, ndim, itemsize):
*
* if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
* order = get_best_order(&dst, ndim)
*
*/
__pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
if (__pyx_t_2) {
/* "View.MemoryView":1302
*
* if not slice_is_contig(src, order, ndim):
* order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
/* "View.MemoryView":1301
* if slices_overlap(&src, &dst, ndim, itemsize):
*
* if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
* order = get_best_order(&dst, ndim)
*
*/
}
/* "View.MemoryView":1304
* order = get_best_order(&dst, ndim)
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
* src = tmp
*
*/
__pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)0))) __PYX_ERR(1, 1304, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_7;
/* "View.MemoryView":1305
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
*
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
/* "View.MemoryView":1299
* _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
* if not slice_is_contig(src, order, ndim):
*/
}
/* "View.MemoryView":1307
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = (!__pyx_v_broadcasting);
if (__pyx_t_2) {
/* "View.MemoryView":1310
*
*
* if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
* direct_copy = slice_is_contig(dst, 'C', ndim)
* elif slice_is_contig(src, 'F', ndim):
*/
__pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
if (__pyx_t_2) {
/* "View.MemoryView":1311
*
* if slice_is_contig(src, 'C', ndim):
* direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
* elif slice_is_contig(src, 'F', ndim):
* direct_copy = slice_is_contig(dst, 'F', ndim)
*/
__pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
/* "View.MemoryView":1310
*
*
* if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
* direct_copy = slice_is_contig(dst, 'C', ndim)
* elif slice_is_contig(src, 'F', ndim):
*/
goto __pyx_L12;
}
/* "View.MemoryView":1312
* if slice_is_contig(src, 'C', ndim):
* direct_copy = slice_is_contig(dst, 'C', ndim)
* elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
* direct_copy = slice_is_contig(dst, 'F', ndim)
*
*/
__pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
if (__pyx_t_2) {
/* "View.MemoryView":1313
* direct_copy = slice_is_contig(dst, 'C', ndim)
* elif slice_is_contig(src, 'F', ndim):
* direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
*
* if direct_copy:
*/
__pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
/* "View.MemoryView":1312
* if slice_is_contig(src, 'C', ndim):
* direct_copy = slice_is_contig(dst, 'C', ndim)
* elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
* direct_copy = slice_is_contig(dst, 'F', ndim)
*
*/
}
__pyx_L12:;
/* "View.MemoryView":1315
* direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
* refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
if (__pyx_v_direct_copy) {
/* "View.MemoryView":1317
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, inc=True)
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
/* "View.MemoryView":1318
*
* refcount_copying(&dst, dtype_is_object, ndim, inc=False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
* refcount_copying(&dst, dtype_is_object, ndim, inc=True)
* free(tmpdata)
*/
(void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
/* "View.MemoryView":1319
* refcount_copying(&dst, dtype_is_object, ndim, inc=False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
* free(tmpdata)
* return 0
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
/* "View.MemoryView":1320
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, inc=True)
* free(tmpdata) # <<<<<<<<<<<<<<
* return 0
*
*/
free(__pyx_v_tmpdata);
/* "View.MemoryView":1321
* refcount_copying(&dst, dtype_is_object, ndim, inc=True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
*
* if order == 'F' == get_best_order(&dst, ndim):
*/
__pyx_r = 0;
goto __pyx_L0;
/* "View.MemoryView":1315
* direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
* refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
}
/* "View.MemoryView":1307
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
*
*
*/
}
/* "View.MemoryView":1323
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = (__pyx_v_order == 'F');
if (__pyx_t_2) {
__pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
}
if (__pyx_t_2) {
/* "View.MemoryView":1326
*
*
* transpose_memslice(&src) # <<<<<<<<<<<<<<
* transpose_memslice(&dst)
*
*/
__pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1326, __pyx_L1_error)
/* "View.MemoryView":1327
*
* transpose_memslice(&src)
* transpose_memslice(&dst) # <<<<<<<<<<<<<<
*
* refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
__pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L1_error)
/* "View.MemoryView":1323
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
*
*
*/
}
/* "View.MemoryView":1329
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, inc=True)
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
/* "View.MemoryView":1330
*
* refcount_copying(&dst, dtype_is_object, ndim, inc=False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
* refcount_copying(&dst, dtype_is_object, ndim, inc=True)
*
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
/* "View.MemoryView":1331
* refcount_copying(&dst, dtype_is_object, ndim, inc=False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
*
* free(tmpdata)
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
/* "View.MemoryView":1333
* refcount_copying(&dst, dtype_is_object, ndim, inc=True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
* return 0
*
*/
free(__pyx_v_tmpdata);
/* "View.MemoryView":1334
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_broadcast_leading')
*/
__pyx_r = 0;
goto __pyx_L0;
/* "View.MemoryView":1264
*
*
* @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
* cdef int memoryview_copy_contents(__Pyx_memviewslice src,
* __Pyx_memviewslice dst,
*/
/* function exit code */
__pyx_L1_error:;
__pyx_gilstate_save = __Pyx_PyGILState_Ensure();
__Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_PyGILState_Release(__pyx_gilstate_save);
__pyx_L0:;
return __pyx_r;
}
/* "View.MemoryView":1336
* return 0
*
* @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
* cdef void broadcast_leading(__Pyx_memviewslice *mslice,
* int ndim,
*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
int __pyx_v_i;
int __pyx_v_offset;
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
/* "View.MemoryView":1341
* int ndim_other) noexcept nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
*
* for i in range(ndim - 1, -1, -1):
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
/* "View.MemoryView":1343
* cdef int offset = ndim_other - ndim
*
* for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
* mslice.shape[i + offset] = mslice.shape[i]
* mslice.strides[i + offset] = mslice.strides[i]
*/
for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
/* "View.MemoryView":1344
*
* for i in range(ndim - 1, -1, -1):
* mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
* mslice.strides[i + offset] = mslice.strides[i]
* mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
(__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
/* "View.MemoryView":1345
* for i in range(ndim - 1, -1, -1):
* mslice.shape[i + offset] = mslice.shape[i]
* mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
* mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
(__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
/* "View.MemoryView":1346
* mslice.shape[i + offset] = mslice.shape[i]
* mslice.strides[i + offset] = mslice.strides[i]
* mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
(__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
/* "View.MemoryView":1348
* mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
* mslice.shape[i] = 1
* mslice.strides[i] = mslice.strides[0]
*/
__pyx_t_1 = __pyx_v_offset;
__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;
/* "View.MemoryView":1349
*
* for i in range(offset):
* mslice.shape[i] = 1 # <<<<<<<<<<<<<<
* mslice.strides[i] = mslice.strides[0]
* mslice.suboffsets[i] = -1
*/
(__pyx_v_mslice->shape[__pyx_v_i]) = 1;
/* "View.MemoryView":1350
* for i in range(offset):
* mslice.shape[i] = 1
* mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
* mslice.suboffsets[i] = -1
*
*/
(__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
/* "View.MemoryView":1351
* mslice.shape[i] = 1
* mslice.strides[i] = mslice.strides[0]
* mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
(__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
/* "View.MemoryView":1336
* return 0
*
* @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
* cdef void broadcast_leading(__Pyx_memviewslice *mslice,
* int ndim,
*/
/* function exit code */
}
/* "View.MemoryView":1358
*
*
* @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
*
*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
/* "View.MemoryView":1361
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
*
* if dtype_is_object: # <<<<<<<<<<<<<<
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
*
*/
if (__pyx_v_dtype_is_object) {
/* "View.MemoryView":1362
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
*/
__pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
/* "View.MemoryView":1361
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
*
* if dtype_is_object: # <<<<<<<<<<<<<<
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
*
*/
}
/* "View.MemoryView":1358
*
*
* @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
*
*/
/* function exit code */
}
/* "View.MemoryView":1364
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
* Py_ssize_t *strides, int ndim,
*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
/* "View.MemoryView":1368
* Py_ssize_t *strides, int ndim,
* bint inc) noexcept with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
/* "View.MemoryView":1364
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
* Py_ssize_t *strides, int ndim,
*/
/* function exit code */
__Pyx_PyGILState_Release(__pyx_gilstate_save);
}
/* "View.MemoryView":1370
* refcount_objects_in_slice(data, shape, strides, ndim, inc)
*
* @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
* Py_ssize_t *strides, int ndim, bint inc) noexcept:
*/
static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
CYTHON_UNUSED Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_stride;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
int __pyx_t_4;
/* "View.MemoryView":1374
* Py_ssize_t *strides, int ndim, bint inc) noexcept:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
*
* for i in range(shape[0]):
*/
__pyx_v_stride = (__pyx_v_strides[0]);
/* "View.MemoryView":1376
* cdef Py_ssize_t stride = strides[0]
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
* if ndim == 1:
* if inc:
*/
__pyx_t_1 = (__pyx_v_shape[0]);
__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;
/* "View.MemoryView":1377
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
* if inc:
* Py_INCREF((<PyObject **> data)[0])
*/
__pyx_t_4 = (__pyx_v_ndim == 1);
if (__pyx_t_4) {
/* "View.MemoryView":1378
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
* Py_INCREF((<PyObject **> data)[0])
* else:
*/
if (__pyx_v_inc) {
/* "View.MemoryView":1379
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
/* "View.MemoryView":1378
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
* Py_INCREF((<PyObject **> data)[0])
* else:
*/
goto __pyx_L6;
}
/* "View.MemoryView":1381
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
*/
/*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
/* "View.MemoryView":1377
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
* if inc:
* Py_INCREF((<PyObject **> data)[0])
*/
goto __pyx_L5;
}
/* "View.MemoryView":1383
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
*
* data += stride
*/
/*else*/ {
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
}
__pyx_L5:;
/* "View.MemoryView":1385
* refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
*
* data += stride # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
/* "View.MemoryView":1370
* refcount_objects_in_slice(data, shape, strides, ndim, inc)
*
* @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
* Py_ssize_t *strides, int ndim, bint inc) noexcept:
*/
/* function exit code */
}
/* "View.MemoryView":1390
*
*
* @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
* size_t itemsize, void *item,
*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
/* "View.MemoryView":1394
* size_t itemsize, void *item,
* bint dtype_is_object) noexcept nogil:
* refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, inc=True)
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
/* "View.MemoryView":1395
* bint dtype_is_object) noexcept nogil:
* refcount_copying(dst, dtype_is_object, ndim, inc=False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
* refcount_copying(dst, dtype_is_object, ndim, inc=True)
*
*/
__pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
/* "View.MemoryView":1396
* refcount_copying(dst, dtype_is_object, ndim, inc=False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
*
*
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
/* "View.MemoryView":1390
*
*
* @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
* size_t itemsize, void *item,
*/
/* function exit code */
}
/* "View.MemoryView":1399
*
*
* @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
* Py_ssize_t *strides, int ndim,
*/
static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
CYTHON_UNUSED Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_stride;
Py_ssize_t __pyx_v_extent;
int __pyx_t_1;
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
/* "View.MemoryView":1404
* size_t itemsize, void *item) noexcept nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
* cdef Py_ssize_t extent = shape[0]
*
*/
__pyx_v_stride = (__pyx_v_strides[0]);
/* "View.MemoryView":1405
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
*
* if ndim == 1:
*/
__pyx_v_extent = (__pyx_v_shape[0]);
/* "View.MemoryView":1407
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
* for i in range(extent):
* memcpy(data, item, itemsize)
*/
__pyx_t_1 = (__pyx_v_ndim == 1);
if (__pyx_t_1) {
/* "View.MemoryView":1408
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
* memcpy(data, item, itemsize)
* data += stride
*/
__pyx_t_2 = __pyx_v_extent;
__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;
/* "View.MemoryView":1409
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
* data += stride
* else:
*/
(void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
/* "View.MemoryView":1410
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
* else:
* for i in range(extent):
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
/* "View.MemoryView":1407
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
* for i in range(extent):
* memcpy(data, item, itemsize)
*/
goto __pyx_L3;
}
/* "View.MemoryView":1412
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
* data += stride
*/
/*else*/ {
__pyx_t_2 = __pyx_v_extent;
__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;
/* "View.MemoryView":1413
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
* data += stride
*
*/
__pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
/* "View.MemoryView":1414
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
*
*
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
}
__pyx_L3:;
/* "View.MemoryView":1399
*
*
* @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
* Py_ssize_t *strides, int ndim,
*/
/* function exit code */
}
/* "(tree fragment)":1
* def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(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_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(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
) {
PyObject *__pyx_v___pyx_type = 0;
long __pyx_v___pyx_checksum;
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[3] = {0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__pyx_unpickle_Enum (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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(1, 1, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 1, __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(1, 1, __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(1, 1, __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, "__pyx_unpickle_Enum", 0) < 0) __PYX_ERR(1, 1, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 1, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 3)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 1, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 1, __pyx_L3_error)
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 1, __pyx_L3_error)
}
__pyx_v___pyx_type = values[0];
__pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
__pyx_v___pyx_state = values[2];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __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("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __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_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_v___pyx_PickleError = 0;
PyObject *__pyx_v___pyx_result = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
size_t __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
*/
__pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[1], Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
/* "(tree fragment)":5
* cdef object __pyx_result
* if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
* raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
* __pyx_result = Enum.__new__(__pyx_type)
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_PickleError);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_PickleError);
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_PickleError) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
__pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__pyx_v___pyx_PickleError = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "(tree fragment)":6
* if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum # <<<<<<<<<<<<<<
* __pyx_result = Enum.__new__(__pyx_type)
* if __pyx_state is not None:
*/
__pyx_t_3 = __Pyx_PyLong_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(1, 6, __pyx_L1_error)
/* "(tree fragment)":4
* cdef object __pyx_PickleError
* cdef object __pyx_result
* if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
*/
}
/* "(tree fragment)":7
* from pickle import PickleError as __pyx_PickleError
* raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
* __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
* if __pyx_state is not None:
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
*/
__pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
__Pyx_INCREF(__pyx_t_3);
__pyx_t_4 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_v___pyx_result = __pyx_t_1;
__pyx_t_1 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
* __pyx_result = Enum.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
* return __pyx_result
*/
__pyx_t_2 = (__pyx_v___pyx_state != Py_None);
if (__pyx_t_2) {
/* "(tree fragment)":9
* __pyx_result = Enum.__new__(__pyx_type)
* if __pyx_state is not None:
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
* return __pyx_result
* cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
__pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":8
* raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
* __pyx_result = Enum.__new__(__pyx_type)
* if __pyx_state is not None: # <<<<<<<<<<<<<<
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
* return __pyx_result
*/
}
/* "(tree fragment)":10
* if __pyx_state is not None:
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
* return __pyx_result # <<<<<<<<<<<<<<
* cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
* __pyx_result.name = __pyx_state[0]
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v___pyx_result);
__pyx_r = __pyx_v___pyx_result;
goto __pyx_L0;
/* "(tree fragment)":1
* def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
* cdef object __pyx_PickleError
* cdef object __pyx_result
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v___pyx_PickleError);
__Pyx_XDECREF(__pyx_v___pyx_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":11
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result.name = __pyx_state[0]
* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
*/
static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
Py_ssize_t __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
size_t __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
/* "(tree fragment)":12
* return __pyx_result
* cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
* __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[1])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 12, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v___pyx_result->name);
__Pyx_DECREF(__pyx_v___pyx_result->name);
__pyx_v___pyx_result->name = __pyx_t_1;
__pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
* __pyx_result.name = __pyx_state[0]
* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[1])
*/
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 13, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
__pyx_t_4 = (__pyx_t_3 > 1);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
__pyx_t_2 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "(tree fragment)":14
* __pyx_result.name = __pyx_state[0]
* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
* __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __pyx_t_6;
__Pyx_INCREF(__pyx_t_5);
if (unlikely(__pyx_v___pyx_state == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 14, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_update, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__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_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":13
* cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
* __pyx_result.name = __pyx_state[0]
* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
* __pyx_result.__dict__.update(__pyx_state[1])
*/
}
/* "(tree fragment)":11
* __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
* return __pyx_result
* cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
* __pyx_result.name = __pyx_state[0]
* if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
*/
/* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "vector.from_py":48
* cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
*
* @cname("__pyx_convert_vector_from_py_int") # <<<<<<<<<<<<<<
* cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *:
*
*/
static std::vector<int> __pyx_convert_vector_from_py_int(PyObject *__pyx_v_o) {
std::vector<int> __pyx_v_v;
Py_ssize_t __pyx_v_s;
PyObject *__pyx_v_item = NULL;
std::vector<int> __pyx_r;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *(*__pyx_t_4)(PyObject *);
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_int", 0);
/* "vector.from_py":52
*
* cdef vector[X] v
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0) # <<<<<<<<<<<<<<
*
* if s > 0:
*/
__pyx_t_1 = __Pyx_PyObject_LengthHint(__pyx_v_o, 0); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 52, __pyx_L1_error)
__pyx_v_s = __pyx_t_1;
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
__pyx_t_2 = (__pyx_v_s > 0);
if (__pyx_t_2) {
/* "vector.from_py":55
*
* if s > 0:
* v.reserve(<size_t> s) # <<<<<<<<<<<<<<
*
* for item in o:
*/
try {
__pyx_v_v.reserve(((size_t)__pyx_v_s));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 55, __pyx_L1_error)
}
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
__pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_4 = NULL;
} else {
__pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 57, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 57, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
__pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_1);
++__pyx_t_1;
} else {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
#else
__pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
#endif
++__pyx_t_1;
}
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 57, __pyx_L1_error)
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_3);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 57, __pyx_L1_error)
PyErr_Clear();
}
break;
}
}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
__pyx_t_5 = 0;
/* "vector.from_py":58
*
* for item in o:
* v.push_back(<X>item) # <<<<<<<<<<<<<<
*
* return v
*/
__pyx_t_6 = __Pyx_PyLong_As_int(__pyx_v_item); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
try {
__pyx_v_v.push_back(((int)__pyx_t_6));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 58, __pyx_L1_error)
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "vector.from_py":60
* v.push_back(<X>item)
*
* return v # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_v;
goto __pyx_L0;
/* "vector.from_py":48
* cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
*
* @cname("__pyx_convert_vector_from_py_int") # <<<<<<<<<<<<<<
* cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_item);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static std::vector<std::vector<int> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(PyObject *__pyx_v_o) {
std::vector<std::vector<int> > __pyx_v_v;
Py_ssize_t __pyx_v_s;
PyObject *__pyx_v_item = NULL;
std::vector<std::vector<int> > __pyx_r;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *(*__pyx_t_4)(PyObject *);
PyObject *__pyx_t_5 = NULL;
std::vector<int> __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___", 0);
/* "vector.from_py":52
*
* cdef vector[X] v
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0) # <<<<<<<<<<<<<<
*
* if s > 0:
*/
__pyx_t_1 = __Pyx_PyObject_LengthHint(__pyx_v_o, 0); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 52, __pyx_L1_error)
__pyx_v_s = __pyx_t_1;
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
__pyx_t_2 = (__pyx_v_s > 0);
if (__pyx_t_2) {
/* "vector.from_py":55
*
* if s > 0:
* v.reserve(<size_t> s) # <<<<<<<<<<<<<<
*
* for item in o:
*/
try {
__pyx_v_v.reserve(((size_t)__pyx_v_s));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 55, __pyx_L1_error)
}
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
__pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_4 = NULL;
} else {
__pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 57, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 57, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
__pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_1);
++__pyx_t_1;
} else {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
#else
__pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
#endif
++__pyx_t_1;
}
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 57, __pyx_L1_error)
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_3);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 57, __pyx_L1_error)
PyErr_Clear();
}
break;
}
}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
__pyx_t_5 = 0;
/* "vector.from_py":58
*
* for item in o:
* v.push_back(<X>item) # <<<<<<<<<<<<<<
*
* return v
*/
__pyx_t_6 = __pyx_convert_vector_from_py_int(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
try {
__pyx_v_v.push_back(((std::vector<int> )__pyx_t_6));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 58, __pyx_L1_error)
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "vector.from_py":60
* v.push_back(<X>item)
*
* return v # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_v;
goto __pyx_L0;
/* "vector.from_py":48
* cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
*
* @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___") # <<<<<<<<<<<<<<
* cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(object o) except *:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_item);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *__pyx_v_o) {
std::vector<double> __pyx_v_v;
Py_ssize_t __pyx_v_s;
PyObject *__pyx_v_item = NULL;
std::vector<double> __pyx_r;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *(*__pyx_t_4)(PyObject *);
PyObject *__pyx_t_5 = NULL;
double __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_double", 0);
/* "vector.from_py":52
*
* cdef vector[X] v
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0) # <<<<<<<<<<<<<<
*
* if s > 0:
*/
__pyx_t_1 = __Pyx_PyObject_LengthHint(__pyx_v_o, 0); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 52, __pyx_L1_error)
__pyx_v_s = __pyx_t_1;
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
__pyx_t_2 = (__pyx_v_s > 0);
if (__pyx_t_2) {
/* "vector.from_py":55
*
* if s > 0:
* v.reserve(<size_t> s) # <<<<<<<<<<<<<<
*
* for item in o:
*/
try {
__pyx_v_v.reserve(((size_t)__pyx_v_s));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 55, __pyx_L1_error)
}
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
__pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_4 = NULL;
} else {
__pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 57, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 57, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
__pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_1);
++__pyx_t_1;
} else {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
#else
__pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
#endif
++__pyx_t_1;
}
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 57, __pyx_L1_error)
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_3);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 57, __pyx_L1_error)
PyErr_Clear();
}
break;
}
}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
__pyx_t_5 = 0;
/* "vector.from_py":58
*
* for item in o:
* v.push_back(<X>item) # <<<<<<<<<<<<<<
*
* return v
*/
__pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_v_item); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
try {
__pyx_v_v.push_back(((double)__pyx_t_6));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 58, __pyx_L1_error)
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "vector.from_py":60
* v.push_back(<X>item)
*
* return v # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_v;
goto __pyx_L0;
/* "vector.from_py":48
* cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
*
* @cname("__pyx_convert_vector_from_py_double") # <<<<<<<<<<<<<<
* cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_item);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *__pyx_v_o) {
std::vector<std::vector<double> > __pyx_v_v;
Py_ssize_t __pyx_v_s;
PyObject *__pyx_v_item = NULL;
std::vector<std::vector<double> > __pyx_r;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *(*__pyx_t_4)(PyObject *);
PyObject *__pyx_t_5 = NULL;
std::vector<double> __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", 0);
/* "vector.from_py":52
*
* cdef vector[X] v
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0) # <<<<<<<<<<<<<<
*
* if s > 0:
*/
__pyx_t_1 = __Pyx_PyObject_LengthHint(__pyx_v_o, 0); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 52, __pyx_L1_error)
__pyx_v_s = __pyx_t_1;
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
__pyx_t_2 = (__pyx_v_s > 0);
if (__pyx_t_2) {
/* "vector.from_py":55
*
* if s > 0:
* v.reserve(<size_t> s) # <<<<<<<<<<<<<<
*
* for item in o:
*/
try {
__pyx_v_v.reserve(((size_t)__pyx_v_s));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 55, __pyx_L1_error)
}
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
__pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_4 = NULL;
} else {
__pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 57, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 57, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
__pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_1);
++__pyx_t_1;
} else {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
#else
__pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
#endif
++__pyx_t_1;
}
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 57, __pyx_L1_error)
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_3);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 57, __pyx_L1_error)
PyErr_Clear();
}
break;
}
}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
__pyx_t_5 = 0;
/* "vector.from_py":58
*
* for item in o:
* v.push_back(<X>item) # <<<<<<<<<<<<<<
*
* return v
*/
__pyx_t_6 = __pyx_convert_vector_from_py_double(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
try {
__pyx_v_v.push_back(((std::vector<double> )__pyx_t_6));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 58, __pyx_L1_error)
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "vector.from_py":60
* v.push_back(<X>item)
*
* return v # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_v;
goto __pyx_L0;
/* "vector.from_py":48
* cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
*
* @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___") # <<<<<<<<<<<<<<
* cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_item);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static std::vector<realtype> __pyx_convert_vector_from_py_realtype(PyObject *__pyx_v_o) {
std::vector<realtype> __pyx_v_v;
Py_ssize_t __pyx_v_s;
PyObject *__pyx_v_item = NULL;
std::vector<realtype> __pyx_r;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *(*__pyx_t_4)(PyObject *);
PyObject *__pyx_t_5 = NULL;
realtype __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_realtype", 0);
/* "vector.from_py":52
*
* cdef vector[X] v
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0) # <<<<<<<<<<<<<<
*
* if s > 0:
*/
__pyx_t_1 = __Pyx_PyObject_LengthHint(__pyx_v_o, 0); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 52, __pyx_L1_error)
__pyx_v_s = __pyx_t_1;
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
__pyx_t_2 = (__pyx_v_s > 0);
if (__pyx_t_2) {
/* "vector.from_py":55
*
* if s > 0:
* v.reserve(<size_t> s) # <<<<<<<<<<<<<<
*
* for item in o:
*/
try {
__pyx_v_v.reserve(((size_t)__pyx_v_s));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 55, __pyx_L1_error)
}
/* "vector.from_py":54
* cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
*
* if s > 0: # <<<<<<<<<<<<<<
* v.reserve(<size_t> s)
*
*/
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
__pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_4 = NULL;
} else {
__pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 57, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 57, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
__pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_1);
++__pyx_t_1;
} else {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
#endif
if (__pyx_t_1 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
#else
__pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
#endif
++__pyx_t_1;
}
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 57, __pyx_L1_error)
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_3);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 57, __pyx_L1_error)
PyErr_Clear();
}
break;
}
}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
__pyx_t_5 = 0;
/* "vector.from_py":58
*
* for item in o:
* v.push_back(<X>item) # <<<<<<<<<<<<<<
*
* return v
*/
__pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_v_item); if (unlikely((__pyx_t_6 == ((realtype)-1)) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
try {
__pyx_v_v.push_back(((realtype)__pyx_t_6));
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(1, 58, __pyx_L1_error)
}
/* "vector.from_py":57
* v.reserve(<size_t> s)
*
* for item in o: # <<<<<<<<<<<<<<
* v.push_back(<X>item)
*
*/
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "vector.from_py":60
* v.push_back(<X>item)
*
* return v # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = __pyx_v_v;
goto __pyx_L0;
/* "vector.from_py":48
* cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
*
* @cname("__pyx_convert_vector_from_py_realtype") # <<<<<<<<<<<<<<
* cdef vector[X] __pyx_convert_vector_from_py_realtype(object o) except *:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_realtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_pretend_to_initialize(&__pyx_r);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_item);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":286
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":288
* @property
* cdef inline npy_intp itemsize(self) noexcept nogil:
* return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDataType_ELSIZE(__pyx_v_self);
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":286
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":290
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":292
* @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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":290
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":296
* # 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":298
* @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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":296
* # 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":300
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":302
* @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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":300
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":307
* # 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":309
* @property
* cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
* return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":307
* # 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":311
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":314
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":311
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":323
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":326
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":323
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":328
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":331
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":328
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":333
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":336
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":333
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":338
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":341
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":338
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":343
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":346
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":343
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":348
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":352
* """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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":348
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":366
* # 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":370
* """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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":366
* # 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":372
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":376
* """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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":372
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":378
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":382
* """Returns the number of dimensions in the array.
* """
* return PyArray_NDIM(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_NDIM(__pyx_v_self);
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":378
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":384
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":390
* Can return NULL for 0-dimensional arrays.
* """
* return PyArray_DIMS(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyArray_DIMS(__pyx_v_self);
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":384
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":392
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":397
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":392
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":399
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":403
* """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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":399
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":405
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":412
* of `PyArray_DATA()` instead, which returns a 'void*'.
* """
* return PyArray_BYTES(self) # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PyArray_BYTES(__pyx_v_self);
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":405
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":824
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":825
*
* 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(2, 825, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":824
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":827
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":828
*
* 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(2, 828, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":827
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":830
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":831
*
* 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(2, 831, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":830
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":833
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":834
*
* 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(2, 834, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":833
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":836
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":837
*
* 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(2, 837, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":836
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":839
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":840
*
* 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) {
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":841
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":840
*
* cdef inline tuple PyDataType_SHAPE(dtype d):
* if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
* return <tuple>d.subarray.shape
* else:
*/
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":843
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":839
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1035
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1036
*
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1037
* 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(2, 1037, __pyx_L1_error)
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1035
* 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:;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1039
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1040
*
* 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);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1041
* 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) {
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1042
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1041
* cdef inline object get_array_base(ndarray arr):
* base = PyArray_BASE(arr)
* if base is NULL: # <<<<<<<<<<<<<<
* return None
* return <object>base
*/
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1043
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1039
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1047
* # 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;
PyObject *__pyx_t_10 = NULL;
size_t __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("import_array", 0);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1048
* # 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:*/ {
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1049
* 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(2, 1049, __pyx_L3_error)
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1048
* # 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:;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1050
* 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(2, 1050, __pyx_L5_except_error)
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1051
* __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_INCREF(__pyx_builtin_ImportError);
__pyx_t_10 = __pyx_builtin_ImportError;
__pyx_t_11 = 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(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1051, __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(2, 1051, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1048
* # 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:;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1047
* # 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_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1053
* 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;
PyObject *__pyx_t_10 = NULL;
size_t __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("import_umath", 0);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1054
*
* 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:*/ {
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1055
* 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(2, 1055, __pyx_L3_error)
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1054
*
* 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:;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1056
* 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(2, 1056, __pyx_L5_except_error)
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1057
* _import_umath()
* except Exception:
* raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
*
* cdef inline int import_ufunc() except -1:
*/
__pyx_t_9 = NULL;
__Pyx_INCREF(__pyx_builtin_ImportError);
__pyx_t_10 = __pyx_builtin_ImportError;
__pyx_t_11 = 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(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1057, __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(2, 1057, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1054
*
* 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:;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1053
* 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_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1059
* 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;
PyObject *__pyx_t_10 = NULL;
size_t __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("import_ufunc", 0);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1060
*
* 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:*/ {
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1061
* 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(2, 1061, __pyx_L3_error)
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1060
*
* 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:;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1062
* 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(2, 1062, __pyx_L5_except_error)
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1063
* _import_umath()
* except Exception:
* raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_9 = NULL;
__Pyx_INCREF(__pyx_builtin_ImportError);
__pyx_t_10 = __pyx_builtin_ImportError;
__pyx_t_11 = 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(__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1063, __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(2, 1063, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1060
*
* 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:;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1059
* 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_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1066
*
*
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1078
* bool
* """
* return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1066
*
*
* cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
* """
* Cython equivalent of `isinstance(obj, np.timedelta64)`
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1081
*
*
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1093
* bool
* """
* return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1081
*
*
* cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
* """
* Cython equivalent of `isinstance(obj, np.datetime64)`
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1096
*
*
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1103
* also needed. That can be found using `get_datetime64_unit`.
* """
* return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1096
*
*
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1106
*
*
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1110
* returns the int64 value underlying scalar numpy timedelta64 object
* """
* return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
goto __pyx_L0;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1106
*
*
* 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;
}
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1113
*
*
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1117
* 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;
/* "../../../opt-3/cpython-v3.13-apt-deb/lib/python3.13/site-packages/numpy/__init__.cython-30.pxd":1113
*
*
* 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;
}
/* "chemreac/_chemreac.pyx":34
* cdef public dict __array_interface__
*
* def __init__(self, **kwargs): # <<<<<<<<<<<<<<
* self.__array_interface__ = kwargs
*
*/
/* Python wrapper */
static int __pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
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 = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return -1;
if (__pyx_kwds_len > 0) {
if (unlikely(__Pyx_CheckKeywordStrings("__init__", __pyx_kwds) == -1)) return -1;
__pyx_v_kwargs = __Pyx_KwargsAsDict_VARARGS(__pyx_kwds, __pyx_kwvalues);
if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
} else {
__pyx_v_kwargs = PyDict_New();
if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
}
__pyx_r = __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper___init__(((struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
__Pyx_DECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper___init__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self, PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
/* "chemreac/_chemreac.pyx":35
*
* def __init__(self, **kwargs):
* self.__array_interface__ = kwargs # <<<<<<<<<<<<<<
*
*
*/
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
__Pyx_GOTREF(__pyx_v_self->__pyx___array_interface__);
__Pyx_DECREF(__pyx_v_self->__pyx___array_interface__);
__pyx_v_self->__pyx___array_interface__ = __pyx_v_kwargs;
/* "chemreac/_chemreac.pyx":34
* cdef public dict __array_interface__
*
* def __init__(self, **kwargs): # <<<<<<<<<<<<<<
* self.__array_interface__ = kwargs
*
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "chemreac/_chemreac.pyx":32
*
* cdef class ArrayWrapper(object):
* cdef public dict __array_interface__ # <<<<<<<<<<<<<<
*
* def __init__(self, **kwargs):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_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_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface_____get__(((struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface_____get__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__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;
}
/* Python wrapper */
static int __pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___2__set__(((struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___2__set__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __pyx_v_value;
__Pyx_INCREF(__pyx_t_1);
if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 32, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___array_interface__);
__Pyx_DECREF(__pyx_v_self->__pyx___array_interface__);
__pyx_v_self->__pyx___array_interface__ = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("chemreac._chemreac.ArrayWrapper.__array_interface__.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___5__del__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_r = __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___4__del__(((struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_19__array_interface___4__del__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__", 0);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->__pyx___array_interface__);
__Pyx_DECREF(__pyx_v_self->__pyx___array_interface__);
__pyx_v_self->__pyx___array_interface__ = ((PyObject*)Py_None);
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "(tree fragment)":1
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
* cdef tuple state
* cdef object _dict
*/
/* Python wrapper */
static PyObject *__pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_3__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_8chemreac_9_chemreac_12ArrayWrapper_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_3__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_8chemreac_9_chemreac_12ArrayWrapper_2__reduce_cython__(((struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_2__reduce_cython__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
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.__array_interface__,) # <<<<<<<<<<<<<<
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_self->__pyx___array_interface__);
__Pyx_GIVEREF(__pyx_v_self->__pyx___array_interface__);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx___array_interface__) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
__pyx_v_state = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "(tree fragment)":6
* cdef bint use_setstate
* state = (self.__array_interface__,)
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
* if _dict is not None:
* state += (_dict,)
*/
__pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__dict = __pyx_t_1;
__pyx_t_1 = 0;
/* "(tree fragment)":7
* state = (self.__array_interface__,)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
__pyx_t_2 = (__pyx_v__dict != Py_None);
if (__pyx_t_2) {
/* "(tree fragment)":8
* _dict = getattr(self, '__dict__', None)
* if _dict is not None:
* state += (_dict,) # <<<<<<<<<<<<<<
* use_setstate = True
* else:
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v__dict);
__Pyx_GIVEREF(__pyx_v__dict);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
__pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
__pyx_t_3 = 0;
/* "(tree fragment)":9
* if _dict is not None:
* state += (_dict,)
* use_setstate = True # <<<<<<<<<<<<<<
* else:
* use_setstate = self.__array_interface__ is not None
*/
__pyx_v_use_setstate = 1;
/* "(tree fragment)":7
* state = (self.__array_interface__,)
* _dict = getattr(self, '__dict__', None)
* if _dict is not None: # <<<<<<<<<<<<<<
* state += (_dict,)
* use_setstate = True
*/
goto __pyx_L3;
}
/* "(tree fragment)":11
* use_setstate = True
* else:
* use_setstate = self.__array_interface__ is not None # <<<<<<<<<<<<<<
* if use_setstate:
* return __pyx_unpickle_ArrayWrapper, (type(self), 0x00ad8de, None), state
*/
/*else*/ {
__pyx_t_2 = (__pyx_v_self->__pyx___array_interface__ != ((PyObject*)Py_None));
__pyx_v_use_setstate = __pyx_t_2;
}
__pyx_L3:;
/* "(tree fragment)":12
* else:
* use_setstate = self.__array_interface__ is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_ArrayWrapper, (type(self), 0x00ad8de, None), state
* else:
*/
if (__pyx_v_use_setstate) {
/* "(tree fragment)":13
* use_setstate = self.__array_interface__ is not None
* if use_setstate:
* return __pyx_unpickle_ArrayWrapper, (type(self), 0x00ad8de, None), state # <<<<<<<<<<<<<<
* else:
* return __pyx_unpickle_ArrayWrapper, (type(self), 0x00ad8de, state)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ArrayWrapper); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_710878);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_710878);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_710878) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
__pyx_t_3 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "(tree fragment)":12
* else:
* use_setstate = self.__array_interface__ is not None
* if use_setstate: # <<<<<<<<<<<<<<
* return __pyx_unpickle_ArrayWrapper, (type(self), 0x00ad8de, None), state
* else:
*/
}
/* "(tree fragment)":15
* return __pyx_unpickle_ArrayWrapper, (type(self), 0x00ad8de, None), state
* else:
* return __pyx_unpickle_ArrayWrapper, (type(self), 0x00ad8de, state) # <<<<<<<<<<<<<<
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_ArrayWrapper__set_state(self, __pyx_state)
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ArrayWrapper); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_710878);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_710878);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_710878) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_state);
__Pyx_GIVEREF(__pyx_v_state);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
__pyx_t_4 = 0;
__pyx_t_1 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("chemreac._chemreac.ArrayWrapper.__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_ArrayWrapper, (type(self), 0x00ad8de, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_ArrayWrapper__set_state(self, __pyx_state)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_5__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_8chemreac_9_chemreac_12ArrayWrapper_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8chemreac_9_chemreac_12ArrayWrapper_5__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(1, 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(1, 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(1, 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(1, 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(1, 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(1, 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("chemreac._chemreac.ArrayWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8chemreac_9_chemreac_12ArrayWrapper_4__setstate_cython__(((struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *)__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_8chemreac_9_chemreac_12ArrayWrapper_4__setstate_cython__(struct __pyx_obj_8chemreac_9_chemreac_ArrayWrapper *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
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("__setstate_cython__", 0);
/* "(tree fragment)":17
* return __pyx_unpickle_ArrayWrapper, (type(self), 0x00ad8de, state)
* def __setstate_cython__(self, __pyx_state):
* __pyx_unpickle_ArrayWrapper__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
*/
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
__pyx_t_1 = __pyx_f_8chemreac_9_chemreac___pyx_unpickle_ArrayWrapper__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "(tree fragment)":16
* else:
* return __pyx_unpickle_ArrayWrapper, (type(self), 0x00ad8de, state)
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
* __pyx_unpickle_ArrayWrapper__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_AddTraceback("chemreac._chemreac.ArrayWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "chemreac/_chemreac.pyx":38
*
*
* cdef fromaddress(address, shape, dtype=np.float64, strides=None, ro=True): # <<<<<<<<<<<<<<
* dtype = np.dtype(dtype)
* return np.asarray(ArrayWrapper(
*/
static PyObject *__pyx_f_8chemreac_9_chemreac_fromaddress(PyObject *__pyx_v_address, PyObject *__pyx_v_shape, struct __pyx_opt_args_8chemreac_9_chemreac_fromaddress *__pyx_optional_args) {
PyObject *__pyx_v_dtype = __pyx_mstate_global->__pyx_k__6;
PyObject *__pyx_v_strides = ((PyObject *)Py_None);
PyObject *__pyx_v_ro = ((PyObject *)Py_True);
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;
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fromaddress", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_dtype = __pyx_optional_args->dtype;
if (__pyx_optional_args->__pyx_n > 1) {
__pyx_v_strides = __pyx_optional_args->strides;
if (__pyx_optional_args->__pyx_n > 2) {
__pyx_v_ro = __pyx_optional_args->ro;
}
}
}
}
__Pyx_INCREF(__pyx_v_dtype);
/* "chemreac/_chemreac.pyx":39
*
* cdef fromaddress(address, shape, dtype=np.float64, strides=None, ro=True):
* dtype = np.dtype(dtype) # <<<<<<<<<<<<<<
* return np.asarray(ArrayWrapper(
* data=(address, ro),
*/
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = 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_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_dtype};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __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_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_1);
__pyx_t_1 = 0;
/* "chemreac/_chemreac.pyx":40
* cdef fromaddress(address, shape, dtype=np.float64, strides=None, ro=True):
* dtype = np.dtype(dtype)
* return np.asarray(ArrayWrapper( # <<<<<<<<<<<<<<
* data=(address, ro),
* typestr=dtype.str,
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = NULL;
__Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8chemreac_9_chemreac_ArrayWrapper);
__pyx_t_7 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_8chemreac_9_chemreac_ArrayWrapper);
/* "chemreac/_chemreac.pyx":41
* dtype = np.dtype(dtype)
* return np.asarray(ArrayWrapper(
* data=(address, ro), # <<<<<<<<<<<<<<
* typestr=dtype.str,
* descr=dtype.descr,
*/
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_address);
__Pyx_GIVEREF(__pyx_v_address);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_address) != (0)) __PYX_ERR(0, 41, __pyx_L1_error);
__Pyx_INCREF(__pyx_v_ro);
__Pyx_GIVEREF(__pyx_v_ro);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_ro) != (0)) __PYX_ERR(0, 41, __pyx_L1_error);
/* "chemreac/_chemreac.pyx":42
* return np.asarray(ArrayWrapper(
* data=(address, ro),
* typestr=dtype.str, # <<<<<<<<<<<<<<
* descr=dtype.descr,
* shape=shape,
*/
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_str); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
/* "chemreac/_chemreac.pyx":43
* data=(address, ro),
* typestr=dtype.str,
* descr=dtype.descr, # <<<<<<<<<<<<<<
* shape=shape,
* strides=strides,
*/
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_descr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 43, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
/* "chemreac/_chemreac.pyx":45
* descr=dtype.descr,
* shape=shape,
* strides=strides, # <<<<<<<<<<<<<<
* version=3,
* ))
*/
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 6 : 0)] = {__pyx_t_6, NULL};
__pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 40, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_typestr, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_descr, __pyx_t_10, __pyx_t_11, __pyx_callargs+1, 2) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_shape, __pyx_v_shape, __pyx_t_11, __pyx_callargs+1, 3) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_strides, __pyx_v_strides, __pyx_t_11, __pyx_callargs+1, 4) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_version, __pyx_mstate_global->__pyx_int_3, __pyx_t_11, __pyx_callargs+1, 5) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
__pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
__Pyx_GOTREF((PyObject *)__pyx_t_2);
}
__pyx_t_5 = 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_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_2)};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF((PyObject *)__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "chemreac/_chemreac.pyx":38
*
*
* cdef fromaddress(address, shape, dtype=np.float64, strides=None, ro=True): # <<<<<<<<<<<<<<
* dtype = np.dtype(dtype)
* return np.asarray(ArrayWrapper(
*/
/* 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_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_AddTraceback("chemreac._chemreac.fromaddress", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "chemreac/_chemreac.pyx":58
* cdef public list names, tex_names
*
* def __cinit__(self, # <<<<<<<<<<<<<<
* int n,
* vector[vector[int]] stoich_active,
*/
/* Python wrapper */
static int __pyx_pw_8chemreac_9_chemreac_19PyReactionDiffusion_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8chemreac_9_chemreac_19PyReactionDiffusion_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_n;
std::vector<std::vector<int> > __pyx_v_stoich_active;
std::vector<std::vector<int> > __pyx_v_stoich_prod;
std::vector<double> __pyx_v_k;
int __pyx_v_N;
std::vector<double> __pyx_v_D;
std::vector<int> __pyx_v_z_chg;
std::vector<double> __pyx_v_mobility;
std::vector<double> __pyx_v_x;
std::vector<std::vector<int> > __pyx_v_stoich_inact;
int __pyx_v_geom;
int __pyx_v_logy;
int __pyx_v_logt;
int __pyx_v_logx;
std::vector<std::vector<double> > __pyx_v_g_values;
std::vector<int> __pyx_v_g_value_parents;
std::vector<std::vector<double> > __pyx_v_fields;
std::vector<int> __pyx_v_modulated_rxns;
std::vector<std::vector<double> > __pyx_v_modulation;
int __pyx_v_nstencil;
int __pyx_v_lrefl;
int __pyx_v_rrefl;
int __pyx_v_auto_efield;
std::pair<double,double> __pyx_v_surf_chg;
double __pyx_v_eps_rel;
double __pyx_v_faraday_const;
double __pyx_v_vacuum_permittivity;
double __pyx_v_ilu_limit;
int __pyx_v_n_jac_diags;
int __pyx_v_use_log2;
int __pyx_v_clip_to_pos;
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[31] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
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);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_stoich_active,&__pyx_mstate_global->__pyx_n_u_stoich_prod,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_N,&__pyx_mstate_global->__pyx_n_u_D,&__pyx_mstate_global->__pyx_n_u_z_chg,&__pyx_mstate_global->__pyx_n_u_mobility,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_stoich_inact,&__pyx_mstate_global->__pyx_n_u_geom,&__pyx_mstate_global->__pyx_n_u_logy,&__pyx_mstate_global->__pyx_n_u_logt,&__pyx_mstate_global->__pyx_n_u_logx,&__pyx_mstate_global->__pyx_n_u_g_values,&__pyx_mstate_global->__pyx_n_u_g_value_parents,&__pyx_mstate_global->__pyx_n_u_fields,&__pyx_mstate_global->__pyx_n_u_modulated_rxns,&__pyx_mstate_global->__pyx_n_u_modulation,&__pyx_mstate_global->__pyx_n_u_nstencil,&__pyx_mstate_global->__pyx_n_u_lrefl,&__pyx_mstate_global->__pyx_n_u_rrefl,&__pyx_mstate_global->__pyx_n_u_auto_efield,&__pyx_mstate_global->__pyx_n_u_surf_chg,&__pyx_mstate_global->__pyx_n_u_eps_rel,&__pyx_mstate_global->__pyx_n_u_faraday_const,&__pyx_mstate_global->__pyx_n_u_vacuum_permittivity,&__pyx_mstate_global->__pyx_n_u_ilu_limit,&__pyx_mstate_global->__pyx_n_u_n_jac_diags,&__pyx_mstate_global->__pyx_n_u_use_log2,&__pyx_mstate_global->__pyx_n_u_clip_to_pos,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, 58, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 31:
values[30] = __Pyx_ArgRef_VARARGS(__pyx_args, 30);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[30])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 30:
values[29] = __Pyx_ArgRef_VARARGS(__pyx_args, 29);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[29])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 29:
values[28] = __Pyx_ArgRef_VARARGS(__pyx_args, 28);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[28])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 28:
values[27] = __Pyx_ArgRef_VARARGS(__pyx_args, 27);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[27])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 27:
values[26] = __Pyx_ArgRef_VARARGS(__pyx_args, 26);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 26:
values[25] = __Pyx_ArgRef_VARARGS(__pyx_args, 25);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 25:
values[24] = __Pyx_ArgRef_VARARGS(__pyx_args, 24);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 24:
values[23] = __Pyx_ArgRef_VARARGS(__pyx_args, 23);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 23:
values[22] = __Pyx_ArgRef_VARARGS(__pyx_args, 22);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 22:
values[21] = __Pyx_ArgRef_VARARGS(__pyx_args, 21);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 21:
values[20] = __Pyx_ArgRef_VARARGS(__pyx_args, 20);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 20:
values[19] = __Pyx_ArgRef_VARARGS(__pyx_args, 19);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 19:
values[18] = __Pyx_ArgRef_VARARGS(__pyx_args, 18);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 18:
values[17] = __Pyx_ArgRef_VARARGS(__pyx_args, 17);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 17:
values[16] = __Pyx_ArgRef_VARARGS(__pyx_args, 16);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 16:
values[15] = __Pyx_ArgRef_VARARGS(__pyx_args, 15);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 15:
values[14] = __Pyx_ArgRef_VARARGS(__pyx_args, 14);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 14:
values[13] = __Pyx_ArgRef_VARARGS(__pyx_args, 13);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 13:
values[12] = __Pyx_ArgRef_VARARGS(__pyx_args, 12);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 12:
values[11] = __Pyx_ArgRef_VARARGS(__pyx_args, 11);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 11:
values[10] = __Pyx_ArgRef_VARARGS(__pyx_args, 10);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 10:
values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 9:
values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 8:
values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 7:
values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 6:
values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 58, __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, 58, __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, 58, __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, 58, __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, 58, __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, 58, __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, "__cinit__", 0) < 0) __PYX_ERR(0, 58, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 19; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 19, 31, i); __PYX_ERR(0, 58, __pyx_L3_error) }
}
} else {
switch (__pyx_nargs) {
case 31:
values[30] = __Pyx_ArgRef_VARARGS(__pyx_args, 30);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[30])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 30:
values[29] = __Pyx_ArgRef_VARARGS(__pyx_args, 29);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[29])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 29:
values[28] = __Pyx_ArgRef_VARARGS(__pyx_args, 28);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[28])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 28:
values[27] = __Pyx_ArgRef_VARARGS(__pyx_args, 27);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[27])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 27:
values[26] = __Pyx_ArgRef_VARARGS(__pyx_args, 26);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 26:
values[25] = __Pyx_ArgRef_VARARGS(__pyx_args, 25);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 25:
values[24] = __Pyx_ArgRef_VARARGS(__pyx_args, 24);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 24:
values[23] = __Pyx_ArgRef_VARARGS(__pyx_args, 23);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 23:
values[22] = __Pyx_ArgRef_VARARGS(__pyx_args, 22);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 22:
values[21] = __Pyx_ArgRef_VARARGS(__pyx_args, 21);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 21:
values[20] = __Pyx_ArgRef_VARARGS(__pyx_args, 20);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 20:
values[19] = __Pyx_ArgRef_VARARGS(__pyx_args, 19);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 58, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 19:
values[18] = __Pyx_ArgRef_VARARGS(__pyx_args, 18);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 58, __pyx_L3_error)
values[17] = __Pyx_ArgRef_VARARGS(__pyx_args, 17);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 58, __pyx_L3_error)
values[16] = __Pyx_ArgRef_VARARGS(__pyx_args, 16);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 58, __pyx_L3_error)
values[15] = __Pyx_ArgRef_VARARGS(__pyx_args, 15);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 58, __pyx_L3_error)
values[14] = __Pyx_ArgRef_VARARGS(__pyx_args, 14);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 58, __pyx_L3_error)
values[13] = __Pyx_ArgRef_VARARGS(__pyx_args, 13);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 58, __pyx_L3_error)
values[12] = __Pyx_ArgRef_VARARGS(__pyx_args, 12);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 58, __pyx_L3_error)
values[11] = __Pyx_ArgRef_VARARGS(__pyx_args, 11);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 58, __pyx_L3_error)
values[10] = __Pyx_ArgRef_VARARGS(__pyx_args, 10);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 58, __pyx_L3_error)
values[9] = __Pyx_ArgRef_VARARGS(__pyx_args, 9);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 58, __pyx_L3_error)
values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 58, __pyx_L3_error)
values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 58, __pyx_L3_error)
values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 58, __pyx_L3_error)
values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 58, __pyx_L3_error)
values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 58, __pyx_L3_error)
values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 58, __pyx_L3_error)
values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 58, __pyx_L3_error)
values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 58, __pyx_L3_error)
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 58, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_n = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error)
__pyx_v_stoich_active = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L3_error)
__pyx_v_stoich_prod = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[2]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error)
__pyx_v_k = __pyx_convert_vector_from_py_double(values[3]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L3_error)
__pyx_v_N = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error)
__pyx_v_D = __pyx_convert_vector_from_py_double(values[5]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L3_error)
__pyx_v_z_chg = __pyx_convert_vector_from_py_int(values[6]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error)
__pyx_v_mobility = __pyx_convert_vector_from_py_double(values[7]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
__pyx_v_x = __pyx_convert_vector_from_py_double(values[8]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error)
__pyx_v_stoich_inact = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_int_3e___(values[9]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
__pyx_v_geom = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_geom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error)
__pyx_v_logy = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_logy == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error)
__pyx_v_logt = __Pyx_PyObject_IsTrue(values[12]); if (unlikely((__pyx_v_logt == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error)
__pyx_v_logx = __Pyx_PyObject_IsTrue(values[13]); if (unlikely((__pyx_v_logx == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error)
__pyx_v_g_values = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(values[14]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error)
__pyx_v_g_value_parents = __pyx_convert_vector_from_py_int(values[15]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error)
__pyx_v_fields = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(values[16]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error)
__pyx_v_modulated_rxns = __pyx_convert_vector_from_py_int(values[17]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error)
__pyx_v_modulation = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(values[18]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error)
if (values[19]) {
__pyx_v_nstencil = __Pyx_PyLong_As_int(values[19]); if (unlikely((__pyx_v_nstencil == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error)
} else {
__pyx_v_nstencil = ((int)3);
}
if (values[20]) {
__pyx_v_lrefl = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_lrefl == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
} else {
/* "chemreac/_chemreac.pyx":79
* vector[vector[double]] modulation,
* int nstencil=3,
* bint lrefl=True, # <<<<<<<<<<<<<<
* bint rrefl=True,
* bint auto_efield=False,
*/
__pyx_v_lrefl = ((int)1);
}
if (values[21]) {
__pyx_v_rrefl = __Pyx_PyObject_IsTrue(values[21]); if (unlikely((__pyx_v_rrefl == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)
} else {
/* "chemreac/_chemreac.pyx":80
* int nstencil=3,
* bint lrefl=True,
* bint rrefl=True, # <<<<<<<<<<<<<<
* bint auto_efield=False,
* pair[double, double] surf_chg=(0, 0),
*/
__pyx_v_rrefl = ((int)1);
}
if (values[22]) {
__pyx_v_auto_efield = __Pyx_PyObject_IsTrue(values[22]); if (unlikely((__pyx_v_auto_efield == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L3_error)
} else {
/* "chemreac/_chemreac.pyx":81
* bint lrefl=True,
* bint rrefl=True,
* bint auto_efield=False, # <<<<<<<<<<<<<<
* pair[double, double] surf_chg=(0, 0),
* double eps_rel=1.0,
*/
__pyx_v_auto_efield = ((int)0);
}
if (values[23]) {
__pyx_v_surf_chg = __pyx_convert_pair_from_py_double__and_double(values[23]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error)
} else {
__pyx_v_surf_chg = __pyx_mstate_global->__pyx_k__7;
}
if (values[24]) {
__pyx_v_eps_rel = __Pyx_PyFloat_AsDouble(values[24]); if (unlikely((__pyx_v_eps_rel == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error)
} else {
__pyx_v_eps_rel = ((double)1.0);
}
if (values[25]) {
__pyx_v_faraday_const = __Pyx_PyFloat_AsDouble(values[25]); if (unlikely((__pyx_v_faraday_const == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error)
} else {
__pyx_v_faraday_const = ((double)9.64853399e4);
}
if (values[26]) {
__pyx_v_vacuum_permittivity = __Pyx_PyFloat_AsDouble(values[26]); if (unlikely((__pyx_v_vacuum_permittivity == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L3_error)
} else {
__pyx_v_vacuum_permittivity = ((double)8.854187817e-12);
}
if (values[27]) {
__pyx_v_ilu_limit = __Pyx_PyFloat_AsDouble(values[27]); if (unlikely((__pyx_v_ilu_limit == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
} else {
__pyx_v_ilu_limit = ((double)1000.0);
}
if (values[28]) {
__pyx_v_n_jac_diags = __Pyx_PyLong_As_int(values[28]); if (unlikely((__pyx_v_n_jac_diags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error)
} else {
__pyx_v_n_jac_diags = ((int)1);
}
if (values[29]) {
__pyx_v_use_log2 = __Pyx_PyObject_IsTrue(values[29]); if (unlikely((__pyx_v_use_log2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error)
} else {
/* "chemreac/_chemreac.pyx":88
* double ilu_limit=1000.0,
* int n_jac_diags=1,
* bint use_log2=False, # <<<<<<<<<<<<<<
* bint clip_to_pos=False
* ):
*/
__pyx_v_use_log2 = ((int)0);
}
if (values[30]) {
__pyx_v_clip_to_pos = __Pyx_PyObject_IsTrue(values[30]); if (unlikely((__pyx_v_clip_to_pos == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error)
} else {
/* "chemreac/_chemreac.pyx":89
* int n_jac_diags=1,
* bint use_log2=False,
* bint clip_to_pos=False # <<<<<<<<<<<<<<
* ):
* cdef size_t i
*/
__pyx_v_clip_to_pos = ((int)0);
}
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 19, 31, __pyx_nargs); __PYX_ERR(0, 58, __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("chemreac._chemreac.PyReactionDiffusion.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion___cinit__(((struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *)__pyx_v_self), __pyx_v_n, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_stoich_active), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_stoich_prod), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_k), __pyx_v_N, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_D), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_z_chg), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_mobility), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_x), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_stoich_inact), __pyx_v_geom, __pyx_v_logy, __pyx_v_logt, __pyx_v_logx, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_g_values), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_g_value_parents), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_fields), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_modulated_rxns), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_modulation), __pyx_v_nstencil, __pyx_v_lrefl, __pyx_v_rrefl, __pyx_v_auto_efield, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_surf_chg), __pyx_v_eps_rel, __pyx_v_faraday_const, __pyx_v_vacuum_permittivity, __pyx_v_ilu_limit, __pyx_v_n_jac_diags, __pyx_v_use_log2, __pyx_v_clip_to_pos);
/* "chemreac/_chemreac.pyx":58
* cdef public list names, tex_names
*
* def __cinit__(self, # <<<<<<<<<<<<<<
* int n,
* vector[vector[int]] stoich_active,
*/
/* 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_8chemreac_9_chemreac_19PyReactionDiffusion___cinit__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self, int __pyx_v_n, std::vector<std::vector<int> > __pyx_v_stoich_active, std::vector<std::vector<int> > __pyx_v_stoich_prod, std::vector<double> __pyx_v_k, int __pyx_v_N, std::vector<double> __pyx_v_D, std::vector<int> __pyx_v_z_chg, std::vector<double> __pyx_v_mobility, std::vector<double> __pyx_v_x, std::vector<std::vector<int> > __pyx_v_stoich_inact, int __pyx_v_geom, int __pyx_v_logy, int __pyx_v_logt, int __pyx_v_logx, std::vector<std::vector<double> > __pyx_v_g_values, std::vector<int> __pyx_v_g_value_parents, std::vector<std::vector<double> > __pyx_v_fields, std::vector<int> __pyx_v_modulated_rxns, std::vector<std::vector<double> > __pyx_v_modulation, int __pyx_v_nstencil, int __pyx_v_lrefl, int __pyx_v_rrefl, int __pyx_v_auto_efield, std::pair<double,double> __pyx_v_surf_chg, double __pyx_v_eps_rel, double __pyx_v_faraday_const, double __pyx_v_vacuum_permittivity, double __pyx_v_ilu_limit, int __pyx_v_n_jac_diags, int __pyx_v_use_log2, int __pyx_v_clip_to_pos) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
std::vector<double> __pyx_t_4;
chemreac::ReactionDiffusion<double> *__pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "chemreac/_chemreac.pyx":92
* ):
* cdef size_t i
* if D.size() == <unsigned>(n): # <<<<<<<<<<<<<<
* D = list(D)*N
*
*/
__pyx_t_1 = (__pyx_v_D.size() == ((unsigned int)__pyx_v_n));
if (__pyx_t_1) {
/* "chemreac/_chemreac.pyx":93
* cdef size_t i
* if D.size() == <unsigned>(n):
* D = list(D)*N # <<<<<<<<<<<<<<
*
* self.thisptr = new ReactionDiffusion[double](
*/
__pyx_t_2 = __pyx_convert_vector_to_py_double(__pyx_v_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_t_3, __pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = __pyx_convert_vector_from_py_double(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_D = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);
/* "chemreac/_chemreac.pyx":92
* ):
* cdef size_t i
* if D.size() == <unsigned>(n): # <<<<<<<<<<<<<<
* D = list(D)*N
*
*/
}
/* "chemreac/_chemreac.pyx":95
* D = list(D)*N
*
* self.thisptr = new ReactionDiffusion[double]( # <<<<<<<<<<<<<<
* n, stoich_active, stoich_prod, k, N,
* D, z_chg, mobility, x, stoich_inact, geom,
*/
try {
__pyx_t_5 = new chemreac::ReactionDiffusion<double> (__pyx_v_n, __pyx_v_stoich_active, __pyx_v_stoich_prod, __pyx_v_k, __pyx_v_N, __pyx_v_D, __pyx_v_z_chg, __pyx_v_mobility, __pyx_v_x, __pyx_v_stoich_inact, __pyx_v_geom, __pyx_v_logy, __pyx_v_logt, __pyx_v_logx, __pyx_v_nstencil, __pyx_v_lrefl, __pyx_v_rrefl, __pyx_v_auto_efield, __pyx_v_surf_chg, __pyx_v_eps_rel, __pyx_v_faraday_const, __pyx_v_vacuum_permittivity, __pyx_v_g_values, __pyx_v_g_value_parents, __pyx_v_fields, __pyx_v_modulated_rxns, __pyx_v_modulation, __pyx_v_ilu_limit, __pyx_v_n_jac_diags, __pyx_v_use_log2, __pyx_v_clip_to_pos);
} catch(...) {
__Pyx_CppExn2PyErr();
__PYX_ERR(0, 95, __pyx_L1_error)
}
__pyx_v_self->thisptr = __pyx_t_5;
/* "chemreac/_chemreac.pyx":102
* vacuum_permittivity, g_values, g_value_parents, fields,
* modulated_rxns, modulation, ilu_limit, n_jac_diags, use_log2, clip_to_pos)
* self.thisptr.autonomous_exprs = True # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_v_self->thisptr->autonomous_exprs = 1;
/* "chemreac/_chemreac.pyx":58
* cdef public list names, tex_names
*
* def __cinit__(self, # <<<<<<<<<<<<<<
* int n,
* vector[vector[int]] stoich_active,
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("chemreac._chemreac.PyReactionDiffusion.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "chemreac/_chemreac.pyx":104
* self.thisptr.autonomous_exprs = True
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* del self.thisptr
*
*/
/* Python wrapper */
static void __pyx_pw_8chemreac_9_chemreac_19PyReactionDiffusion_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8chemreac_9_chemreac_19PyReactionDiffusion_3__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_8chemreac_9_chemreac_19PyReactionDiffusion_2__dealloc__(((struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_8chemreac_9_chemreac_19PyReactionDiffusion_2__dealloc__(struct __pyx_obj_8chemreac_9_chemreac_PyReactionDiffusion *__pyx_v_self) {
/* "chemreac/_chemreac.pyx":105
*
* def __dealloc__(self):
* del self.thisptr # <<<<<<<<<<<<<<
*
* def f(self, double t, cnp.ndarray[cnp.float64_t, ndim=1] y,
*/
delete __pyx_v_self->thisptr;
/* "chemreac/_chemreac.pyx":104
* self.thisptr.autonomous_exprs = True
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* del self.thisptr
*
*/
/* function exit code */
}
/* "chemreac/_chemreac.pyx":107
* del self.thisptr
*
* def f(self, double t, cnp.ndarray[cnp.float64_t, ndim=1] y, # <<<<<<<<<<<<<<
* cnp.ndarray[cnp.float64_t, ndim=1] fout):
* assert y.size == fout.size
*/
/* Python wrapper */
static PyObject *__pyx_pw_8chemreac_9_chemreac_19PyReactionDiffusion_5f(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_8chemreac_9_chemreac_19PyReactionDiffusion_5f = {"f", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8chemreac_9_chemreac_19PyReactionDiffusion_5f, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8chemreac_9_chemreac_19PyReactionDiffusion_5f(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
) {
double __pyx_v_t;
PyArrayObject *__pyx_v_y = 0;
PyArrayObject *__pyx_v_fout = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject* values[3] = {0,0,0};
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("f (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_t,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_fout,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, 107, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 107, __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, 107, __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, 107, __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, "f", 0) < 0) __PYX_ERR(0, 107, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("f", 1, 3, 3, i); __PYX_ERR(0, 107, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 3)) {
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, 107, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 107, __pyx_L3_error)
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 107, __pyx_L3_error)
}
__pyx_v_t = __Pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_t == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
__pyx_v_y = ((PyArrayObject *)
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment