/* Generated by Cython 0.23.4 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_23_4"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#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
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#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 && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#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
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#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 PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__pandas___sparse
#define __PYX_HAVE_API__pandas___sparse
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#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_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 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)))  )
#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) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _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 char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#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 PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((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_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#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__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <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


static const char *__pyx_f[] = {
  "pandas/src/sparse.pyx",
  "pandas/src/numpy.pxd",
  "type.pxd",
};
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  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_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;


/* "numpy.pxd":726
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "numpy.pxd":727
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "numpy.pxd":728
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "numpy.pxd":729
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "numpy.pxd":733
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "numpy.pxd":734
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "numpy.pxd":735
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "numpy.pxd":736
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "numpy.pxd":740
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float16    float16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t
 */
typedef npy_float16 __pyx_t_5numpy_float16_t;

/* "numpy.pxd":741
 * 
 * ctypedef npy_float16    float16_t
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "numpy.pxd":742
 * ctypedef npy_float16    float16_t
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "numpy.pxd":751
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "numpy.pxd":752
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "numpy.pxd":753
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "numpy.pxd":755
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "numpy.pxd":756
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "numpy.pxd":757
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "numpy.pxd":759
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "numpy.pxd":760
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "numpy.pxd":762
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "numpy.pxd":763
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "numpy.pxd":764
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif


/*--- Type declarations ---*/
struct __pyx_obj_6pandas_7_sparse_SparseIndex;
struct __pyx_obj_6pandas_7_sparse_IntIndex;
struct __pyx_obj_6pandas_7_sparse_BlockIndex;
struct __pyx_obj_6pandas_7_sparse_BlockMerge;
struct __pyx_obj_6pandas_7_sparse_BlockIntersection;
struct __pyx_obj_6pandas_7_sparse_BlockUnion;

/* "numpy.pxd":766
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "numpy.pxd":767
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "numpy.pxd":768
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "numpy.pxd":770
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;

/* "pandas/src/sparse.pyx":734
 * # Sparse arithmetic
 * 
 * ctypedef float64_t (* double_func)(float64_t a, float64_t b)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_5numpy_float64_t (*__pyx_t_6pandas_7_sparse_double_func)(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t);

/* "pandas/src/sparse.pyx":34
 * 
 * 
 * cdef class SparseIndex:             # <<<<<<<<<<<<<<
 *     """
 *     Abstract superclass for sparse index types
 */
struct __pyx_obj_6pandas_7_sparse_SparseIndex {
  PyObject_HEAD
};


/* "pandas/src/sparse.pyx":42
 * 
 * 
 * cdef class IntIndex(SparseIndex):             # <<<<<<<<<<<<<<
 *     """
 *     Object for holding exact integer sparse indexing information
 */
struct __pyx_obj_6pandas_7_sparse_IntIndex {
  struct __pyx_obj_6pandas_7_sparse_SparseIndex __pyx_base;
  struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *__pyx_vtab;
  Py_ssize_t length;
  Py_ssize_t npoints;
  PyArrayObject *indices;
};


/* "pandas/src/sparse.pyx":274
 * # BlockIndex
 * 
 * cdef class BlockIndex(SparseIndex):             # <<<<<<<<<<<<<<
 *     """
 *     Object for holding block-based sparse indexing information
 */
struct __pyx_obj_6pandas_7_sparse_BlockIndex {
  struct __pyx_obj_6pandas_7_sparse_SparseIndex __pyx_base;
  struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *__pyx_vtab;
  Py_ssize_t nblocks;
  Py_ssize_t npoints;
  Py_ssize_t length;
  PyArrayObject *blocs;
  PyArrayObject *blengths;
  PyObject *__weakref__;
  __pyx_t_5numpy_int32_t *locbuf;
  __pyx_t_5numpy_int32_t *lenbuf;
};


/* "pandas/src/sparse.pyx":573
 * 
 * 
 * cdef class BlockMerge(object):             # <<<<<<<<<<<<<<
 *     """
 *     Object-oriented approach makes sharing state between recursive functions a
 */
struct __pyx_obj_6pandas_7_sparse_BlockMerge {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge *__pyx_vtab;
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *x;
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *y;
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *result;
  PyArrayObject *xstart;
  PyArrayObject *xlen;
  PyArrayObject *xend;
  PyArrayObject *ystart;
  PyArrayObject *ylen;
  PyArrayObject *yend;
  __pyx_t_5numpy_int32_t xi;
  __pyx_t_5numpy_int32_t yi;
};


/* "pandas/src/sparse.pyx":615
 *             self.yi = xi
 * 
 * cdef class BlockIntersection(BlockMerge):             # <<<<<<<<<<<<<<
 *     """
 *     not done yet
 */
struct __pyx_obj_6pandas_7_sparse_BlockIntersection {
  struct __pyx_obj_6pandas_7_sparse_BlockMerge __pyx_base;
};


/* "pandas/src/sparse.pyx":621
 *     pass
 * 
 * cdef class BlockUnion(BlockMerge):             # <<<<<<<<<<<<<<
 *     """
 *     Object-oriented approach makes sharing state between recursive functions a
 */
struct __pyx_obj_6pandas_7_sparse_BlockUnion {
  struct __pyx_obj_6pandas_7_sparse_BlockMerge __pyx_base;
};



/* "pandas/src/sparse.pyx":42
 * 
 * 
 * cdef class IntIndex(SparseIndex):             # <<<<<<<<<<<<<<
 *     """
 *     Object for holding exact integer sparse indexing information
 */

struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex {
  struct __pyx_obj_6pandas_7_sparse_IntIndex *(*intersect)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch);
  struct __pyx_obj_6pandas_7_sparse_IntIndex *(*make_union)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch);
  int (*lookup)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, Py_ssize_t, int __pyx_skip_dispatch);
  PyArrayObject *(*lookup_array)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, int __pyx_skip_dispatch);
  PyArrayObject *(*reindex)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch);
  PyObject *(*put)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*take)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *__pyx_vtabptr_6pandas_7_sparse_IntIndex;


/* "pandas/src/sparse.pyx":274
 * # BlockIndex
 * 
 * cdef class BlockIndex(SparseIndex):             # <<<<<<<<<<<<<<
 *     """
 *     Object for holding block-based sparse indexing information
 */

struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex {
  PyObject *(*check_integrity)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, int __pyx_skip_dispatch);
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*intersect)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch);
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*make_union)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch);
  int (*lookup)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, Py_ssize_t, int __pyx_skip_dispatch);
  PyArrayObject *(*lookup_array)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, int __pyx_skip_dispatch);
  PyArrayObject *(*reindex)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch);
  PyObject *(*put)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*take)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *__pyx_vtabptr_6pandas_7_sparse_BlockIndex;


/* "pandas/src/sparse.pyx":573
 * 
 * 
 * cdef class BlockMerge(object):             # <<<<<<<<<<<<<<
 *     """
 *     Object-oriented approach makes sharing state between recursive functions a
 */

struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge {
  PyObject *(*_make_merged_blocks)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *);
  PyObject *(*_set_current_indices)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t, int);
};
static struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge *__pyx_vtabptr_6pandas_7_sparse_BlockMerge;


/* "pandas/src/sparse.pyx":615
 *             self.yi = xi
 * 
 * cdef class BlockIntersection(BlockMerge):             # <<<<<<<<<<<<<<
 *     """
 *     not done yet
 */

struct __pyx_vtabstruct_6pandas_7_sparse_BlockIntersection {
  struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge __pyx_base;
};
static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIntersection *__pyx_vtabptr_6pandas_7_sparse_BlockIntersection;


/* "pandas/src/sparse.pyx":621
 *     pass
 * 
 * cdef class BlockUnion(BlockMerge):             # <<<<<<<<<<<<<<
 *     """
 *     Object-oriented approach makes sharing state between recursive functions a
 */

struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion {
  struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge __pyx_base;
  __pyx_t_5numpy_int32_t (*_find_next_block_end)(struct __pyx_obj_6pandas_7_sparse_BlockUnion *, int);
};
static struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *__pyx_vtabptr_6pandas_7_sparse_BlockUnion;

/* --- Runtime support code (head) --- */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #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__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #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_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)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

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);

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

#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

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);

static void __Pyx_RaiseBufferFallbackError(void);

static void __Pyx_RaiseBufferIndexError(int axis);

#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact);

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

static CYTHON_INLINE __pyx_t_5numpy_float64_t __Pyx_mod___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t);

static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
    int result = PyDict_Contains(dict, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);

static int __Pyx_SetVtable(PyObject *dict, void *vtable);

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

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;

#if PY_MAJOR_VERSION < 3
    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
    static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif


static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eqf(a, b)   ((a)==(b))
    #define __Pyx_c_sumf(a, b)  ((a)+(b))
    #define __Pyx_c_difff(a, b) ((a)-(b))
    #define __Pyx_c_prodf(a, b) ((a)*(b))
    #define __Pyx_c_quotf(a, b) ((a)/(b))
    #define __Pyx_c_negf(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zerof(z) ((z)==(float)0)
    #define __Pyx_c_conjf(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_absf(z)     (::std::abs(z))
        #define __Pyx_c_powf(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zerof(z) ((z)==0)
    #define __Pyx_c_conjf(z)    (conjf(z))
    #if 1
        #define __Pyx_c_absf(z)     (cabsf(z))
        #define __Pyx_c_powf(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq(a, b)   ((a)==(b))
    #define __Pyx_c_sum(a, b)  ((a)+(b))
    #define __Pyx_c_diff(a, b) ((a)-(b))
    #define __Pyx_c_prod(a, b) ((a)*(b))
    #define __Pyx_c_quot(a, b) ((a)/(b))
    #define __Pyx_c_neg(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero(z) ((z)==(double)0)
    #define __Pyx_c_conj(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (::std::abs(z))
        #define __Pyx_c_pow(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero(z) ((z)==0)
    #define __Pyx_c_conj(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (cabs(z))
        #define __Pyx_c_pow(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static int __Pyx_check_binary_version(void);

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyObject *__Pyx_ImportModule(const char *name);

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_f_6pandas_7_sparse_8IntIndex_intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_f_6pandas_7_sparse_8IntIndex_make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_6pandas_7_sparse_8IntIndex_lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index, int __pyx_skip_dispatch); /* proto*/
static PyArrayObject *__pyx_f_6pandas_7_sparse_8IntIndex_lookup_array(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_indexer, int __pyx_skip_dispatch); /* proto*/
static PyArrayObject *__pyx_f_6pandas_7_sparse_8IntIndex_reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_put(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_to_put, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_take(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_f_6pandas_7_sparse_10BlockIndex_intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_f_6pandas_7_sparse_10BlockIndex_make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_6pandas_7_sparse_10BlockIndex_lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index, int __pyx_skip_dispatch); /* proto*/
static PyArrayObject *__pyx_f_6pandas_7_sparse_10BlockIndex_lookup_array(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_indexer, int __pyx_skip_dispatch); /* proto*/
static PyArrayObject *__pyx_f_6pandas_7_sparse_10BlockIndex_reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_put(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_to_put, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_take(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6pandas_7_sparse_10BlockMerge__make_merged_blocks(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_6pandas_7_sparse_10BlockMerge__set_current_indices(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_xi, __pyx_t_5numpy_int32_t __pyx_v_yi, int __pyx_v_mode); /* proto*/
static PyObject *__pyx_f_6pandas_7_sparse_10BlockUnion__make_merged_blocks(struct __pyx_obj_6pandas_7_sparse_BlockUnion *__pyx_v_self); /* proto*/
static __pyx_t_5numpy_int32_t __pyx_f_6pandas_7_sparse_10BlockUnion__find_next_block_end(struct __pyx_obj_6pandas_7_sparse_BlockUnion *__pyx_v_self, int __pyx_v_mode); /* proto*/

/* Module declarations from 'cpython.buffer' */

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* Module declarations from 'cpython' */

/* Module declarations from 'cpython.object' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'numpy' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/

/* Module declarations from 'cython' */

/* Module declarations from 'pandas._sparse' */
static PyTypeObject *__pyx_ptype_6pandas_7_sparse_SparseIndex = 0;
static PyTypeObject *__pyx_ptype_6pandas_7_sparse_IntIndex = 0;
static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockIndex = 0;
static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockMerge = 0;
static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockIntersection = 0;
static PyTypeObject *__pyx_ptype_6pandas_7_sparse_BlockUnion = 0;
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_7_sparse_NaN;
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_7_sparse_INF;
static PyObject *__pyx_f_6pandas_7_sparse_get_blocks(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_combine(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, __pyx_t_6pandas_7_sparse_double_func); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_block_op(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_BlockIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_BlockIndex *, __pyx_t_5numpy_float64_t, __pyx_t_6pandas_7_sparse_double_func); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_op(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, __pyx_t_5numpy_float64_t, __pyx_t_6pandas_7_sparse_double_func); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___add(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___sub(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rsub(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___div(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rdiv(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___floordiv(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rfloordiv(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___mul(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___eq(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___ne(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___lt(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___gt(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___le(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___ge(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___mod(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rmod(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___pow(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rpow(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_add(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_sub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rsub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_mul(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_div(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rdiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_floordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rfloordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_mod(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rmod(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_pow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rpow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_eq(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_ne(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_lt(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_gt(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_le(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_ge(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_5numpy_float64_t, int __pyx_skip_dispatch); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
static __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 __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 };
#define __Pyx_MODULE_NAME "pandas._sparse"
int __pyx_module_is_main_pandas___sparse = 0;

/* Implementation of 'pandas._sparse' */
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_RuntimeError;
static char __pyx_k_B[] = "B";
static char __pyx_k_H[] = "H";
static char __pyx_k_I[] = "I";
static char __pyx_k_L[] = "L";
static char __pyx_k_O[] = "O";
static char __pyx_k_Q[] = "Q";
static char __pyx_k_b[] = "b";
static char __pyx_k_d[] = "d";
static char __pyx_k_f[] = "f";
static char __pyx_k_g[] = "g";
static char __pyx_k_h[] = "h";
static char __pyx_k_i[] = "i";
static char __pyx_k_l[] = "l";
static char __pyx_k_q[] = "q";
static char __pyx_k_x[] = "x";
static char __pyx_k_y[] = "y";
static char __pyx_k_Zd[] = "Zd";
static char __pyx_k_Zf[] = "Zf";
static char __pyx_k_Zg[] = "Zg";
static char __pyx_k_np[] = "np";
static char __pyx_k_1_8[] = "1.8";
static char __pyx_k_1_9[] = "1.9";
static char __pyx_k_NaN[] = "NaN";
static char __pyx_k_idx[] = "idx";
static char __pyx_k_inf[] = "inf";
static char __pyx_k_put[] = "put";
static char __pyx_k_sum[] = "sum";
static char __pyx_k_sys[] = "sys";
static char __pyx_k_1_10[] = "1.10";
static char __pyx_k_1_11[] = "1.11";
static char __pyx_k_fill[] = "fill";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_take[] = "take";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_blocs[] = "blocs";
static char __pyx_k_dtype[] = "dtype";
static char __pyx_k_empty[] = "empty";
static char __pyx_k_int32[] = "int32";
static char __pyx_k_ngaps[] = "ngaps";
static char __pyx_k_numpy[] = "numpy";
static char __pyx_k_other[] = "other_";
static char __pyx_k_range[] = "range";
static char __pyx_k_xfill[] = "xfill";
static char __pyx_k_yfill[] = "yfill";
static char __pyx_k_astype[] = "astype";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_length[] = "length";
static char __pyx_k_lookup[] = "lookup";
static char __pyx_k_to_put[] = "to_put";
static char __pyx_k_values[] = "values";
static char __pyx_k_xindex[] = "xindex";
static char __pyx_k_yindex[] = "yindex";
static char __pyx_k_float64[] = "float64";
static char __pyx_k_indexer[] = "indexer";
static char __pyx_k_indices[] = "indices";
static char __pyx_k_reindex[] = "reindex";
static char __pyx_k_union1d[] = "union1d";
static char __pyx_k_version[] = "version";
static char __pyx_k_IntIndex[] = "IntIndex\n";
static char __pyx_k_blengths[] = "blengths";
static char __pyx_k_operator[] = "operator";
static char __pyx_k_property[] = "property";
static char __pyx_k_Exception[] = "Exception";
static char __pyx_k_Indices_s[] = "Indices: %s\n";
static char __pyx_k_index_map[] = "index_map";
static char __pyx_k_intersect[] = "intersect";
static char __pyx_k_BlockIndex[] = "BlockIndex\n";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_fill_value[] = "fill_value";
static char __pyx_k_make_union[] = "make_union";
static char __pyx_k_new_length[] = "new_length";
static char __pyx_k_np_version[] = "_np_version";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_sparse_div[] = "sparse_div";
static char __pyx_k_array_equal[] = "array_equal";
static char __pyx_k_sparse_rdiv[] = "sparse_rdiv";
static char __pyx_k_LooseVersion[] = "LooseVersion";
static char __pyx_k_RuntimeError[] = "RuntimeError";
static char __pyx_k_lookup_array[] = "lookup_array";
static char __pyx_k_searchsorted[] = "searchsorted";
static char __pyx_k_sparse_index[] = "sparse_index";
static char __pyx_k_to_int_index[] = "to_int_index";
static char __pyx_k_get_reindexer[] = "get_reindexer";
static char __pyx_k_short_version[] = "short_version";
static char __pyx_k_pandas__sparse[] = "pandas._sparse";
static char __pyx_k_sparse_truediv[] = "sparse_truediv";
static char __pyx_k_to_block_index[] = "to_block_index";
static char __pyx_k_Block_lengths_s[] = "Block lengths: %s";
static char __pyx_k_check_integrity[] = "check_integrity";
static char __pyx_k_reindex_integer[] = "reindex_integer";
static char __pyx_k_sparse_rtruediv[] = "sparse_rtruediv";
static char __pyx_k_Block_d_overlaps[] = "Block %d overlaps";
static char __pyx_k_Block_locations_s[] = "Block locations: %s\n";
static char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
static char __pyx_k_distutils_version[] = "distutils.version";
static char __pyx_k_Mode_must_be_0_or_1[] = "Mode must be 0 or 1";
static char __pyx_k_NotImplementedError[] = "NotImplementedError";
static char __pyx_k_Zero_length_block_d[] = "Zero-length block %d";
static char __pyx_k_np_version_under1p8[] = "_np_version_under1p8";
static char __pyx_k_np_version_under1p9[] = "_np_version_under1p9";
static char __pyx_k_np_version_under1p10[] = "_np_version_under1p10";
static char __pyx_k_np_version_under1p11[] = "_np_version_under1p11";
static char __pyx_k_Block_d_extends_beyond_end[] = "Block %d extends beyond end";
static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static char __pyx_k_block_bound_arrays_must_be_same[] = "block bound arrays must be same length";
static char __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa[] = "/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/src/sparse.pyx";
static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_Indices_must_reference_same_unde[] = "Indices must reference same underlying length";
static char __pyx_k_Locations_not_in_ascending_order[] = "Locations not in ascending order";
static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static PyObject *__pyx_kp_s_1_10;
static PyObject *__pyx_kp_s_1_11;
static PyObject *__pyx_kp_s_1_8;
static PyObject *__pyx_kp_s_1_9;
static PyObject *__pyx_n_s_BlockIndex;
static PyObject *__pyx_kp_s_Block_d_extends_beyond_end;
static PyObject *__pyx_kp_s_Block_d_overlaps;
static PyObject *__pyx_kp_s_Block_lengths_s;
static PyObject *__pyx_kp_s_Block_locations_s;
static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_kp_s_Indices_must_reference_same_unde;
static PyObject *__pyx_kp_s_Indices_s;
static PyObject *__pyx_n_s_IntIndex;
static PyObject *__pyx_kp_s_Locations_not_in_ascending_order;
static PyObject *__pyx_n_s_LooseVersion;
static PyObject *__pyx_kp_s_Mode_must_be_0_or_1;
static PyObject *__pyx_n_s_NaN;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s_Zero_length_block_d;
static PyObject *__pyx_n_s_array_equal;
static PyObject *__pyx_n_s_ascontiguousarray;
static PyObject *__pyx_n_s_astype;
static PyObject *__pyx_n_s_blengths;
static PyObject *__pyx_kp_s_block_bound_arrays_must_be_same;
static PyObject *__pyx_n_s_blocs;
static PyObject *__pyx_n_s_check_integrity;
static PyObject *__pyx_n_s_distutils_version;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_fill;
static PyObject *__pyx_n_s_fill_value;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_get_reindexer;
static PyObject *__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_idx;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index_map;
static PyObject *__pyx_n_s_indexer;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_s_inf;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_intersect;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_lookup;
static PyObject *__pyx_n_s_lookup_array;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_union;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_s_new_length;
static PyObject *__pyx_n_s_ngaps;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_np_version;
static PyObject *__pyx_n_s_np_version_under1p10;
static PyObject *__pyx_n_s_np_version_under1p11;
static PyObject *__pyx_n_s_np_version_under1p8;
static PyObject *__pyx_n_s_np_version_under1p9;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_operator;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_pandas__sparse;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_put;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reindex;
static PyObject *__pyx_n_s_reindex_integer;
static PyObject *__pyx_n_s_searchsorted;
static PyObject *__pyx_n_s_short_version;
static PyObject *__pyx_n_s_sparse_div;
static PyObject *__pyx_n_s_sparse_index;
static PyObject *__pyx_n_s_sparse_rdiv;
static PyObject *__pyx_n_s_sparse_rtruediv;
static PyObject *__pyx_n_s_sparse_truediv;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_take;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_to_block_index;
static PyObject *__pyx_n_s_to_int_index;
static PyObject *__pyx_n_s_to_put;
static PyObject *__pyx_n_s_union1d;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xfill;
static PyObject *__pyx_n_s_xindex;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_yfill;
static PyObject *__pyx_n_s_yindex;
static int __pyx_pf_6pandas_7_sparse_11SparseIndex___init__(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_self); /* proto */
static int __pyx_pf_6pandas_7_sparse_8IntIndex___init__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_length, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6check_integrity(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_8equals(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_10ngaps(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_12to_int_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_14to_block_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_22lookup_array(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_indexer); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_24reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_26put(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_28take(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7indices___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_get_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices); /* proto */
static int __pyx_pf_6pandas_7_sparse_10BlockIndex___init__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_blocs, PyObject *__pyx_v_blengths); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6ngaps(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_10equals(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_12to_block_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_14to_int_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_22lookup_array(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_indexer); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_24reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_26put(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_28take(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7nblocks___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_5blocs___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8blengths___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self); /* proto */
static int __pyx_pf_6pandas_7_sparse_10BlockMerge___init__(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_2sparse_add(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_4sparse_sub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_6sparse_rsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8sparse_mul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10sparse_div(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_12sparse_rdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_14sparse_floordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_16sparse_rfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_18sparse_mod(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_20sparse_rmod(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_22sparse_pow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_24sparse_rpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_26sparse_eq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_28sparse_ne(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_30sparse_lt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_32sparse_gt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_34sparse_le(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_36sparse_ge(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_38get_reindexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_index_map); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_40reindex_integer(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_sparse_index, CYTHON_UNUSED PyArrayObject *__pyx_v_indexer); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static PyObject *__pyx_tp_new_6pandas_7_sparse_SparseIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pandas_7_sparse_IntIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIndex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockMerge(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIntersection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockUnion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_15;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_codeobj__17;
static PyObject *__pyx_codeobj__19;

/* "pandas/src/sparse.pyx":28
 * cdef float64_t INF = <float64_t> np.inf
 * 
 * cdef inline int int_max(int a, int b): return a if a >= b else b             # <<<<<<<<<<<<<<
 * cdef inline int int_min(int a, int b): return a if a <= b else b
 * 
 */

static CYTHON_INLINE int __pyx_f_6pandas_7_sparse_int_max(int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("int_max", 0);
  if (((__pyx_v_a >= __pyx_v_b) != 0)) {
    __pyx_t_1 = __pyx_v_a;
  } else {
    __pyx_t_1 = __pyx_v_b;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":29
 * 
 * cdef inline int int_max(int a, int b): return a if a >= b else b
 * cdef inline int int_min(int a, int b): return a if a <= b else b             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */

static CYTHON_INLINE int __pyx_f_6pandas_7_sparse_int_min(int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("int_min", 0);
  if (((__pyx_v_a <= __pyx_v_b) != 0)) {
    __pyx_t_1 = __pyx_v_a;
  } else {
    __pyx_t_1 = __pyx_v_b;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":38
 *     Abstract superclass for sparse index types
 *     """
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

/* Python wrapper */
static int __pyx_pw_6pandas_7_sparse_11SparseIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_7_sparse_11SparseIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_6pandas_7_sparse_11SparseIndex___init__(((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_7_sparse_11SparseIndex___init__(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pandas/src/sparse.pyx":39
 *     """
 *     def __init__(self):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/sparse.pyx":38
 *     Abstract superclass for sparse index types
 *     """
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas._sparse.SparseIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":56
 *         ndarray indices
 * 
 *     def __init__(self, Py_ssize_t length, indices):             # <<<<<<<<<<<<<<
 *         self.length = length
 *         self.indices = np.ascontiguousarray(indices, dtype=np.int32)
 */

/* Python wrapper */
static int __pyx_pw_6pandas_7_sparse_8IntIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_7_sparse_8IntIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_indices = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_length = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_length == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_indices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.IntIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex___init__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_length, __pyx_v_indices);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_7_sparse_8IntIndex___init__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_length, PyObject *__pyx_v_indices) {
  int __pyx_r;
  __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;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pandas/src/sparse.pyx":57
 * 
 *     def __init__(self, Py_ssize_t length, indices):
 *         self.length = length             # <<<<<<<<<<<<<<
 *         self.indices = np.ascontiguousarray(indices, dtype=np.int32)
 *         self.npoints = len(self.indices)
 */
  __pyx_v_self->length = __pyx_v_length;

  /* "pandas/src/sparse.pyx":58
 *     def __init__(self, Py_ssize_t length, indices):
 *         self.length = length
 *         self.indices = np.ascontiguousarray(indices, dtype=np.int32)             # <<<<<<<<<<<<<<
 *         self.npoints = len(self.indices)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_indices);
  __Pyx_GIVEREF(__pyx_v_indices);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->indices);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->indices));
  __pyx_v_self->indices = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":59
 *         self.length = length
 *         self.indices = np.ascontiguousarray(indices, dtype=np.int32)
 *         self.npoints = len(self.indices)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_t_5 = ((PyObject *)__pyx_v_self->indices);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->npoints = __pyx_t_6;

  /* "pandas/src/sparse.pyx":56
 *         ndarray indices
 * 
 *     def __init__(self, Py_ssize_t length, indices):             # <<<<<<<<<<<<<<
 *         self.length = length
 *         self.indices = np.ascontiguousarray(indices, dtype=np.int32)
 */

  /* 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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":61
 *         self.npoints = len(self.indices)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         args = (self.length, self.indices)
 *         return (IntIndex, args)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_2__reduce__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) {
  PyObject *__pyx_v_args = NULL;
  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("__reduce__", 0);

  /* "pandas/src/sparse.pyx":62
 * 
 *     def __reduce__(self):
 *         args = (self.length, self.indices)             # <<<<<<<<<<<<<<
 *         return (IntIndex, args)
 * 
 */
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->indices));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->indices));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->indices));
  __pyx_t_1 = 0;
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":63
 *     def __reduce__(self):
 *         args = (self.length, self.indices)
 *         return (IntIndex, args)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex));
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":61
 *         self.npoints = len(self.indices)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         args = (self.length, self.indices)
 *         return (IntIndex, args)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":65
 *         return (IntIndex, args)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         output = 'IntIndex\n'
 *         output += 'Indices: %s\n' % repr(self.indices)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_4__repr__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) {
  PyObject *__pyx_v_output = NULL;
  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("__repr__", 0);

  /* "pandas/src/sparse.pyx":66
 * 
 *     def __repr__(self):
 *         output = 'IntIndex\n'             # <<<<<<<<<<<<<<
 *         output += 'Indices: %s\n' % repr(self.indices)
 *         return output
 */
  __Pyx_INCREF(__pyx_n_s_IntIndex);
  __pyx_v_output = __pyx_n_s_IntIndex;

  /* "pandas/src/sparse.pyx":67
 *     def __repr__(self):
 *         output = 'IntIndex\n'
 *         output += 'Indices: %s\n' % repr(self.indices)             # <<<<<<<<<<<<<<
 *         return output
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->indices);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Indices_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":68
 *         output = 'IntIndex\n'
 *         output += 'Indices: %s\n' % repr(self.indices)
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def check_integrity(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_output);
  __pyx_r = __pyx_v_output;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":65
 *         return (IntIndex, args)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         output = 'IntIndex\n'
 *         output += 'Indices: %s\n' % repr(self.indices)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":70
 *         return output
 * 
 *     def check_integrity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Only need be strictly ascending and nothing less than 0 or greater than
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pandas_7_sparse_8IntIndex_6check_integrity[] = "\n        Only need be strictly ascending and nothing less than 0 or greater than\n        totall ength\n        ";
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_integrity (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_6check_integrity(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6check_integrity(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_integrity", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":77
 *         pass
 * 
 *     def equals(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, IntIndex):
 *             return False
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_8equals(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_8equals(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_v_same_length = NULL;
  PyObject *__pyx_v_same_indices = NULL;
  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;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pandas/src/sparse.pyx":78
 * 
 *     def equals(self, other):
 *         if not isinstance(other, IntIndex):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_6pandas_7_sparse_IntIndex); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/sparse.pyx":79
 *     def equals(self, other):
 *         if not isinstance(other, IntIndex):
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         if self is other:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":78
 * 
 *     def equals(self, other):
 *         if not isinstance(other, IntIndex):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "pandas/src/sparse.pyx":81
 *             return False
 * 
 *         if self is other:             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_self) == __pyx_v_other);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":82
 * 
 *         if self is other:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         same_length = self.length == other.length
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":81
 *             return False
 * 
 *         if self is other:             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  }

  /* "pandas/src/sparse.pyx":84
 *             return True
 * 
 *         same_length = self.length == other.length             # <<<<<<<<<<<<<<
 *         same_indices = np.array_equal(self.indices, other.indices)
 *         return same_length and same_indices
 */
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_same_length = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":85
 * 
 *         same_length = self.length == other.length
 *         same_indices = np.array_equal(self.indices, other.indices)             # <<<<<<<<<<<<<<
 *         return same_length and same_indices
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->indices));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->indices));
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_self->indices));
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_same_indices = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":86
 *         same_length = self.length == other.length
 *         same_indices = np.array_equal(self.indices, other.indices)
 *         return same_length and same_indices             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_same_length); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {
  } else {
    __Pyx_INCREF(__pyx_v_same_length);
    __pyx_t_5 = __pyx_v_same_length;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_v_same_indices);
  __pyx_t_5 = __pyx_v_same_indices;
  __pyx_L5_bool_binop_done:;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":77
 *         pass
 * 
 *     def equals(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, IntIndex):
 *             return False
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_same_length);
  __Pyx_XDECREF(__pyx_v_same_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":89
 * 
 *     @property
 *     def ngaps(self):             # <<<<<<<<<<<<<<
 *         return self.length - self.npoints
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_11ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_11ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ngaps (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_10ngaps(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_10ngaps(struct __pyx_obj_6pandas_7_sparse_IntIndex *__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("ngaps", 0);

  /* "pandas/src/sparse.pyx":90
 *     @property
 *     def ngaps(self):
 *         return self.length - self.npoints             # <<<<<<<<<<<<<<
 * 
 *     def to_int_index(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->length - __pyx_v_self->npoints)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":89
 * 
 *     @property
 *     def ngaps(self):             # <<<<<<<<<<<<<<
 *         return self.length - self.npoints
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.ngaps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":92
 *         return self.length - self.npoints
 * 
 *     def to_int_index(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_13to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_13to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_int_index (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_12to_int_index(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_12to_int_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_int_index", 0);

  /* "pandas/src/sparse.pyx":93
 * 
 *     def to_int_index(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def to_block_index(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":92
 *         return self.length - self.npoints
 * 
 *     def to_int_index(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":95
 *         return self
 * 
 *     def to_block_index(self):             # <<<<<<<<<<<<<<
 *         locs, lens = get_blocks(self.indices)
 *         return BlockIndex(self.length, locs, lens)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_15to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_15to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_block_index (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_14to_block_index(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_14to_block_index(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) {
  PyObject *__pyx_v_locs = NULL;
  PyObject *__pyx_v_lens = 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)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_block_index", 0);

  /* "pandas/src/sparse.pyx":96
 * 
 *     def to_block_index(self):
 *         locs, lens = get_blocks(self.indices)             # <<<<<<<<<<<<<<
 *         return BlockIndex(self.length, locs, lens)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->indices);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_6pandas_7_sparse_get_blocks(((PyArrayObject *)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_locs = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_lens = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pandas/src/sparse.pyx":97
 *     def to_block_index(self):
 *         locs, lens = get_blocks(self.indices)
 *         return BlockIndex(self.length, locs, lens)             # <<<<<<<<<<<<<<
 * 
 *     cpdef IntIndex intersect(self, SparseIndex y_):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_locs);
  __Pyx_GIVEREF(__pyx_v_locs);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_locs);
  __Pyx_INCREF(__pyx_v_lens);
  __Pyx_GIVEREF(__pyx_v_lens);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_lens);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":95
 *         return self
 * 
 *     def to_block_index(self):             # <<<<<<<<<<<<<<
 *         locs, lens = get_blocks(self.indices)
 *         return BlockIndex(self.length, locs, lens)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.to_block_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_locs);
  __Pyx_XDECREF(__pyx_v_lens);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":99
 *         return BlockIndex(self.length, locs, lens)
 * 
 *     cpdef IntIndex intersect(self, SparseIndex y_):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t out_length, xi, yi = 0
 */

static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/
static struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_f_6pandas_7_sparse_8IntIndex_intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_xi;
  Py_ssize_t __pyx_v_yi;
  __pyx_t_5numpy_int32_t __pyx_v_xind;
  PyArrayObject *__pyx_v_xindices = 0;
  PyArrayObject *__pyx_v_yindices = 0;
  PyObject *__pyx_v_new_list = 0;
  struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_y = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices;
  __Pyx_Buffer __pyx_pybuffer_xindices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices;
  __Pyx_Buffer __pyx_pybuffer_yindices;
  struct __pyx_obj_6pandas_7_sparse_IntIndex *__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;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("intersect", 0);
  __pyx_pybuffer_xindices.pybuffer.buf = NULL;
  __pyx_pybuffer_xindices.refcount = 0;
  __pyx_pybuffernd_xindices.data = NULL;
  __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices;
  __pyx_pybuffer_yindices.pybuffer.buf = NULL;
  __pyx_pybuffer_yindices.refcount = 0;
  __pyx_pybuffernd_yindices.data = NULL;
  __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_intersect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_y_)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_y_));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_y_));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_y_));
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":101
 *     cpdef IntIndex intersect(self, SparseIndex y_):
 *         cdef:
 *             Py_ssize_t out_length, xi, yi = 0             # <<<<<<<<<<<<<<
 *             int32_t xind
 *             ndarray[int32_t, ndim=1] xindices, yindices
 */
  __pyx_v_yi = 0;

  /* "pandas/src/sparse.pyx":104
 *             int32_t xind
 *             ndarray[int32_t, ndim=1] xindices, yindices
 *             list new_list = []             # <<<<<<<<<<<<<<
 *             IntIndex y
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":108
 * 
 *         # if is one already, returns self
 *         y = y_.to_int_index()             # <<<<<<<<<<<<<<
 * 
 *         if self.length != y.length:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y_), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":110
 *         y = y_.to_int_index()
 * 
 *         if self.length != y.length:             # <<<<<<<<<<<<<<
 *             raise Exception('Indices must reference same underlying length')
 * 
 */
  __pyx_t_6 = ((__pyx_v_self->length != __pyx_v_y->length) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/sparse.pyx":111
 * 
 *         if self.length != y.length:
 *             raise Exception('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         xindices = self.indices
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":110
 *         y = y_.to_int_index()
 * 
 *         if self.length != y.length:             # <<<<<<<<<<<<<<
 *             raise Exception('Indices must reference same underlying length')
 * 
 */
  }

  /* "pandas/src/sparse.pyx":113
 *             raise Exception('Indices must reference same underlying length')
 * 
 *         xindices = self.indices             # <<<<<<<<<<<<<<
 *         yindices = y.indices
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->indices);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xindices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":114
 * 
 *         xindices = self.indices
 *         yindices = y.indices             # <<<<<<<<<<<<<<
 * 
 *         for xi from 0 <= xi < self.npoints:
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_y->indices);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yindices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":116
 *         yindices = y.indices
 * 
 *         for xi from 0 <= xi < self.npoints:             # <<<<<<<<<<<<<<
 *             xind = xindices[xi]
 * 
 */
  __pyx_t_11 = __pyx_v_self->npoints;
  for (__pyx_v_xi = 0; __pyx_v_xi < __pyx_t_11; __pyx_v_xi++) {

    /* "pandas/src/sparse.pyx":117
 * 
 *         for xi from 0 <= xi < self.npoints:
 *             xind = xindices[xi]             # <<<<<<<<<<<<<<
 * 
 *             while yi < y.npoints and yindices[yi] < xind:
 */
    __pyx_t_12 = __pyx_v_xi;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_pybuffernd_xindices.diminfo[0].shape;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_xindices.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_xind = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_xindices.diminfo[0].strides));

    /* "pandas/src/sparse.pyx":119
 *             xind = xindices[xi]
 * 
 *             while yi < y.npoints and yindices[yi] < xind:             # <<<<<<<<<<<<<<
 *                 yi += 1
 * 
 */
    while (1) {
      __pyx_t_13 = ((__pyx_v_yi < __pyx_v_y->npoints) != 0);
      if (__pyx_t_13) {
      } else {
        __pyx_t_6 = __pyx_t_13;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_14 = __pyx_v_yi;
      __pyx_t_7 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_yindices.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_yindices.diminfo[0].strides)) < __pyx_v_xind) != 0);
      __pyx_t_6 = __pyx_t_13;
      __pyx_L8_bool_binop_done:;
      if (!__pyx_t_6) break;

      /* "pandas/src/sparse.pyx":120
 * 
 *             while yi < y.npoints and yindices[yi] < xind:
 *                 yi += 1             # <<<<<<<<<<<<<<
 * 
 *             if yi >= y.npoints:
 */
      __pyx_v_yi = (__pyx_v_yi + 1);
    }

    /* "pandas/src/sparse.pyx":122
 *                 yi += 1
 * 
 *             if yi >= y.npoints:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_6 = ((__pyx_v_yi >= __pyx_v_y->npoints) != 0);
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":123
 * 
 *             if yi >= y.npoints:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             # TODO: would a two-pass algorithm be faster?
 */
      goto __pyx_L5_break;

      /* "pandas/src/sparse.pyx":122
 *                 yi += 1
 * 
 *             if yi >= y.npoints:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "pandas/src/sparse.pyx":126
 * 
 *             # TODO: would a two-pass algorithm be faster?
 *             if yindices[yi] == xind:             # <<<<<<<<<<<<<<
 *                 new_list.append(xind)
 * 
 */
    __pyx_t_15 = __pyx_v_yi;
    __pyx_t_7 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_pybuffernd_yindices.diminfo[0].shape;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_yindices.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_yindices.diminfo[0].strides)) == __pyx_v_xind) != 0);
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":127
 *             # TODO: would a two-pass algorithm be faster?
 *             if yindices[yi] == xind:
 *                 new_list.append(xind)             # <<<<<<<<<<<<<<
 * 
 *         return IntIndex(self.length, new_list)
 */
      __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_1); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pandas/src/sparse.pyx":126
 * 
 *             # TODO: would a two-pass algorithm be faster?
 *             if yindices[yi] == xind:             # <<<<<<<<<<<<<<
 *                 new_list.append(xind)
 * 
 */
    }
  }
  __pyx_L5_break:;

  /* "pandas/src/sparse.pyx":129
 *                 new_list.append(xind)
 * 
 *         return IntIndex(self.length, new_list)             # <<<<<<<<<<<<<<
 * 
 *     cpdef IntIndex make_union(self, SparseIndex y_):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_new_list);
  __Pyx_GIVEREF(__pyx_v_new_list);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_new_list);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":99
 *         return BlockIndex(self.length, locs, lens)
 * 
 *     cpdef IntIndex intersect(self, SparseIndex y_):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t out_length, xi, yi = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_xindices);
  __Pyx_XDECREF((PyObject *)__pyx_v_yindices);
  __Pyx_XDECREF(__pyx_v_new_list);
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_y_) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("intersect (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "y_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_16intersect(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_y_));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_) {
  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("intersect", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_7_sparse_8IntIndex_intersect(__pyx_v_self, __pyx_v_y_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":131
 *         return IntIndex(self.length, new_list)
 * 
 *     cpdef IntIndex make_union(self, SparseIndex y_):             # <<<<<<<<<<<<<<
 * 
 *         cdef:
 */

static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/
static struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_f_6pandas_7_sparse_8IntIndex_make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_, int __pyx_skip_dispatch) {
  PyArrayObject *__pyx_v_new_indices = 0;
  struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_y = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_new_indices;
  __Pyx_Buffer __pyx_pybuffer_new_indices;
  struct __pyx_obj_6pandas_7_sparse_IntIndex *__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;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  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("make_union", 0);
  __pyx_pybuffer_new_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_new_indices.refcount = 0;
  __pyx_pybuffernd_new_indices.data = NULL;
  __pyx_pybuffernd_new_indices.rcbuffer = &__pyx_pybuffer_new_indices;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_union); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_y_)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_y_));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_y_));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_y_));
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":138
 * 
 *         # if is one already, returns self
 *         y = y_.to_int_index()             # <<<<<<<<<<<<<<
 * 
 *         if self.length != y.length:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y_), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":140
 *         y = y_.to_int_index()
 * 
 *         if self.length != y.length:             # <<<<<<<<<<<<<<
 *             raise ValueError('Indices must reference same underlying length')
 * 
 */
  __pyx_t_6 = ((__pyx_v_self->length != __pyx_v_y->length) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/sparse.pyx":141
 * 
 *         if self.length != y.length:
 *             raise ValueError('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         new_indices = np.union1d(self.indices, y.indices)
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":140
 *         y = y_.to_int_index()
 * 
 *         if self.length != y.length:             # <<<<<<<<<<<<<<
 *             raise ValueError('Indices must reference same underlying length')
 * 
 */
  }

  /* "pandas/src/sparse.pyx":143
 *             raise ValueError('Indices must reference same underlying length')
 * 
 *         new_indices = np.union1d(self.indices, y.indices)             # <<<<<<<<<<<<<<
 *         return IntIndex(self.length, new_indices)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_union1d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->indices));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->indices));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, ((PyObject *)__pyx_v_self->indices));
  __Pyx_INCREF(((PyObject *)__pyx_v_y->indices));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_y->indices));
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, ((PyObject *)__pyx_v_y->indices));
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_indices.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_indices.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_new_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_new_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_pybuffernd_new_indices.diminfo[0].strides = __pyx_pybuffernd_new_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_new_indices.diminfo[0].shape = __pyx_pybuffernd_new_indices.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_new_indices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":144
 * 
 *         new_indices = np.union1d(self.indices, y.indices)
 *         return IntIndex(self.length, new_indices)             # <<<<<<<<<<<<<<
 * 
 *     @cython.wraparound(False)
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_new_indices));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_new_indices));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_new_indices));
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":131
 *         return IntIndex(self.length, new_list)
 * 
 *     cpdef IntIndex make_union(self, SparseIndex y_):             # <<<<<<<<<<<<<<
 * 
 *         cdef:
 */

  /* 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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_indices.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_new_indices.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_new_indices);
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y_); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y_) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_union (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "y_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_18make_union(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_y_));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y_) {
  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("make_union", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_7_sparse_8IntIndex_make_union(__pyx_v_self, __pyx_v_y_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":147
 * 
 *     @cython.wraparound(False)
 *     cpdef int lookup(self, Py_ssize_t index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the internal location if value exists on given index.
 */

static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static int __pyx_f_6pandas_7_sparse_8IntIndex_lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_res;
  PyArrayObject *__pyx_v_inds = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_inds;
  __Pyx_Buffer __pyx_pybuffer_inds;
  int __pyx_r;
  __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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup", 0);
  __pyx_pybuffer_inds.pybuffer.buf = NULL;
  __pyx_pybuffer_inds.refcount = 0;
  __pyx_pybuffernd_inds.data = NULL;
  __pyx_pybuffernd_inds.rcbuffer = &__pyx_pybuffer_inds;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup)) {
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":156
 *             ndarray[int32_t, ndim=1] inds
 * 
 *         inds = self.indices             # <<<<<<<<<<<<<<
 *         if self.npoints == 0:
 *             return -1
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->indices);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_inds = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":157
 * 
 *         inds = self.indices
 *         if self.npoints == 0:             # <<<<<<<<<<<<<<
 *             return -1
 *         elif index < 0 or self.length <= index:
 */
  __pyx_t_11 = ((__pyx_v_self->npoints == 0) != 0);
  if (__pyx_t_11) {

    /* "pandas/src/sparse.pyx":158
 *         inds = self.indices
 *         if self.npoints == 0:
 *             return -1             # <<<<<<<<<<<<<<
 *         elif index < 0 or self.length <= index:
 *             return -1
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":157
 * 
 *         inds = self.indices
 *         if self.npoints == 0:             # <<<<<<<<<<<<<<
 *             return -1
 *         elif index < 0 or self.length <= index:
 */
  }

  /* "pandas/src/sparse.pyx":159
 *         if self.npoints == 0:
 *             return -1
 *         elif index < 0 or self.length <= index:             # <<<<<<<<<<<<<<
 *             return -1
 * 
 */
  __pyx_t_12 = ((__pyx_v_index < 0) != 0);
  if (!__pyx_t_12) {
  } else {
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_self->length <= __pyx_v_index) != 0);
  __pyx_t_11 = __pyx_t_12;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_11) {

    /* "pandas/src/sparse.pyx":160
 *             return -1
 *         elif index < 0 or self.length <= index:
 *             return -1             # <<<<<<<<<<<<<<
 * 
 *         res = inds.searchsorted(index)
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":159
 *         if self.npoints == 0:
 *             return -1
 *         elif index < 0 or self.length <= index:             # <<<<<<<<<<<<<<
 *             return -1
 * 
 */
  }

  /* "pandas/src/sparse.pyx":162
 *             return -1
 * 
 *         res = inds.searchsorted(index)             # <<<<<<<<<<<<<<
 *         if res == self.npoints:
 *             return -1
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_inds), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_res = __pyx_t_13;

  /* "pandas/src/sparse.pyx":163
 * 
 *         res = inds.searchsorted(index)
 *         if res == self.npoints:             # <<<<<<<<<<<<<<
 *             return -1
 *         elif inds[res] == index:
 */
  __pyx_t_11 = ((__pyx_v_res == __pyx_v_self->npoints) != 0);
  if (__pyx_t_11) {

    /* "pandas/src/sparse.pyx":164
 *         res = inds.searchsorted(index)
 *         if res == self.npoints:
 *             return -1             # <<<<<<<<<<<<<<
 *         elif inds[res] == index:
 *             return res
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":163
 * 
 *         res = inds.searchsorted(index)
 *         if res == self.npoints:             # <<<<<<<<<<<<<<
 *             return -1
 *         elif inds[res] == index:
 */
  }

  /* "pandas/src/sparse.pyx":165
 *         if res == self.npoints:
 *             return -1
 *         elif inds[res] == index:             # <<<<<<<<<<<<<<
 *             return res
 *         else:
 */
  __pyx_t_14 = __pyx_v_res;
  __pyx_t_7 = -1;
  if (__pyx_t_14 < 0) {
    __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds.diminfo[0].strides)) == __pyx_v_index) != 0);
  if (__pyx_t_11) {

    /* "pandas/src/sparse.pyx":166
 *             return -1
 *         elif inds[res] == index:
 *             return res             # <<<<<<<<<<<<<<
 *         else:
 *             return -1
 */
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":165
 *         if res == self.npoints:
 *             return -1
 *         elif inds[res] == index:             # <<<<<<<<<<<<<<
 *             return res
 *         else:
 */
  }

  /* "pandas/src/sparse.pyx":168
 *             return res
 *         else:
 *             return -1             # <<<<<<<<<<<<<<
 * 
 *     @cython.wraparound(False)
 */
  /*else*/ {
    __pyx_r = -1;
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":147
 * 
 *     @cython.wraparound(False)
 *     cpdef int lookup(self, Py_ssize_t index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the internal location if value exists on given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_inds);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_6pandas_7_sparse_8IntIndex_20lookup[] = "\n        Return the internal location if value exists on given index.\n        Return -1 otherwise.\n        ";
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  Py_ssize_t __pyx_v_index;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lookup (wrapper)", 0);
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyIndex_AsSsize_t(__pyx_arg_index); if (unlikely((__pyx_v_index == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_20lookup(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((Py_ssize_t)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, Py_ssize_t __pyx_v_index) {
  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("lookup", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_6pandas_7_sparse_8IntIndex_lookup(__pyx_v_self, __pyx_v_index, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":171
 * 
 *     @cython.wraparound(False)
 *     cpdef ndarray[int32_t] lookup_array(self, ndarray[int32_t, ndim=1] indexer):             # <<<<<<<<<<<<<<
 *         """
 *         Vectorized lookup, returns ndarray[int32_t]
 */

static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23lookup_array(PyObject *__pyx_v_self, PyObject *__pyx_v_indexer); /*proto*/
static PyArrayObject *__pyx_f_6pandas_7_sparse_8IntIndex_lookup_array(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_indexer, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_inds = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyArrayObject *__pyx_v_masked = 0;
  PyArrayObject *__pyx_v_res = 0;
  PyArrayObject *__pyx_v_results = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_inds;
  __Pyx_Buffer __pyx_pybuffer_inds;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
  __Pyx_Buffer __pyx_pybuffer_mask;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_masked;
  __Pyx_Buffer __pyx_pybuffer_masked;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
  __Pyx_Buffer __pyx_pybuffer_res;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_results;
  __Pyx_Buffer __pyx_pybuffer_results;
  PyArrayObject *__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;
  Py_ssize_t __pyx_t_6;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyArrayObject *__pyx_t_15 = NULL;
  PyArrayObject *__pyx_t_16 = NULL;
  PyArrayObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup_array", 0);
  __pyx_pybuffer_inds.pybuffer.buf = NULL;
  __pyx_pybuffer_inds.refcount = 0;
  __pyx_pybuffernd_inds.data = NULL;
  __pyx_pybuffernd_inds.rcbuffer = &__pyx_pybuffer_inds;
  __pyx_pybuffer_mask.pybuffer.buf = NULL;
  __pyx_pybuffer_mask.refcount = 0;
  __pyx_pybuffernd_mask.data = NULL;
  __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
  __pyx_pybuffer_masked.pybuffer.buf = NULL;
  __pyx_pybuffer_masked.refcount = 0;
  __pyx_pybuffernd_masked.data = NULL;
  __pyx_pybuffernd_masked.rcbuffer = &__pyx_pybuffer_masked;
  __pyx_pybuffer_res.pybuffer.buf = NULL;
  __pyx_pybuffer_res.refcount = 0;
  __pyx_pybuffernd_res.data = NULL;
  __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;
  __pyx_pybuffer_results.pybuffer.buf = NULL;
  __pyx_pybuffer_results.refcount = 0;
  __pyx_pybuffernd_results.data = NULL;
  __pyx_pybuffernd_results.rcbuffer = &__pyx_pybuffer_results;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lookup_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_23lookup_array)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_indexer)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_indexer));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_indexer));
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":183
 *             ndarray[int32_t, ndim=1] results
 * 
 *         n = len(indexer)             # <<<<<<<<<<<<<<
 *         results = np.empty(n, dtype=np.int32)
 *         results.fill(-1)
 */
  __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_6;

  /* "pandas/src/sparse.pyx":184
 * 
 *         n = len(indexer)
 *         results = np.empty(n, dtype=np.int32)             # <<<<<<<<<<<<<<
 *         results.fill(-1)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_results.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_results.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_results.rcbuffer->pybuffer, (PyObject*)__pyx_v_results, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_results.diminfo[0].strides = __pyx_pybuffernd_results.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_results.diminfo[0].shape = __pyx_pybuffernd_results.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_results = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/sparse.pyx":185
 *         n = len(indexer)
 *         results = np.empty(n, dtype=np.int32)
 *         results.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *         if self.npoints == 0:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_results), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":187
 *         results.fill(-1)
 * 
 *         if self.npoints == 0:             # <<<<<<<<<<<<<<
 *             return results
 * 
 */
  __pyx_t_12 = ((__pyx_v_self->npoints == 0) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/sparse.pyx":188
 * 
 *         if self.npoints == 0:
 *             return results             # <<<<<<<<<<<<<<
 * 
 *         inds = self.indices
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_results));
    __pyx_r = ((PyArrayObject *)__pyx_v_results);
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":187
 *         results.fill(-1)
 * 
 *         if self.npoints == 0:             # <<<<<<<<<<<<<<
 *             return results
 * 
 */
  }

  /* "pandas/src/sparse.pyx":190
 *             return results
 * 
 *         inds = self.indices             # <<<<<<<<<<<<<<
 *         mask = (inds[0] <= indexer) & (indexer <= inds[len(inds) - 1])
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->indices);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_inds = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":191
 * 
 *         inds = self.indices
 *         mask = (inds[0] <= indexer) & (indexer <= inds[len(inds) - 1])             # <<<<<<<<<<<<<<
 * 
 *         masked = indexer[mask]
 */
  __pyx_t_13 = 0;
  __pyx_t_8 = -1;
  if (__pyx_t_13 < 0) {
    __pyx_t_8 = 0;
  } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_8 = 0;
  if (unlikely(__pyx_t_8 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_8);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_inds.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_v_indexer), Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_inds)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = (__pyx_t_6 - 1);
  __pyx_t_8 = -1;
  if (__pyx_t_14 < 0) {
    __pyx_t_8 = 0;
  } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_inds.diminfo[0].shape)) __pyx_t_8 = 0;
  if (unlikely(__pyx_t_8 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_8);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_v_indexer), __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_And(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":193
 *         mask = (inds[0] <= indexer) & (indexer <= inds[len(inds) - 1])
 * 
 *         masked = indexer[mask]             # <<<<<<<<<<<<<<
 *         res = inds.searchsorted(masked).astype(np.int32)
 * 
 */
  __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_indexer), ((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_masked.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_masked.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_masked.rcbuffer->pybuffer, (PyObject*)__pyx_v_masked, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_masked.diminfo[0].strides = __pyx_pybuffernd_masked.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_masked.diminfo[0].shape = __pyx_pybuffernd_masked.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = 0;
  __pyx_v_masked = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":194
 * 
 *         masked = indexer[mask]
 *         res = inds.searchsorted(masked).astype(np.int32)             # <<<<<<<<<<<<<<
 * 
 *         res[inds[res] != masked] = -1
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_inds), __pyx_n_s_searchsorted); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_masked)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_masked));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_masked));
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_masked));
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_17 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_v_res, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_17 = 0;
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":196
 *         res = inds.searchsorted(masked).astype(np.int32)
 * 
 *         res[inds[res] != masked] = -1             # <<<<<<<<<<<<<<
 *         results[mask] = res
 *         return results
 */
  __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_inds), ((PyObject *)__pyx_v_res)); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_v_masked), Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_res), __pyx_t_4, __pyx_int_neg_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/sparse.pyx":197
 * 
 *         res[inds[res] != masked] = -1
 *         results[mask] = res             # <<<<<<<<<<<<<<
 *         return results
 * 
 */
  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_results), ((PyObject *)__pyx_v_mask), ((PyObject *)__pyx_v_res)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/sparse.pyx":198
 *         res[inds[res] != masked] = -1
 *         results[mask] = res
 *         return results             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values,
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_results));
  __pyx_r = ((PyArrayObject *)__pyx_v_results);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":171
 * 
 *     @cython.wraparound(False)
 *     cpdef ndarray[int32_t] lookup_array(self, ndarray[int32_t, ndim=1] indexer):             # <<<<<<<<<<<<<<
 *         """
 *         Vectorized lookup, returns ndarray[int32_t]
 */

  /* 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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_masked.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_results.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_masked.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_results.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_inds);
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF((PyObject *)__pyx_v_masked);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_results);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23lookup_array(PyObject *__pyx_v_self, PyObject *__pyx_v_indexer); /*proto*/
static char __pyx_doc_6pandas_7_sparse_8IntIndex_22lookup_array[] = "\n        Vectorized lookup, returns ndarray[int32_t]\n        ";
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23lookup_array(PyObject *__pyx_v_self, PyObject *__pyx_v_indexer) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lookup_array (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_22lookup_array(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), ((PyArrayObject *)__pyx_v_indexer));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_22lookup_array(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_indexer) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  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("lookup_array", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_7_sparse_8IntIndex_lookup_array(__pyx_v_self, __pyx_v_indexer, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.lookup_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":200
 *         return results
 * 
 *     cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                           float64_t fill_value, SparseIndex other_):
 *         cdef:
 */

static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_6pandas_7_sparse_8IntIndex_reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_other = 0;
  PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_sinds = 0;
  PyArrayObject *__pyx_v_oinds = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_oinds;
  __Pyx_Buffer __pyx_pybuffer_oinds;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_sinds;
  __Pyx_Buffer __pyx_pybuffer_sinds;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyArrayObject *__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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reindex", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_sinds.pybuffer.buf = NULL;
  __pyx_pybuffer_sinds.refcount = 0;
  __pyx_pybuffernd_sinds.data = NULL;
  __pyx_pybuffernd_sinds.rcbuffer = &__pyx_pybuffer_sinds;
  __pyx_pybuffer_oinds.pybuffer.buf = NULL;
  __pyx_pybuffer_oinds.refcount = 0;
  __pyx_pybuffernd_oinds.data = NULL;
  __pyx_pybuffernd_oinds.rcbuffer = &__pyx_pybuffer_oinds;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_25reindex)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_fill_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_other_));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_other_));
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_other_));
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":203
 *                           float64_t fill_value, SparseIndex other_):
 *         cdef:
 *             Py_ssize_t i = 0, j = 0             # <<<<<<<<<<<<<<
 *             IntIndex other
 *             ndarray[float64_t, ndim=1] result
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/sparse.pyx":208
 *             ndarray[int32_t, ndim=1] sinds, oinds
 * 
 *         other = other_.to_int_index()             # <<<<<<<<<<<<<<
 * 
 *         oinds = other.indices
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other_), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_other = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":210
 *         other = other_.to_int_index()
 * 
 *         oinds = other.indices             # <<<<<<<<<<<<<<
 *         sinds = self.indices
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_other->indices);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer, (PyObject*)__pyx_v_oinds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_oinds.diminfo[0].strides = __pyx_pybuffernd_oinds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oinds.diminfo[0].shape = __pyx_pybuffernd_oinds.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_oinds = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":211
 * 
 *         oinds = other.indices
 *         sinds = self.indices             # <<<<<<<<<<<<<<
 * 
 *         result = np.empty(other.npoints, dtype=np.float64)
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->indices);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer, (PyObject*)__pyx_v_sinds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_sinds.diminfo[0].strides = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sinds.diminfo[0].shape = __pyx_pybuffernd_sinds.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_sinds = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":213
 *         sinds = self.indices
 * 
 *         result = np.empty(other.npoints, dtype=np.float64)             # <<<<<<<<<<<<<<
 *         result.fill(fill_value)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_other->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/sparse.pyx":214
 * 
 *         result = np.empty(other.npoints, dtype=np.float64)
 *         result.fill(fill_value)             # <<<<<<<<<<<<<<
 * 
 *         for 0 <= i < other.npoints:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_fill_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/src/sparse.pyx":216
 *         result.fill(fill_value)
 * 
 *         for 0 <= i < other.npoints:             # <<<<<<<<<<<<<<
 *             while oinds[i] > sinds[j] and j < self.npoints:
 *                 j += 1
 */
  __pyx_t_6 = __pyx_v_other->npoints;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "pandas/src/sparse.pyx":217
 * 
 *         for 0 <= i < other.npoints:
 *             while oinds[i] > sinds[j] and j < self.npoints:             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
    while (1) {
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_oinds.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_oinds.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_8 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_sinds.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_sinds.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_oinds.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_oinds.diminfo[0].strides)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_sinds.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_sinds.diminfo[0].strides))) != 0);
      if (__pyx_t_16) {
      } else {
        __pyx_t_13 = __pyx_t_16;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_16 = ((__pyx_v_j < __pyx_v_self->npoints) != 0);
      __pyx_t_13 = __pyx_t_16;
      __pyx_L7_bool_binop_done:;
      if (!__pyx_t_13) break;

      /* "pandas/src/sparse.pyx":218
 *         for 0 <= i < other.npoints:
 *             while oinds[i] > sinds[j] and j < self.npoints:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *             if j == self.npoints:
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "pandas/src/sparse.pyx":220
 *                 j += 1
 * 
 *             if j == self.npoints:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_13 = ((__pyx_v_j == __pyx_v_self->npoints) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/sparse.pyx":221
 * 
 *             if j == self.npoints:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             if oinds[i] < sinds[j]:
 */
      goto __pyx_L4_break;

      /* "pandas/src/sparse.pyx":220
 *                 j += 1
 * 
 *             if j == self.npoints:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "pandas/src/sparse.pyx":223
 *                 break
 * 
 *             if oinds[i] < sinds[j]:             # <<<<<<<<<<<<<<
 *                 continue
 *             elif oinds[i] == sinds[j]:
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_oinds.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_oinds.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_18 = __pyx_v_j;
    __pyx_t_8 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_pybuffernd_sinds.diminfo[0].shape;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_sinds.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_oinds.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_oinds.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_sinds.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_sinds.diminfo[0].strides))) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/sparse.pyx":224
 * 
 *             if oinds[i] < sinds[j]:
 *                 continue             # <<<<<<<<<<<<<<
 *             elif oinds[i] == sinds[j]:
 *                 result[i] = values[j]
 */
      goto __pyx_L3_continue;

      /* "pandas/src/sparse.pyx":223
 *                 break
 * 
 *             if oinds[i] < sinds[j]:             # <<<<<<<<<<<<<<
 *                 continue
 *             elif oinds[i] == sinds[j]:
 */
    }

    /* "pandas/src/sparse.pyx":225
 *             if oinds[i] < sinds[j]:
 *                 continue
 *             elif oinds[i] == sinds[j]:             # <<<<<<<<<<<<<<
 *                 result[i] = values[j]
 *                 j += 1
 */
    __pyx_t_19 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_pybuffernd_oinds.diminfo[0].shape;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_oinds.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_20 = __pyx_v_j;
    __pyx_t_8 = -1;
    if (__pyx_t_20 < 0) {
      __pyx_t_20 += __pyx_pybuffernd_sinds.diminfo[0].shape;
      if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_sinds.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_oinds.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_oinds.diminfo[0].strides)) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_sinds.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_sinds.diminfo[0].strides))) != 0);
    if (__pyx_t_13) {

      /* "pandas/src/sparse.pyx":226
 *                 continue
 *             elif oinds[i] == sinds[j]:
 *                 result[i] = values[j]             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
      __pyx_t_21 = __pyx_v_j;
      __pyx_t_8 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_pybuffernd_values.diminfo[0].shape;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_pybuffernd_result.diminfo[0].shape;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_result.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_values.diminfo[0].strides));

      /* "pandas/src/sparse.pyx":227
 *             elif oinds[i] == sinds[j]:
 *                 result[i] = values[j]
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_v_j = (__pyx_v_j + 1);

      /* "pandas/src/sparse.pyx":225
 *             if oinds[i] < sinds[j]:
 *                 continue
 *             elif oinds[i] == sinds[j]:             # <<<<<<<<<<<<<<
 *                 result[i] = values[j]
 *                 j += 1
 */
    }
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/sparse.pyx":229
 *                 j += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cpdef put(self, ndarray[float64_t, ndim=1] values,
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyArrayObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":200
 *         return results
 * 
 *     cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                           float64_t fill_value, SparseIndex other_):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oinds.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sinds.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_other);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_sinds);
  __Pyx_XDECREF((PyObject *)__pyx_v_oinds);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fill_value;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_ = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reindex (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_fill_value,&__pyx_n_s_other,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reindex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_fill_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fill_value == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_other_ = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.IntIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "other_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_24reindex(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_24reindex(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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("reindex", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_7_sparse_8IntIndex_reindex(__pyx_v_self, __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":231
 *         return result
 * 
 *     cpdef put(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *               ndarray[int32_t, ndim=1] indices, object to_put):
 *         pass
 */

static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_put(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_to_put, int __pyx_skip_dispatch) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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("put", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_27put)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_indices));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_indices));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_indices));
      __Pyx_INCREF(__pyx_v_to_put);
      __Pyx_GIVEREF(__pyx_v_to_put);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_to_put);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":233
 *     cpdef put(self, ndarray[float64_t, ndim=1] values,
 *               ndarray[int32_t, ndim=1] indices, object to_put):
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef take(self, ndarray[float64_t, ndim=1] values,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":231
 *         return result
 * 
 *     cpdef put(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *               ndarray[int32_t, ndim=1] indices, object to_put):
 *         pass
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_to_put = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,&__pyx_n_s_to_put,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_put)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_indices = ((PyArrayObject *)values[1]);
    __pyx_v_to_put = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.IntIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_26put(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices, __pyx_v_to_put);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_26put(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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("put", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_8IntIndex_put(__pyx_v_self, __pyx_v_values, __pyx_v_indices, __pyx_v_to_put, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":235
 *         pass
 * 
 *     cpdef take(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                ndarray[int32_t, ndim=1] indices):
 *         pass
 */

static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_29take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_8IntIndex_take(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, int __pyx_skip_dispatch) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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("take", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_29take)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_indices));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_indices));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_indices));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":237
 *     cpdef take(self, ndarray[float64_t, ndim=1] values,
 *                ndarray[int32_t, ndim=1] indices):
 *         pass             # <<<<<<<<<<<<<<
 * 
 * cpdef get_blocks(ndarray[int32_t, ndim=1] indices):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":235
 *         pass
 * 
 *     cpdef take(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                ndarray[int32_t, ndim=1] indices):
 *         pass
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_29take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_29take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indices = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_indices = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.IntIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_28take(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_28take(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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("take", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_8IntIndex_take(__pyx_v_self, __pyx_v_values, __pyx_v_indices, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.IntIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":53
 *     """
 *     cdef readonly:
 *         Py_ssize_t length, npoints             # <<<<<<<<<<<<<<
 *         ndarray indices
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_6length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_6length___get__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7npoints_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7npoints_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_7npoints___get__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.IntIndex.npoints.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":54
 *     cdef readonly:
 *         Py_ssize_t length, npoints
 *         ndarray indices             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, Py_ssize_t length, indices):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_7indices_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_7indices___get__(((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8IntIndex_7indices___get__(struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->indices));
  __pyx_r = ((PyObject *)__pyx_v_self->indices);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":239
 *         pass
 * 
 * cpdef get_blocks(ndarray[int32_t, ndim=1] indices):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, npoints
 */

static PyObject *__pyx_pw_6pandas_7_sparse_1get_blocks(PyObject *__pyx_self, PyObject *__pyx_v_indices); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_get_blocks(PyArrayObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_npoints;
  __pyx_t_5numpy_int32_t __pyx_v_block;
  __pyx_t_5numpy_int32_t __pyx_v_length;
  __pyx_t_5numpy_int32_t __pyx_v_cur;
  __pyx_t_5numpy_int32_t __pyx_v_prev;
  PyObject *__pyx_v_locs = 0;
  PyObject *__pyx_v_lens = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_5numpy_int32_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_blocks", 0);
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/sparse.pyx":242
 *     cdef:
 *         Py_ssize_t i, npoints
 *         int32_t block, length = 1, cur, prev             # <<<<<<<<<<<<<<
 *         list locs = [], lens = []
 * 
 */
  __pyx_v_length = 1;

  /* "pandas/src/sparse.pyx":243
 *         Py_ssize_t i, npoints
 *         int32_t block, length = 1, cur, prev
 *         list locs = [], lens = []             # <<<<<<<<<<<<<<
 * 
 *     npoints = len(indices)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_locs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lens = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":245
 *         list locs = [], lens = []
 * 
 *     npoints = len(indices)             # <<<<<<<<<<<<<<
 * 
 *     # just handle the special empty case separately
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_indices)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_npoints = __pyx_t_2;

  /* "pandas/src/sparse.pyx":248
 * 
 *     # just handle the special empty case separately
 *     if npoints == 0:             # <<<<<<<<<<<<<<
 *         return [], []
 * 
 */
  __pyx_t_3 = ((__pyx_v_npoints == 0) != 0);
  if (__pyx_t_3) {

    /* "pandas/src/sparse.pyx":249
 *     # just handle the special empty case separately
 *     if npoints == 0:
 *         return [], []             # <<<<<<<<<<<<<<
 * 
 *     # TODO: two-pass algorithm faster?
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":248
 * 
 *     # just handle the special empty case separately
 *     if npoints == 0:             # <<<<<<<<<<<<<<
 *         return [], []
 * 
 */
  }

  /* "pandas/src/sparse.pyx":252
 * 
 *     # TODO: two-pass algorithm faster?
 *     prev = block = indices[0]             # <<<<<<<<<<<<<<
 *     for i from 1 <= i < npoints:
 *         cur = indices[i]
 */
  __pyx_t_6 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_6 < 0) {
    __pyx_t_6 += __pyx_pybuffernd_indices.diminfo[0].shape;
    if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_indices.diminfo[0].strides));
  __pyx_v_prev = __pyx_t_8;
  __pyx_v_block = __pyx_t_8;

  /* "pandas/src/sparse.pyx":253
 *     # TODO: two-pass algorithm faster?
 *     prev = block = indices[0]
 *     for i from 1 <= i < npoints:             # <<<<<<<<<<<<<<
 *         cur = indices[i]
 *         if cur - prev > 1:
 */
  __pyx_t_2 = __pyx_v_npoints;
  for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/sparse.pyx":254
 *     prev = block = indices[0]
 *     for i from 1 <= i < npoints:
 *         cur = indices[i]             # <<<<<<<<<<<<<<
 *         if cur - prev > 1:
 *             # new block
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_pybuffernd_indices.diminfo[0].shape;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_indices.diminfo[0].strides));

    /* "pandas/src/sparse.pyx":255
 *     for i from 1 <= i < npoints:
 *         cur = indices[i]
 *         if cur - prev > 1:             # <<<<<<<<<<<<<<
 *             # new block
 *             locs.append(block)
 */
    __pyx_t_3 = (((__pyx_v_cur - __pyx_v_prev) > 1) != 0);
    if (__pyx_t_3) {

      /* "pandas/src/sparse.pyx":257
 *         if cur - prev > 1:
 *             # new block
 *             locs.append(block)             # <<<<<<<<<<<<<<
 *             lens.append(length)
 *             block = cur
 */
      __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_block); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_locs, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pandas/src/sparse.pyx":258
 *             # new block
 *             locs.append(block)
 *             lens.append(length)             # <<<<<<<<<<<<<<
 *             block = cur
 *             length = 1
 */
      __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lens, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pandas/src/sparse.pyx":259
 *             locs.append(block)
 *             lens.append(length)
 *             block = cur             # <<<<<<<<<<<<<<
 *             length = 1
 *         else:
 */
      __pyx_v_block = __pyx_v_cur;

      /* "pandas/src/sparse.pyx":260
 *             lens.append(length)
 *             block = cur
 *             length = 1             # <<<<<<<<<<<<<<
 *         else:
 *             # same block, increment length
 */
      __pyx_v_length = 1;

      /* "pandas/src/sparse.pyx":255
 *     for i from 1 <= i < npoints:
 *         cur = indices[i]
 *         if cur - prev > 1:             # <<<<<<<<<<<<<<
 *             # new block
 *             locs.append(block)
 */
      goto __pyx_L6;
    }

    /* "pandas/src/sparse.pyx":263
 *         else:
 *             # same block, increment length
 *             length += 1             # <<<<<<<<<<<<<<
 * 
 *         prev = cur
 */
    /*else*/ {
      __pyx_v_length = (__pyx_v_length + 1);
    }
    __pyx_L6:;

    /* "pandas/src/sparse.pyx":265
 *             length += 1
 * 
 *         prev = cur             # <<<<<<<<<<<<<<
 * 
 *     locs.append(block)
 */
    __pyx_v_prev = __pyx_v_cur;
  }

  /* "pandas/src/sparse.pyx":267
 *         prev = cur
 * 
 *     locs.append(block)             # <<<<<<<<<<<<<<
 *     lens.append(length)
 *     return locs, lens
 */
  __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_block); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_locs, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":268
 * 
 *     locs.append(block)
 *     lens.append(length)             # <<<<<<<<<<<<<<
 *     return locs, lens
 * 
 */
  __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lens, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":269
 *     locs.append(block)
 *     lens.append(length)
 *     return locs, lens             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_locs);
  __Pyx_GIVEREF(__pyx_v_locs);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_locs);
  __Pyx_INCREF(__pyx_v_lens);
  __Pyx_GIVEREF(__pyx_v_lens);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_lens);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":239
 *         pass
 * 
 * cpdef get_blocks(ndarray[int32_t, ndim=1] indices):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, npoints
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.get_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_locs);
  __Pyx_XDECREF(__pyx_v_lens);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_1get_blocks(PyObject *__pyx_self, PyObject *__pyx_v_indices); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_1get_blocks(PyObject *__pyx_self, PyObject *__pyx_v_indices) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_blocks (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_get_blocks(__pyx_self, ((PyArrayObject *)__pyx_v_indices));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_get_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_indices) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  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_blocks", 0);
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_get_blocks(__pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.get_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":290
 *         int32_t *lenbuf
 * 
 *     def __init__(self, length, blocs, blengths):             # <<<<<<<<<<<<<<
 * 
 *         self.blocs = np.ascontiguousarray(blocs, dtype=np.int32)
 */

/* Python wrapper */
static int __pyx_pw_6pandas_7_sparse_10BlockIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_7_sparse_10BlockIndex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_blocs = 0;
  PyObject *__pyx_v_blengths = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_blocs,&__pyx_n_s_blengths,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blocs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blengths)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_length = values[0];
    __pyx_v_blocs = values[1];
    __pyx_v_blengths = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex___init__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_length, __pyx_v_blocs, __pyx_v_blengths);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_7_sparse_10BlockIndex___init__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_blocs, PyObject *__pyx_v_blengths) {
  int __pyx_r;
  __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;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pandas/src/sparse.pyx":292
 *     def __init__(self, length, blocs, blengths):
 * 
 *         self.blocs = np.ascontiguousarray(blocs, dtype=np.int32)             # <<<<<<<<<<<<<<
 *         self.blengths = np.ascontiguousarray(blengths, dtype=np.int32)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_blocs);
  __Pyx_GIVEREF(__pyx_v_blocs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_blocs);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->blocs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->blocs));
  __pyx_v_self->blocs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":293
 * 
 *         self.blocs = np.ascontiguousarray(blocs, dtype=np.int32)
 *         self.blengths = np.ascontiguousarray(blengths, dtype=np.int32)             # <<<<<<<<<<<<<<
 * 
 *         # in case we need
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_blengths);
  __Pyx_GIVEREF(__pyx_v_blengths);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_blengths);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->blengths);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->blengths));
  __pyx_v_self->blengths = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/sparse.pyx":296
 * 
 *         # in case we need
 *         self.locbuf = <int32_t*> self.blocs.data             # <<<<<<<<<<<<<<
 *         self.lenbuf = <int32_t*> self.blengths.data
 * 
 */
  __pyx_v_self->locbuf = ((__pyx_t_5numpy_int32_t *)__pyx_v_self->blocs->data);

  /* "pandas/src/sparse.pyx":297
 *         # in case we need
 *         self.locbuf = <int32_t*> self.blocs.data
 *         self.lenbuf = <int32_t*> self.blengths.data             # <<<<<<<<<<<<<<
 * 
 *         self.length = length
 */
  __pyx_v_self->lenbuf = ((__pyx_t_5numpy_int32_t *)__pyx_v_self->blengths->data);

  /* "pandas/src/sparse.pyx":299
 *         self.lenbuf = <int32_t*> self.blengths.data
 * 
 *         self.length = length             # <<<<<<<<<<<<<<
 *         self.nblocks = len(self.blocs)
 *         self.npoints = self.blengths.sum()
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_length); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->length = __pyx_t_6;

  /* "pandas/src/sparse.pyx":300
 * 
 *         self.length = length
 *         self.nblocks = len(self.blocs)             # <<<<<<<<<<<<<<
 *         self.npoints = self.blengths.sum()
 * 
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_self->blocs);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->nblocks = __pyx_t_6;

  /* "pandas/src/sparse.pyx":301
 *         self.length = length
 *         self.nblocks = len(self.blocs)
 *         self.npoints = self.blengths.sum()             # <<<<<<<<<<<<<<
 * 
 *         # self.block_start = blocs
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->blengths), __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->npoints = __pyx_t_6;

  /* "pandas/src/sparse.pyx":306
 *         # self.block_end = blocs + blengths
 * 
 *         self.check_integrity()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_self->__pyx_vtab)->check_integrity(__pyx_v_self, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pandas/src/sparse.pyx":290
 *         int32_t *lenbuf
 * 
 *     def __init__(self, length, blocs, blengths):             # <<<<<<<<<<<<<<
 * 
 *         self.blocs = np.ascontiguousarray(blocs, dtype=np.int32)
 */

  /* 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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":308
 *         self.check_integrity()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         args = (self.length, self.blocs, self.blengths)
 *         return (BlockIndex, args)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_2__reduce__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_2__reduce__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) {
  PyObject *__pyx_v_args = NULL;
  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("__reduce__", 0);

  /* "pandas/src/sparse.pyx":309
 * 
 *     def __reduce__(self):
 *         args = (self.length, self.blocs, self.blengths)             # <<<<<<<<<<<<<<
 *         return (BlockIndex, args)
 * 
 */
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blocs));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->blocs));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blengths));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->blengths));
  __pyx_t_1 = 0;
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":310
 *     def __reduce__(self):
 *         args = (self.length, self.blocs, self.blengths)
 *         return (BlockIndex, args)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex));
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":308
 *         self.check_integrity()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         args = (self.length, self.blocs, self.blengths)
 *         return (BlockIndex, args)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":312
 *         return (BlockIndex, args)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         output = 'BlockIndex\n'
 *         output += 'Block locations: %s\n' % repr(self.blocs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_4__repr__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_4__repr__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) {
  PyObject *__pyx_v_output = NULL;
  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("__repr__", 0);

  /* "pandas/src/sparse.pyx":313
 * 
 *     def __repr__(self):
 *         output = 'BlockIndex\n'             # <<<<<<<<<<<<<<
 *         output += 'Block locations: %s\n' % repr(self.blocs)
 *         output += 'Block lengths: %s' % repr(self.blengths)
 */
  __Pyx_INCREF(__pyx_n_s_BlockIndex);
  __pyx_v_output = __pyx_n_s_BlockIndex;

  /* "pandas/src/sparse.pyx":314
 *     def __repr__(self):
 *         output = 'BlockIndex\n'
 *         output += 'Block locations: %s\n' % repr(self.blocs)             # <<<<<<<<<<<<<<
 *         output += 'Block lengths: %s' % repr(self.blengths)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Block_locations_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":315
 *         output = 'BlockIndex\n'
 *         output += 'Block locations: %s\n' % repr(self.blocs)
 *         output += 'Block lengths: %s' % repr(self.blengths)             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->blengths);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Block_lengths_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_output, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":317
 *         output += 'Block lengths: %s' % repr(self.blengths)
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_output);
  __pyx_r = __pyx_v_output;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":312
 *         return (BlockIndex, args)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         output = 'BlockIndex\n'
 *         output += 'Block locations: %s\n' % repr(self.blocs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":320
 * 
 *     @property
 *     def ngaps(self):             # <<<<<<<<<<<<<<
 *         return self.length - self.npoints
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7ngaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ngaps (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_6ngaps(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6ngaps(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__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("ngaps", 0);

  /* "pandas/src/sparse.pyx":321
 *     @property
 *     def ngaps(self):
 *         return self.length - self.npoints             # <<<<<<<<<<<<<<
 * 
 *     cpdef check_integrity(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->length - __pyx_v_self->npoints)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":320
 * 
 *     @property
 *     def ngaps(self):             # <<<<<<<<<<<<<<
 *         return self.length - self.npoints
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.ngaps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":323
 *         return self.length - self.npoints
 * 
 *     cpdef check_integrity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check:
 */

static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  PyArrayObject *__pyx_v_blocs = 0;
  PyArrayObject *__pyx_v_blengths = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_blengths;
  __Pyx_Buffer __pyx_pybuffer_blengths;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_blocs;
  __Pyx_Buffer __pyx_pybuffer_blocs;
  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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_integrity", 0);
  __pyx_pybuffer_blocs.pybuffer.buf = NULL;
  __pyx_pybuffer_blocs.refcount = 0;
  __pyx_pybuffernd_blocs.data = NULL;
  __pyx_pybuffernd_blocs.rcbuffer = &__pyx_pybuffer_blocs;
  __pyx_pybuffer_blengths.pybuffer.buf = NULL;
  __pyx_pybuffer_blengths.refcount = 0;
  __pyx_pybuffernd_blengths.data = NULL;
  __pyx_pybuffernd_blengths.rcbuffer = &__pyx_pybuffer_blengths;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_integrity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":334
 *             ndarray[int32_t, ndim=1] blocs, blengths
 * 
 *         blocs = self.blocs             # <<<<<<<<<<<<<<
 *         blengths = self.blengths
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer, (PyObject*)__pyx_v_blocs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_pybuffernd_blocs.diminfo[0].strides = __pyx_pybuffernd_blocs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_blocs.diminfo[0].shape = __pyx_pybuffernd_blocs.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_blocs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":335
 * 
 *         blocs = self.blocs
 *         blengths = self.blengths             # <<<<<<<<<<<<<<
 * 
 *         if len(blocs) != len(blengths):
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blengths);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer, (PyObject*)__pyx_v_blengths, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_pybuffernd_blengths.diminfo[0].strides = __pyx_pybuffernd_blengths.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_blengths.diminfo[0].shape = __pyx_pybuffernd_blengths.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_blengths = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":337
 *         blengths = self.blengths
 * 
 *         if len(blocs) != len(blengths):             # <<<<<<<<<<<<<<
 *             raise ValueError('block bound arrays must be same length')
 * 
 */
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_blocs)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_blengths)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((__pyx_t_9 != __pyx_t_10) != 0);
  if (__pyx_t_11) {

    /* "pandas/src/sparse.pyx":338
 * 
 *         if len(blocs) != len(blengths):
 *             raise ValueError('block bound arrays must be same length')             # <<<<<<<<<<<<<<
 * 
 *         for i from 0 <= i < self.nblocks:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":337
 *         blengths = self.blengths
 * 
 *         if len(blocs) != len(blengths):             # <<<<<<<<<<<<<<
 *             raise ValueError('block bound arrays must be same length')
 * 
 */
  }

  /* "pandas/src/sparse.pyx":340
 *             raise ValueError('block bound arrays must be same length')
 * 
 *         for i from 0 <= i < self.nblocks:             # <<<<<<<<<<<<<<
 *             if i > 0:
 *                 if blocs[i] <= blocs[i-1]:
 */
  __pyx_t_10 = __pyx_v_self->nblocks;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "pandas/src/sparse.pyx":341
 * 
 *         for i from 0 <= i < self.nblocks:
 *             if i > 0:             # <<<<<<<<<<<<<<
 *                 if blocs[i] <= blocs[i-1]:
 *                     raise ValueError('Locations not in ascending order')
 */
    __pyx_t_11 = ((__pyx_v_i > 0) != 0);
    if (__pyx_t_11) {

      /* "pandas/src/sparse.pyx":342
 *         for i from 0 <= i < self.nblocks:
 *             if i > 0:
 *                 if blocs[i] <= blocs[i-1]:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Locations not in ascending order')
 * 
 */
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_5 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_blocs.diminfo[0].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = (__pyx_v_i - 1);
      __pyx_t_5 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_blocs.diminfo[0].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_11 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_blocs.diminfo[0].strides)) <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_blocs.diminfo[0].strides))) != 0);
      if (__pyx_t_11) {

        /* "pandas/src/sparse.pyx":343
 *             if i > 0:
 *                 if blocs[i] <= blocs[i-1]:
 *                     raise ValueError('Locations not in ascending order')             # <<<<<<<<<<<<<<
 * 
 *             if i < self.nblocks - 1:
 */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/src/sparse.pyx":342
 *         for i from 0 <= i < self.nblocks:
 *             if i > 0:
 *                 if blocs[i] <= blocs[i-1]:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Locations not in ascending order')
 * 
 */
      }

      /* "pandas/src/sparse.pyx":341
 * 
 *         for i from 0 <= i < self.nblocks:
 *             if i > 0:             # <<<<<<<<<<<<<<
 *                 if blocs[i] <= blocs[i-1]:
 *                     raise ValueError('Locations not in ascending order')
 */
    }

    /* "pandas/src/sparse.pyx":345
 *                     raise ValueError('Locations not in ascending order')
 * 
 *             if i < self.nblocks - 1:             # <<<<<<<<<<<<<<
 *                 if blocs[i] + blengths[i] > blocs[i + 1]:
 *                     raise ValueError('Block %d overlaps' % i)
 */
    __pyx_t_11 = ((__pyx_v_i < (__pyx_v_self->nblocks - 1)) != 0);
    if (__pyx_t_11) {

      /* "pandas/src/sparse.pyx":346
 * 
 *             if i < self.nblocks - 1:
 *                 if blocs[i] + blengths[i] > blocs[i + 1]:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Block %d overlaps' % i)
 *             else:
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_5 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_blocs.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_5 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_blengths.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_blengths.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = (__pyx_v_i + 1);
      __pyx_t_5 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_blocs.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_11 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_blocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_blengths.diminfo[0].strides))) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_blocs.diminfo[0].strides))) != 0);
      if (__pyx_t_11) {

        /* "pandas/src/sparse.pyx":347
 *             if i < self.nblocks - 1:
 *                 if blocs[i] + blengths[i] > blocs[i + 1]:
 *                     raise ValueError('Block %d overlaps' % i)             # <<<<<<<<<<<<<<
 *             else:
 *                 if blocs[i] + blengths[i] > self.length:
 */
        __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Block_d_overlaps, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/src/sparse.pyx":346
 * 
 *             if i < self.nblocks - 1:
 *                 if blocs[i] + blengths[i] > blocs[i + 1]:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Block %d overlaps' % i)
 *             else:
 */
      }

      /* "pandas/src/sparse.pyx":345
 *                     raise ValueError('Locations not in ascending order')
 * 
 *             if i < self.nblocks - 1:             # <<<<<<<<<<<<<<
 *                 if blocs[i] + blengths[i] > blocs[i + 1]:
 *                     raise ValueError('Block %d overlaps' % i)
 */
      goto __pyx_L8;
    }

    /* "pandas/src/sparse.pyx":349
 *                     raise ValueError('Block %d overlaps' % i)
 *             else:
 *                 if blocs[i] + blengths[i] > self.length:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Block %d extends beyond end' % i)
 * 
 */
    /*else*/ {
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_5 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_blocs.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_blocs.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_5 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_blengths.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_blengths.diminfo[0].shape)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_11 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_blocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_blengths.diminfo[0].strides))) > __pyx_v_self->length) != 0);
      if (__pyx_t_11) {

        /* "pandas/src/sparse.pyx":350
 *             else:
 *                 if blocs[i] + blengths[i] > self.length:
 *                     raise ValueError('Block %d extends beyond end' % i)             # <<<<<<<<<<<<<<
 * 
 *             # no zero-length blocks
 */
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Block_d_extends_beyond_end, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/src/sparse.pyx":349
 *                     raise ValueError('Block %d overlaps' % i)
 *             else:
 *                 if blocs[i] + blengths[i] > self.length:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Block %d extends beyond end' % i)
 * 
 */
      }
    }
    __pyx_L8:;

    /* "pandas/src/sparse.pyx":353
 * 
 *             # no zero-length blocks
 *             if blengths[i] == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Zero-length block %d' % i)
 * 
 */
    __pyx_t_19 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_pybuffernd_blengths.diminfo[0].shape;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_blengths.diminfo[0].shape)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_blengths.diminfo[0].strides)) == 0) != 0);
    if (__pyx_t_11) {

      /* "pandas/src/sparse.pyx":354
 *             # no zero-length blocks
 *             if blengths[i] == 0:
 *                 raise ValueError('Zero-length block %d' % i)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, other):
 */
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Zero_length_block_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "pandas/src/sparse.pyx":353
 * 
 *             # no zero-length blocks
 *             if blengths[i] == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Zero-length block %d' % i)
 * 
 */
    }
  }

  /* "pandas/src/sparse.pyx":323
 *         return self.length - self.npoints
 * 
 *     cpdef check_integrity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.check_integrity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blengths.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_blocs.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_blocs);
  __Pyx_XDECREF((PyObject *)__pyx_v_blengths);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pandas_7_sparse_10BlockIndex_8check_integrity[] = "\n        Check:\n        - Locations are in ascending order\n        - No overlapping blocks\n        - Blocks to not start after end of index, nor extend beyond end\n        ";
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_integrity (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_8check_integrity(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8check_integrity(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__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("check_integrity", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_10BlockIndex_check_integrity(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.check_integrity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":356
 *                 raise ValueError('Zero-length block %d' % i)
 * 
 *     def equals(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, BlockIndex):
 *             return False
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_11equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_11equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_10equals(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_10equals(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_v_same_length = NULL;
  PyObject *__pyx_v_same_blocks = NULL;
  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;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pandas/src/sparse.pyx":357
 * 
 *     def equals(self, other):
 *         if not isinstance(other, BlockIndex):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_6pandas_7_sparse_BlockIndex); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/sparse.pyx":358
 *     def equals(self, other):
 *         if not isinstance(other, BlockIndex):
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         if self is other:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":357
 * 
 *     def equals(self, other):
 *         if not isinstance(other, BlockIndex):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "pandas/src/sparse.pyx":360
 *             return False
 * 
 *         if self is other:             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_self) == __pyx_v_other);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":361
 * 
 *         if self is other:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         same_length = self.length == other.length
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":360
 *             return False
 * 
 *         if self is other:             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  }

  /* "pandas/src/sparse.pyx":363
 *             return True
 * 
 *         same_length = self.length == other.length             # <<<<<<<<<<<<<<
 *         same_blocks = (np.array_equal(self.blocs, other.blocs) and
 *                        np.array_equal(self.blengths, other.blengths))
 */
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_same_length = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":364
 * 
 *         same_length = self.length == other.length
 *         same_blocks = (np.array_equal(self.blocs, other.blocs) and             # <<<<<<<<<<<<<<
 *                        np.array_equal(self.blengths, other.blengths))
 *         return same_length and same_blocks
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_blocs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_7) {
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blocs));
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_self->blocs));
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_bool_binop_done;
  }

  /* "pandas/src/sparse.pyx":365
 *         same_length = self.length == other.length
 *         same_blocks = (np.array_equal(self.blocs, other.blocs) and
 *                        np.array_equal(self.blengths, other.blengths))             # <<<<<<<<<<<<<<
 *         return same_length and same_blocks
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array_equal); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_blengths); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blengths));
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, ((PyObject *)__pyx_v_self->blengths));
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L5_bool_binop_done:;
  __pyx_v_same_blocks = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":366
 *         same_blocks = (np.array_equal(self.blocs, other.blocs) and
 *                        np.array_equal(self.blengths, other.blengths))
 *         return same_length and same_blocks             # <<<<<<<<<<<<<<
 * 
 *     def to_block_index(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_same_length); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {
  } else {
    __Pyx_INCREF(__pyx_v_same_length);
    __pyx_t_5 = __pyx_v_same_length;
    goto __pyx_L7_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_v_same_blocks);
  __pyx_t_5 = __pyx_v_same_blocks;
  __pyx_L7_bool_binop_done:;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":356
 *                 raise ValueError('Zero-length block %d' % i)
 * 
 *     def equals(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, BlockIndex):
 *             return False
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_same_length);
  __Pyx_XDECREF(__pyx_v_same_blocks);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":368
 *         return same_length and same_blocks
 * 
 *     def to_block_index(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_13to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_13to_block_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_block_index (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_12to_block_index(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_12to_block_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_block_index", 0);

  /* "pandas/src/sparse.pyx":369
 * 
 *     def to_block_index(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def to_int_index(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":368
 *         return same_length and same_blocks
 * 
 *     def to_block_index(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":371
 *         return self
 * 
 *     def to_int_index(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i = 0, j, b
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_15to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_15to_int_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_int_index (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_14to_int_index(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_14to_int_index(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_int32_t __pyx_v_offset;
  PyArrayObject *__pyx_v_indices = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  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;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  __pyx_t_5numpy_int32_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_int_index", 0);
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;

  /* "pandas/src/sparse.pyx":373
 *     def to_int_index(self):
 *         cdef:
 *             Py_ssize_t i = 0, j, b             # <<<<<<<<<<<<<<
 *             int32_t offset
 *             ndarray[int32_t, ndim=1] indices
 */
  __pyx_v_i = 0;

  /* "pandas/src/sparse.pyx":377
 *             ndarray[int32_t, ndim=1] indices
 * 
 *         indices = np.empty(self.npoints, dtype=np.int32)             # <<<<<<<<<<<<<<
 * 
 *         for b from 0 <= b < self.nblocks:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_indices = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":379
 *         indices = np.empty(self.npoints, dtype=np.int32)
 * 
 *         for b from 0 <= b < self.nblocks:             # <<<<<<<<<<<<<<
 *             offset = self.locbuf[b]
 * 
 */
  __pyx_t_11 = __pyx_v_self->nblocks;
  for (__pyx_v_b = 0; __pyx_v_b < __pyx_t_11; __pyx_v_b++) {

    /* "pandas/src/sparse.pyx":380
 * 
 *         for b from 0 <= b < self.nblocks:
 *             offset = self.locbuf[b]             # <<<<<<<<<<<<<<
 * 
 *             for j from 0 <= j < self.lenbuf[b]:
 */
    __pyx_v_offset = (__pyx_v_self->locbuf[__pyx_v_b]);

    /* "pandas/src/sparse.pyx":382
 *             offset = self.locbuf[b]
 * 
 *             for j from 0 <= j < self.lenbuf[b]:             # <<<<<<<<<<<<<<
 *                 indices[i] = offset + j
 *                 i += 1
 */
    __pyx_t_12 = (__pyx_v_self->lenbuf[__pyx_v_b]);
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_12; __pyx_v_j++) {

      /* "pandas/src/sparse.pyx":383
 * 
 *             for j from 0 <= j < self.lenbuf[b]:
 *                 indices[i] = offset + j             # <<<<<<<<<<<<<<
 *                 i += 1
 * 
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_indices.diminfo[0].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_indices.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_indices.diminfo[0].strides) = (__pyx_v_offset + __pyx_v_j);

      /* "pandas/src/sparse.pyx":384
 *             for j from 0 <= j < self.lenbuf[b]:
 *                 indices[i] = offset + j
 *                 i += 1             # <<<<<<<<<<<<<<
 * 
 *         return IntIndex(self.length, indices)
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
  }

  /* "pandas/src/sparse.pyx":386
 *                 i += 1
 * 
 *         return IntIndex(self.length, indices)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BlockIndex intersect(self, SparseIndex other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_indices));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_indices));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indices));
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __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;

  /* "pandas/src/sparse.pyx":371
 *         return self
 * 
 *     def to_int_index(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i = 0, j, b
 */

  /* 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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.to_int_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":388
 *         return IntIndex(self.length, indices)
 * 
 *     cpdef BlockIndex intersect(self, SparseIndex other):             # <<<<<<<<<<<<<<
 *         """
 *         Intersect two BlockIndex objects
 */

static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_f_6pandas_7_sparse_10BlockIndex_intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y = 0;
  PyArrayObject *__pyx_v_xloc = 0;
  PyArrayObject *__pyx_v_xlen = 0;
  PyArrayObject *__pyx_v_yloc = 0;
  PyArrayObject *__pyx_v_ylen = 0;
  PyObject *__pyx_v_out_blocs = 0;
  PyObject *__pyx_v_out_blengths = 0;
  Py_ssize_t __pyx_v_xi;
  Py_ssize_t __pyx_v_yi;
  __pyx_t_5numpy_int32_t __pyx_v_cur_loc;
  __pyx_t_5numpy_int32_t __pyx_v_cur_length;
  __pyx_t_5numpy_int32_t __pyx_v_diff;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xlen;
  __Pyx_Buffer __pyx_pybuffer_xlen;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xloc;
  __Pyx_Buffer __pyx_pybuffer_xloc;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ylen;
  __Pyx_Buffer __pyx_pybuffer_ylen;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_yloc;
  __Pyx_Buffer __pyx_pybuffer_yloc;
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *__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;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  int __pyx_t_30;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("intersect", 0);
  __pyx_pybuffer_xloc.pybuffer.buf = NULL;
  __pyx_pybuffer_xloc.refcount = 0;
  __pyx_pybuffernd_xloc.data = NULL;
  __pyx_pybuffernd_xloc.rcbuffer = &__pyx_pybuffer_xloc;
  __pyx_pybuffer_xlen.pybuffer.buf = NULL;
  __pyx_pybuffer_xlen.refcount = 0;
  __pyx_pybuffernd_xlen.data = NULL;
  __pyx_pybuffernd_xlen.rcbuffer = &__pyx_pybuffer_xlen;
  __pyx_pybuffer_yloc.pybuffer.buf = NULL;
  __pyx_pybuffer_yloc.refcount = 0;
  __pyx_pybuffernd_yloc.data = NULL;
  __pyx_pybuffernd_yloc.rcbuffer = &__pyx_pybuffer_yloc;
  __pyx_pybuffer_ylen.pybuffer.buf = NULL;
  __pyx_pybuffer_ylen.refcount = 0;
  __pyx_pybuffernd_ylen.data = NULL;
  __pyx_pybuffernd_ylen.rcbuffer = &__pyx_pybuffer_ylen;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_intersect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_other));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":403
 *             ndarray[int32_t, ndim=1] xloc, xlen, yloc, ylen
 * 
 *             list out_blocs = []             # <<<<<<<<<<<<<<
 *             list out_blengths = []
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out_blocs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":404
 * 
 *             list out_blocs = []
 *             list out_blengths = []             # <<<<<<<<<<<<<<
 * 
 *             Py_ssize_t xi = 0, yi = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out_blengths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":406
 *             list out_blengths = []
 * 
 *             Py_ssize_t xi = 0, yi = 0             # <<<<<<<<<<<<<<
 *             int32_t cur_loc, cur_length, diff
 * 
 */
  __pyx_v_xi = 0;
  __pyx_v_yi = 0;

  /* "pandas/src/sparse.pyx":409
 *             int32_t cur_loc, cur_length, diff
 * 
 *         y = other.to_block_index()             # <<<<<<<<<<<<<<
 * 
 *         if self.length != y.length:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":411
 *         y = other.to_block_index()
 * 
 *         if self.length != y.length:             # <<<<<<<<<<<<<<
 *             raise Exception('Indices must reference same underlying length')
 * 
 */
  __pyx_t_6 = ((__pyx_v_self->length != __pyx_v_y->length) != 0);
  if (__pyx_t_6) {

    /* "pandas/src/sparse.pyx":412
 * 
 *         if self.length != y.length:
 *             raise Exception('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         xloc = self.blocs
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":411
 *         y = other.to_block_index()
 * 
 *         if self.length != y.length:             # <<<<<<<<<<<<<<
 *             raise Exception('Indices must reference same underlying length')
 * 
 */
  }

  /* "pandas/src/sparse.pyx":414
 *             raise Exception('Indices must reference same underlying length')
 * 
 *         xloc = self.blocs             # <<<<<<<<<<<<<<
 *         xlen = self.blengths
 *         yloc = y.blocs
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer, (PyObject*)__pyx_v_xloc, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_xloc.diminfo[0].strides = __pyx_pybuffernd_xloc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xloc.diminfo[0].shape = __pyx_pybuffernd_xloc.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xloc = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":415
 * 
 *         xloc = self.blocs
 *         xlen = self.blengths             # <<<<<<<<<<<<<<
 *         yloc = y.blocs
 *         ylen = y.blengths
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blengths);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer, (PyObject*)__pyx_v_xlen, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_pybuffernd_xlen.diminfo[0].strides = __pyx_pybuffernd_xlen.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xlen.diminfo[0].shape = __pyx_pybuffernd_xlen.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xlen = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":416
 *         xloc = self.blocs
 *         xlen = self.blengths
 *         yloc = y.blocs             # <<<<<<<<<<<<<<
 *         ylen = y.blengths
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_y->blocs);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer, (PyObject*)__pyx_v_yloc, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_yloc.diminfo[0].strides = __pyx_pybuffernd_yloc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yloc.diminfo[0].shape = __pyx_pybuffernd_yloc.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yloc = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":417
 *         xlen = self.blengths
 *         yloc = y.blocs
 *         ylen = y.blengths             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_y->blengths);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer, (PyObject*)__pyx_v_ylen, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_pybuffernd_ylen.diminfo[0].strides = __pyx_pybuffernd_ylen.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ylen.diminfo[0].shape = __pyx_pybuffernd_ylen.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_ylen = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":419
 *         ylen = y.blengths
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             # we are done (or possibly never began)
 *             if xi >= self.nblocks or yi >= y.nblocks:
 */
  while (1) {

    /* "pandas/src/sparse.pyx":421
 *         while True:
 *             # we are done (or possibly never began)
 *             if xi >= self.nblocks or yi >= y.nblocks:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_11 = ((__pyx_v_xi >= __pyx_v_self->nblocks) != 0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_6 = __pyx_t_11;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_11 = ((__pyx_v_yi >= __pyx_v_y->nblocks) != 0);
    __pyx_t_6 = __pyx_t_11;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":422
 *             # we are done (or possibly never began)
 *             if xi >= self.nblocks or yi >= y.nblocks:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             # completely symmetric...would like to avoid code dup but oh well
 */
      goto __pyx_L5_break;

      /* "pandas/src/sparse.pyx":421
 *         while True:
 *             # we are done (or possibly never began)
 *             if xi >= self.nblocks or yi >= y.nblocks:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "pandas/src/sparse.pyx":425
 * 
 *             # completely symmetric...would like to avoid code dup but oh well
 *             if xloc[xi] >= yloc[yi]:             # <<<<<<<<<<<<<<
 *                 cur_loc = xloc[xi]
 *                 diff = xloc[xi] - yloc[yi]
 */
    __pyx_t_12 = __pyx_v_xi;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_pybuffernd_xloc.diminfo[0].shape;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = __pyx_v_yi;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_yloc.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_xloc.diminfo[0].strides)) >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_yloc.diminfo[0].strides))) != 0);
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":426
 *             # completely symmetric...would like to avoid code dup but oh well
 *             if xloc[xi] >= yloc[yi]:
 *                 cur_loc = xloc[xi]             # <<<<<<<<<<<<<<
 *                 diff = xloc[xi] - yloc[yi]
 * 
 */
      __pyx_t_14 = __pyx_v_xi;
      __pyx_t_7 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_xloc.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_cur_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_xloc.diminfo[0].strides));

      /* "pandas/src/sparse.pyx":427
 *             if xloc[xi] >= yloc[yi]:
 *                 cur_loc = xloc[xi]
 *                 diff = xloc[xi] - yloc[yi]             # <<<<<<<<<<<<<<
 * 
 *                 if ylen[yi] <= diff:
 */
      __pyx_t_15 = __pyx_v_xi;
      __pyx_t_7 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_xloc.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = __pyx_v_yi;
      __pyx_t_7 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_yloc.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_diff = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_xloc.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_yloc.diminfo[0].strides)));

      /* "pandas/src/sparse.pyx":429
 *                 diff = xloc[xi] - yloc[yi]
 * 
 *                 if ylen[yi] <= diff:             # <<<<<<<<<<<<<<
 *                     # have to skip this block
 *                     yi += 1
 */
      __pyx_t_17 = __pyx_v_yi;
      __pyx_t_7 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_ylen.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ylen.diminfo[0].strides)) <= __pyx_v_diff) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/sparse.pyx":431
 *                 if ylen[yi] <= diff:
 *                     # have to skip this block
 *                     yi += 1             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
        __pyx_v_yi = (__pyx_v_yi + 1);

        /* "pandas/src/sparse.pyx":432
 *                     # have to skip this block
 *                     yi += 1
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 if ylen[yi] - diff < xlen[xi]:
 */
        goto __pyx_L4_continue;

        /* "pandas/src/sparse.pyx":429
 *                 diff = xloc[xi] - yloc[yi]
 * 
 *                 if ylen[yi] <= diff:             # <<<<<<<<<<<<<<
 *                     # have to skip this block
 *                     yi += 1
 */
      }

      /* "pandas/src/sparse.pyx":434
 *                     continue
 * 
 *                 if ylen[yi] - diff < xlen[xi]:             # <<<<<<<<<<<<<<
 *                     # take end of y block, move onward
 *                     cur_length = ylen[yi] - diff
 */
      __pyx_t_18 = __pyx_v_yi;
      __pyx_t_7 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_ylen.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_19 = __pyx_v_xi;
      __pyx_t_7 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_pybuffernd_xlen.diminfo[0].shape;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ylen.diminfo[0].strides)) - __pyx_v_diff) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_xlen.diminfo[0].strides))) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/sparse.pyx":436
 *                 if ylen[yi] - diff < xlen[xi]:
 *                     # take end of y block, move onward
 *                     cur_length = ylen[yi] - diff             # <<<<<<<<<<<<<<
 *                     yi += 1
 *                 else:
 */
        __pyx_t_20 = __pyx_v_yi;
        __pyx_t_7 = -1;
        if (__pyx_t_20 < 0) {
          __pyx_t_20 += __pyx_pybuffernd_ylen.diminfo[0].shape;
          if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_cur_length = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ylen.diminfo[0].strides)) - __pyx_v_diff);

        /* "pandas/src/sparse.pyx":437
 *                     # take end of y block, move onward
 *                     cur_length = ylen[yi] - diff
 *                     yi += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # take end of x block
 */
        __pyx_v_yi = (__pyx_v_yi + 1);

        /* "pandas/src/sparse.pyx":434
 *                     continue
 * 
 *                 if ylen[yi] - diff < xlen[xi]:             # <<<<<<<<<<<<<<
 *                     # take end of y block, move onward
 *                     cur_length = ylen[yi] - diff
 */
        goto __pyx_L11;
      }

      /* "pandas/src/sparse.pyx":440
 *                 else:
 *                     # take end of x block
 *                     cur_length = xlen[xi]             # <<<<<<<<<<<<<<
 *                     xi += 1
 * 
 */
      /*else*/ {
        __pyx_t_21 = __pyx_v_xi;
        __pyx_t_7 = -1;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_pybuffernd_xlen.diminfo[0].shape;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_cur_length = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_xlen.diminfo[0].strides));

        /* "pandas/src/sparse.pyx":441
 *                     # take end of x block
 *                     cur_length = xlen[xi]
 *                     xi += 1             # <<<<<<<<<<<<<<
 * 
 *             else: # xloc[xi] < yloc[yi]
 */
        __pyx_v_xi = (__pyx_v_xi + 1);
      }
      __pyx_L11:;

      /* "pandas/src/sparse.pyx":425
 * 
 *             # completely symmetric...would like to avoid code dup but oh well
 *             if xloc[xi] >= yloc[yi]:             # <<<<<<<<<<<<<<
 *                 cur_loc = xloc[xi]
 *                 diff = xloc[xi] - yloc[yi]
 */
      goto __pyx_L9;
    }

    /* "pandas/src/sparse.pyx":444
 * 
 *             else: # xloc[xi] < yloc[yi]
 *                 cur_loc = yloc[yi]             # <<<<<<<<<<<<<<
 *                 diff = yloc[yi] - xloc[xi]
 * 
 */
    /*else*/ {
      __pyx_t_22 = __pyx_v_yi;
      __pyx_t_7 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_pybuffernd_yloc.diminfo[0].shape;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_cur_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_yloc.diminfo[0].strides));

      /* "pandas/src/sparse.pyx":445
 *             else: # xloc[xi] < yloc[yi]
 *                 cur_loc = yloc[yi]
 *                 diff = yloc[yi] - xloc[xi]             # <<<<<<<<<<<<<<
 * 
 *                 if xlen[xi] <= diff:
 */
      __pyx_t_23 = __pyx_v_yi;
      __pyx_t_7 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_pybuffernd_yloc.diminfo[0].shape;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_yloc.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_24 = __pyx_v_xi;
      __pyx_t_7 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_pybuffernd_xloc.diminfo[0].shape;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_xloc.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_diff = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yloc.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_yloc.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xloc.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_xloc.diminfo[0].strides)));

      /* "pandas/src/sparse.pyx":447
 *                 diff = yloc[yi] - xloc[xi]
 * 
 *                 if xlen[xi] <= diff:             # <<<<<<<<<<<<<<
 *                     # have to skip this block
 *                     xi += 1
 */
      __pyx_t_25 = __pyx_v_xi;
      __pyx_t_7 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_pybuffernd_xlen.diminfo[0].shape;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_xlen.diminfo[0].strides)) <= __pyx_v_diff) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/sparse.pyx":449
 *                 if xlen[xi] <= diff:
 *                     # have to skip this block
 *                     xi += 1             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
        __pyx_v_xi = (__pyx_v_xi + 1);

        /* "pandas/src/sparse.pyx":450
 *                     # have to skip this block
 *                     xi += 1
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 if xlen[xi] - diff < ylen[yi]:
 */
        goto __pyx_L4_continue;

        /* "pandas/src/sparse.pyx":447
 *                 diff = yloc[yi] - xloc[xi]
 * 
 *                 if xlen[xi] <= diff:             # <<<<<<<<<<<<<<
 *                     # have to skip this block
 *                     xi += 1
 */
      }

      /* "pandas/src/sparse.pyx":452
 *                     continue
 * 
 *                 if xlen[xi] - diff < ylen[yi]:             # <<<<<<<<<<<<<<
 *                     # take end of x block, move onward
 *                     cur_length = xlen[xi] - diff
 */
      __pyx_t_26 = __pyx_v_xi;
      __pyx_t_7 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_pybuffernd_xlen.diminfo[0].shape;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_27 = __pyx_v_yi;
      __pyx_t_7 = -1;
      if (__pyx_t_27 < 0) {
        __pyx_t_27 += __pyx_pybuffernd_ylen.diminfo[0].shape;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_xlen.diminfo[0].strides)) - __pyx_v_diff) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_ylen.diminfo[0].strides))) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/sparse.pyx":454
 *                 if xlen[xi] - diff < ylen[yi]:
 *                     # take end of x block, move onward
 *                     cur_length = xlen[xi] - diff             # <<<<<<<<<<<<<<
 *                     xi += 1
 *                 else:
 */
        __pyx_t_28 = __pyx_v_xi;
        __pyx_t_7 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_pybuffernd_xlen.diminfo[0].shape;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_xlen.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_cur_length = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xlen.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_xlen.diminfo[0].strides)) - __pyx_v_diff);

        /* "pandas/src/sparse.pyx":455
 *                     # take end of x block, move onward
 *                     cur_length = xlen[xi] - diff
 *                     xi += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     # take end of y block
 */
        __pyx_v_xi = (__pyx_v_xi + 1);

        /* "pandas/src/sparse.pyx":452
 *                     continue
 * 
 *                 if xlen[xi] - diff < ylen[yi]:             # <<<<<<<<<<<<<<
 *                     # take end of x block, move onward
 *                     cur_length = xlen[xi] - diff
 */
        goto __pyx_L13;
      }

      /* "pandas/src/sparse.pyx":458
 *                 else:
 *                     # take end of y block
 *                     cur_length = ylen[yi]             # <<<<<<<<<<<<<<
 *                     yi += 1
 * 
 */
      /*else*/ {
        __pyx_t_29 = __pyx_v_yi;
        __pyx_t_7 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_pybuffernd_ylen.diminfo[0].shape;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ylen.diminfo[0].shape)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_cur_length = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ylen.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_ylen.diminfo[0].strides));

        /* "pandas/src/sparse.pyx":459
 *                     # take end of y block
 *                     cur_length = ylen[yi]
 *                     yi += 1             # <<<<<<<<<<<<<<
 * 
 *             out_blocs.append(cur_loc)
 */
        __pyx_v_yi = (__pyx_v_yi + 1);
      }
      __pyx_L13:;
    }
    __pyx_L9:;

    /* "pandas/src/sparse.pyx":461
 *                     yi += 1
 * 
 *             out_blocs.append(cur_loc)             # <<<<<<<<<<<<<<
 *             out_blengths.append(cur_length)
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_cur_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_out_blocs, __pyx_t_1); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pandas/src/sparse.pyx":462
 * 
 *             out_blocs.append(cur_loc)
 *             out_blengths.append(cur_length)             # <<<<<<<<<<<<<<
 * 
 *         return BlockIndex(self.length, out_blocs, out_blengths)
 */
    __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_cur_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_out_blengths, __pyx_t_1); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_L4_continue:;
  }
  __pyx_L5_break:;

  /* "pandas/src/sparse.pyx":464
 *             out_blengths.append(cur_length)
 * 
 *         return BlockIndex(self.length, out_blocs, out_blengths)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BlockIndex make_union(self, SparseIndex y):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_out_blocs);
  __Pyx_GIVEREF(__pyx_v_out_blocs);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_out_blocs);
  __Pyx_INCREF(__pyx_v_out_blengths);
  __Pyx_GIVEREF(__pyx_v_out_blengths);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_out_blengths);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":388
 *         return IntIndex(self.length, indices)
 * 
 *     cpdef BlockIndex intersect(self, SparseIndex other):             # <<<<<<<<<<<<<<
 *         """
 *         Intersect two BlockIndex objects
 */

  /* 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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xlen.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xloc.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ylen.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yloc.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XDECREF((PyObject *)__pyx_v_xloc);
  __Pyx_XDECREF((PyObject *)__pyx_v_xlen);
  __Pyx_XDECREF((PyObject *)__pyx_v_yloc);
  __Pyx_XDECREF((PyObject *)__pyx_v_ylen);
  __Pyx_XDECREF(__pyx_v_out_blocs);
  __Pyx_XDECREF(__pyx_v_out_blengths);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_6pandas_7_sparse_10BlockIndex_16intersect[] = "\n        Intersect two BlockIndex objects\n\n        Parameters\n        ----------\n\n        Returns\n        -------\n        intersection : BlockIndex\n        ";
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("intersect (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_16intersect(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_16intersect(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other) {
  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("intersect", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_7_sparse_10BlockIndex_intersect(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":466
 *         return BlockIndex(self.length, out_blocs, out_blengths)
 * 
 *     cpdef BlockIndex make_union(self, SparseIndex y):             # <<<<<<<<<<<<<<
 *         """
 *         Combine together two BlockIndex objects, accepting indices if contained
 */

static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/
static struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_f_6pandas_7_sparse_10BlockIndex_make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y, int __pyx_skip_dispatch) {
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_union", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_union); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_y)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_y));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_y));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_y));
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":483
 *         union : BlockIndex
 *         """
 *         return BlockUnion(self, y.to_block_index()).result             # <<<<<<<<<<<<<<
 * 
 *     cpdef int lookup(self, Py_ssize_t index):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockUnion), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_7_sparse_BlockUnion *)__pyx_t_1)->__pyx_base.result));
  __pyx_r = ((struct __pyx_obj_6pandas_7_sparse_BlockUnion *)__pyx_t_1)->__pyx_base.result;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":466
 *         return BlockIndex(self.length, out_blocs, out_blengths)
 * 
 *     cpdef BlockIndex make_union(self, SparseIndex y):             # <<<<<<<<<<<<<<
 *         """
 *         Combine together two BlockIndex objects, accepting indices if contained
 */

  /* 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("pandas._sparse.BlockIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/
static char __pyx_doc_6pandas_7_sparse_10BlockIndex_18make_union[] = "\n        Combine together two BlockIndex objects, accepting indices if contained\n        in one or the other\n\n        Parameters\n        ----------\n        other : SparseIndex\n\n        Notes\n        -----\n        union is a protected keyword in Cython, hence make_union\n\n        Returns\n        -------\n        union : BlockIndex\n        ";
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union(PyObject *__pyx_v_self, PyObject *__pyx_v_y) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_union (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_18make_union(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_y));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_18make_union(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_y) {
  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("make_union", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_7_sparse_10BlockIndex_make_union(__pyx_v_self, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.make_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":485
 *         return BlockUnion(self, y.to_block_index()).result
 * 
 *     cpdef int lookup(self, Py_ssize_t index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the internal location if value exists on given index.
 */

static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static int __pyx_f_6pandas_7_sparse_10BlockIndex_lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_cum_len;
  PyArrayObject *__pyx_v_locs = 0;
  PyArrayObject *__pyx_v_lens = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lens;
  __Pyx_Buffer __pyx_pybuffer_lens;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_locs;
  __Pyx_Buffer __pyx_pybuffer_locs;
  int __pyx_r;
  __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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup", 0);
  __pyx_pybuffer_locs.pybuffer.buf = NULL;
  __pyx_pybuffer_locs.refcount = 0;
  __pyx_pybuffernd_locs.data = NULL;
  __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs;
  __pyx_pybuffer_lens.pybuffer.buf = NULL;
  __pyx_pybuffer_lens.refcount = 0;
  __pyx_pybuffernd_lens.data = NULL;
  __pyx_pybuffernd_lens.rcbuffer = &__pyx_pybuffer_lens;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup)) {
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":494
 *             ndarray[int32_t, ndim=1] locs, lens
 * 
 *         locs = self.blocs             # <<<<<<<<<<<<<<
 *         lens = self.blengths
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_v_locs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":495
 * 
 *         locs = self.blocs
 *         lens = self.blengths             # <<<<<<<<<<<<<<
 * 
 *         if self.nblocks == 0:
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blengths);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lens.rcbuffer->pybuffer, (PyObject*)__pyx_v_lens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_pybuffernd_lens.diminfo[0].strides = __pyx_pybuffernd_lens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lens.diminfo[0].shape = __pyx_pybuffernd_lens.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_lens = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":497
 *         lens = self.blengths
 * 
 *         if self.nblocks == 0:             # <<<<<<<<<<<<<<
 *             return -1
 *         elif index < locs[0]:
 */
  __pyx_t_11 = ((__pyx_v_self->nblocks == 0) != 0);
  if (__pyx_t_11) {

    /* "pandas/src/sparse.pyx":498
 * 
 *         if self.nblocks == 0:
 *             return -1             # <<<<<<<<<<<<<<
 *         elif index < locs[0]:
 *             return -1
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":497
 *         lens = self.blengths
 * 
 *         if self.nblocks == 0:             # <<<<<<<<<<<<<<
 *             return -1
 *         elif index < locs[0]:
 */
  }

  /* "pandas/src/sparse.pyx":499
 *         if self.nblocks == 0:
 *             return -1
 *         elif index < locs[0]:             # <<<<<<<<<<<<<<
 *             return -1
 * 
 */
  __pyx_t_12 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_pybuffernd_locs.diminfo[0].shape;
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = ((__pyx_v_index < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_locs.diminfo[0].strides))) != 0);
  if (__pyx_t_11) {

    /* "pandas/src/sparse.pyx":500
 *             return -1
 *         elif index < locs[0]:
 *             return -1             # <<<<<<<<<<<<<<
 * 
 *         cum_len = 0
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":499
 *         if self.nblocks == 0:
 *             return -1
 *         elif index < locs[0]:             # <<<<<<<<<<<<<<
 *             return -1
 * 
 */
  }

  /* "pandas/src/sparse.pyx":502
 *             return -1
 * 
 *         cum_len = 0             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < self.nblocks:
 *             if index >= locs[i] and index < locs[i] + lens[i]:
 */
  __pyx_v_cum_len = 0;

  /* "pandas/src/sparse.pyx":503
 * 
 *         cum_len = 0
 *         for i from 0 <= i < self.nblocks:             # <<<<<<<<<<<<<<
 *             if index >= locs[i] and index < locs[i] + lens[i]:
 *                 return cum_len + index - locs[i]
 */
  __pyx_t_13 = __pyx_v_self->nblocks;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) {

    /* "pandas/src/sparse.pyx":504
 *         cum_len = 0
 *         for i from 0 <= i < self.nblocks:
 *             if index >= locs[i] and index < locs[i] + lens[i]:             # <<<<<<<<<<<<<<
 *                 return cum_len + index - locs[i]
 *             cum_len += lens[i]
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_locs.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = ((__pyx_v_index >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_locs.diminfo[0].strides))) != 0);
    if (__pyx_t_15) {
    } else {
      __pyx_t_11 = __pyx_t_15;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_locs.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_pybuffernd_lens.diminfo[0].shape;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_lens.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_15 = ((__pyx_v_index < ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_locs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_lens.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_lens.diminfo[0].strides)))) != 0);
    __pyx_t_11 = __pyx_t_15;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_11) {

      /* "pandas/src/sparse.pyx":505
 *         for i from 0 <= i < self.nblocks:
 *             if index >= locs[i] and index < locs[i] + lens[i]:
 *                 return cum_len + index - locs[i]             # <<<<<<<<<<<<<<
 *             cum_len += lens[i]
 * 
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_locs.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_r = ((__pyx_v_cum_len + __pyx_v_index) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_locs.diminfo[0].strides)));
      goto __pyx_L0;

      /* "pandas/src/sparse.pyx":504
 *         cum_len = 0
 *         for i from 0 <= i < self.nblocks:
 *             if index >= locs[i] and index < locs[i] + lens[i]:             # <<<<<<<<<<<<<<
 *                 return cum_len + index - locs[i]
 *             cum_len += lens[i]
 */
    }

    /* "pandas/src/sparse.pyx":506
 *             if index >= locs[i] and index < locs[i] + lens[i]:
 *                 return cum_len + index - locs[i]
 *             cum_len += lens[i]             # <<<<<<<<<<<<<<
 * 
 *         return -1
 */
    __pyx_t_19 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_pybuffernd_lens.diminfo[0].shape;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_lens.diminfo[0].shape)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_cum_len = (__pyx_v_cum_len + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_lens.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_lens.diminfo[0].strides)));
  }

  /* "pandas/src/sparse.pyx":508
 *             cum_len += lens[i]
 * 
 *         return -1             # <<<<<<<<<<<<<<
 * 
 *     @cython.wraparound(False)
 */
  __pyx_r = -1;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":485
 *         return BlockUnion(self, y.to_block_index()).result
 * 
 *     cpdef int lookup(self, Py_ssize_t index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the internal location if value exists on given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_locs);
  __Pyx_XDECREF((PyObject *)__pyx_v_lens);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_6pandas_7_sparse_10BlockIndex_20lookup[] = "\n        Return the internal location if value exists on given index.\n        Return -1 otherwise.\n        ";
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
  Py_ssize_t __pyx_v_index;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lookup (wrapper)", 0);
  assert(__pyx_arg_index); {
    __pyx_v_index = __Pyx_PyIndex_AsSsize_t(__pyx_arg_index); if (unlikely((__pyx_v_index == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_20lookup(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((Py_ssize_t)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_20lookup(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, Py_ssize_t __pyx_v_index) {
  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("lookup", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_6pandas_7_sparse_10BlockIndex_lookup(__pyx_v_self, __pyx_v_index, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":511
 * 
 *     @cython.wraparound(False)
 *     cpdef ndarray[int32_t] lookup_array(self, ndarray[int32_t, ndim=1] indexer):             # <<<<<<<<<<<<<<
 *         """
 *         Vectorized lookup, returns ndarray[int32_t]
 */

static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23lookup_array(PyObject *__pyx_v_self, PyObject *__pyx_v_indexer); /*proto*/
static PyArrayObject *__pyx_f_6pandas_7_sparse_10BlockIndex_lookup_array(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_indexer, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_ind_val;
  PyArrayObject *__pyx_v_locs = 0;
  PyArrayObject *__pyx_v_lens = 0;
  PyArrayObject *__pyx_v_results = 0;
  PyObject *__pyx_v_cum_len = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_lens;
  __Pyx_Buffer __pyx_pybuffer_lens;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_locs;
  __Pyx_Buffer __pyx_pybuffer_locs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_results;
  __Pyx_Buffer __pyx_pybuffer_results;
  PyArrayObject *__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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  __pyx_t_5numpy_int32_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup_array", 0);
  __pyx_pybuffer_locs.pybuffer.buf = NULL;
  __pyx_pybuffer_locs.refcount = 0;
  __pyx_pybuffernd_locs.data = NULL;
  __pyx_pybuffernd_locs.rcbuffer = &__pyx_pybuffer_locs;
  __pyx_pybuffer_lens.pybuffer.buf = NULL;
  __pyx_pybuffer_lens.refcount = 0;
  __pyx_pybuffernd_lens.data = NULL;
  __pyx_pybuffernd_lens.rcbuffer = &__pyx_pybuffer_lens;
  __pyx_pybuffer_results.pybuffer.buf = NULL;
  __pyx_pybuffer_results.refcount = 0;
  __pyx_pybuffernd_results.data = NULL;
  __pyx_pybuffernd_results.rcbuffer = &__pyx_pybuffer_results;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lookup_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_23lookup_array)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_indexer)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_indexer));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_indexer));
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":520
 *             ndarray[int32_t, ndim=1] results
 * 
 *         locs = self.blocs             # <<<<<<<<<<<<<<
 *         lens = self.blengths
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_locs.rcbuffer->pybuffer, (PyObject*)__pyx_v_locs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_locs.diminfo[0].strides = __pyx_pybuffernd_locs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_locs.diminfo[0].shape = __pyx_pybuffernd_locs.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":521
 * 
 *         locs = self.blocs
 *         lens = self.blengths             # <<<<<<<<<<<<<<
 * 
 *         n = len(indexer)
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blengths);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lens.rcbuffer->pybuffer, (PyObject*)__pyx_v_lens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_pybuffernd_lens.diminfo[0].strides = __pyx_pybuffernd_lens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lens.diminfo[0].shape = __pyx_pybuffernd_lens.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_lens = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":523
 *         lens = self.blengths
 * 
 *         n = len(indexer)             # <<<<<<<<<<<<<<
 *         results = np.empty(n, dtype=np.int32)
 *         results.fill(-1)
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_10;

  /* "pandas/src/sparse.pyx":524
 * 
 *         n = len(indexer)
 *         results = np.empty(n, dtype=np.int32)             # <<<<<<<<<<<<<<
 *         results.fill(-1)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_results.rcbuffer->pybuffer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_results.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_results.rcbuffer->pybuffer, (PyObject*)__pyx_v_results, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_results.diminfo[0].strides = __pyx_pybuffernd_results.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_results.diminfo[0].shape = __pyx_pybuffernd_results.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_results = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pandas/src/sparse.pyx":525
 *         n = len(indexer)
 *         results = np.empty(n, dtype=np.int32)
 *         results.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *         if self.npoints == 0:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_results), __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":527
 *         results.fill(-1)
 * 
 *         if self.npoints == 0:             # <<<<<<<<<<<<<<
 *             return results
 * 
 */
  __pyx_t_12 = ((__pyx_v_self->npoints == 0) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/sparse.pyx":528
 * 
 *         if self.npoints == 0:
 *             return results             # <<<<<<<<<<<<<<
 * 
 *         for i from 0 <= i < n:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_results));
    __pyx_r = ((PyArrayObject *)__pyx_v_results);
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":527
 *         results.fill(-1)
 * 
 *         if self.npoints == 0:             # <<<<<<<<<<<<<<
 *             return results
 * 
 */
  }

  /* "pandas/src/sparse.pyx":530
 *             return results
 * 
 *         for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *             ind_val = indexer[i]
 *             if not (ind_val < 0 or self.length <= ind_val):
 */
  __pyx_t_10 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "pandas/src/sparse.pyx":531
 * 
 *         for i from 0 <= i < n:
 *             ind_val = indexer[i]             # <<<<<<<<<<<<<<
 *             if not (ind_val < 0 or self.length <= ind_val):
 *                 cum_len = 0
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_ind_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_indexer.diminfo[0].strides));

    /* "pandas/src/sparse.pyx":532
 *         for i from 0 <= i < n:
 *             ind_val = indexer[i]
 *             if not (ind_val < 0 or self.length <= ind_val):             # <<<<<<<<<<<<<<
 *                 cum_len = 0
 *                 for j from 0 <= j < self.nblocks:
 */
    __pyx_t_14 = ((__pyx_v_ind_val < 0) != 0);
    if (!__pyx_t_14) {
    } else {
      __pyx_t_12 = __pyx_t_14;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_14 = ((__pyx_v_self->length <= __pyx_v_ind_val) != 0);
    __pyx_t_12 = __pyx_t_14;
    __pyx_L7_bool_binop_done:;
    __pyx_t_14 = ((!__pyx_t_12) != 0);
    if (__pyx_t_14) {

      /* "pandas/src/sparse.pyx":533
 *             ind_val = indexer[i]
 *             if not (ind_val < 0 or self.length <= ind_val):
 *                 cum_len = 0             # <<<<<<<<<<<<<<
 *                 for j from 0 <= j < self.nblocks:
 *                     if ind_val >= locs[j] and ind_val < locs[j] + lens[j]:
 */
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_XDECREF_SET(__pyx_v_cum_len, __pyx_int_0);

      /* "pandas/src/sparse.pyx":534
 *             if not (ind_val < 0 or self.length <= ind_val):
 *                 cum_len = 0
 *                 for j from 0 <= j < self.nblocks:             # <<<<<<<<<<<<<<
 *                     if ind_val >= locs[j] and ind_val < locs[j] + lens[j]:
 *                         results[i] = cum_len + ind_val - locs[j]
 */
      __pyx_t_15 = __pyx_v_self->nblocks;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_15; __pyx_v_j++) {

        /* "pandas/src/sparse.pyx":535
 *                 cum_len = 0
 *                 for j from 0 <= j < self.nblocks:
 *                     if ind_val >= locs[j] and ind_val < locs[j] + lens[j]:             # <<<<<<<<<<<<<<
 *                         results[i] = cum_len + ind_val - locs[j]
 *                     cum_len += lens[j]
 */
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_12 = ((__pyx_v_ind_val >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_locs.diminfo[0].strides))) != 0);
        if (__pyx_t_12) {
        } else {
          __pyx_t_14 = __pyx_t_12;
          goto __pyx_L12_bool_binop_done;
        }
        __pyx_t_17 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_18 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_lens.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_12 = ((__pyx_v_ind_val < ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_locs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_lens.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_lens.diminfo[0].strides)))) != 0);
        __pyx_t_14 = __pyx_t_12;
        __pyx_L12_bool_binop_done:;
        if (__pyx_t_14) {

          /* "pandas/src/sparse.pyx":536
 *                 for j from 0 <= j < self.nblocks:
 *                     if ind_val >= locs[j] and ind_val < locs[j] + lens[j]:
 *                         results[i] = cum_len + ind_val - locs[j]             # <<<<<<<<<<<<<<
 *                     cum_len += lens[j]
 *         return results
 */
          __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ind_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyNumber_Add(__pyx_v_cum_len, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_19 = __pyx_v_j;
          __pyx_t_6 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_locs.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_locs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_locs.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_20 = __Pyx_PyInt_As_npy_int32(__pyx_t_3); if (unlikely((__pyx_t_20 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_6 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_6 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_results.diminfo[0].shape)) __pyx_t_6 = 0;
          if (unlikely(__pyx_t_6 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_6);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_results.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_results.diminfo[0].strides) = __pyx_t_20;

          /* "pandas/src/sparse.pyx":535
 *                 cum_len = 0
 *                 for j from 0 <= j < self.nblocks:
 *                     if ind_val >= locs[j] and ind_val < locs[j] + lens[j]:             # <<<<<<<<<<<<<<
 *                         results[i] = cum_len + ind_val - locs[j]
 *                     cum_len += lens[j]
 */
        }

        /* "pandas/src/sparse.pyx":537
 *                     if ind_val >= locs[j] and ind_val < locs[j] + lens[j]:
 *                         results[i] = cum_len + ind_val - locs[j]
 *                     cum_len += lens[j]             # <<<<<<<<<<<<<<
 *         return results
 * 
 */
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_6 = -1;
        if (__pyx_t_22 < 0) {
          __pyx_t_6 = 0;
        } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_lens.diminfo[0].shape)) __pyx_t_6 = 0;
        if (unlikely(__pyx_t_6 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_6);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_3 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_lens.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_lens.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_cum_len, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_cum_len, __pyx_t_1);
        __pyx_t_1 = 0;
      }

      /* "pandas/src/sparse.pyx":532
 *         for i from 0 <= i < n:
 *             ind_val = indexer[i]
 *             if not (ind_val < 0 or self.length <= ind_val):             # <<<<<<<<<<<<<<
 *                 cum_len = 0
 *                 for j from 0 <= j < self.nblocks:
 */
    }
  }

  /* "pandas/src/sparse.pyx":538
 *                         results[i] = cum_len + ind_val - locs[j]
 *                     cum_len += lens[j]
 *         return results             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values,
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_results));
  __pyx_r = ((PyArrayObject *)__pyx_v_results);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":511
 * 
 *     @cython.wraparound(False)
 *     cpdef ndarray[int32_t] lookup_array(self, ndarray[int32_t, ndim=1] indexer):             # <<<<<<<<<<<<<<
 *         """
 *         Vectorized lookup, returns ndarray[int32_t]
 */

  /* 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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_results.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lens.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_locs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_results.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_locs);
  __Pyx_XDECREF((PyObject *)__pyx_v_lens);
  __Pyx_XDECREF((PyObject *)__pyx_v_results);
  __Pyx_XDECREF(__pyx_v_cum_len);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23lookup_array(PyObject *__pyx_v_self, PyObject *__pyx_v_indexer); /*proto*/
static char __pyx_doc_6pandas_7_sparse_10BlockIndex_22lookup_array[] = "\n        Vectorized lookup, returns ndarray[int32_t]\n        ";
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23lookup_array(PyObject *__pyx_v_self, PyObject *__pyx_v_indexer) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lookup_array (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_22lookup_array(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), ((PyArrayObject *)__pyx_v_indexer));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_22lookup_array(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_indexer) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  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("lookup_array", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_7_sparse_10BlockIndex_lookup_array(__pyx_v_self, __pyx_v_indexer, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.lookup_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":540
 *         return results
 * 
 *     cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                           float64_t fill_value, SparseIndex other_):
 *         cdef:
 */

static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_6pandas_7_sparse_10BlockIndex_reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_ocur;
  CYTHON_UNUSED Py_ssize_t __pyx_v_ocurlen;
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_other = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_slocs = 0;
  PyArrayObject *__pyx_v_slens = 0;
  PyArrayObject *__pyx_v_olocs = 0;
  PyArrayObject *__pyx_v_olens = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_olens;
  __Pyx_Buffer __pyx_pybuffer_olens;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_olocs;
  __Pyx_Buffer __pyx_pybuffer_olocs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_slens;
  __Pyx_Buffer __pyx_pybuffer_slens;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_slocs;
  __Pyx_Buffer __pyx_pybuffer_slocs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyArrayObject *__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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reindex", 0);
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  __pyx_pybuffer_slocs.pybuffer.buf = NULL;
  __pyx_pybuffer_slocs.refcount = 0;
  __pyx_pybuffernd_slocs.data = NULL;
  __pyx_pybuffernd_slocs.rcbuffer = &__pyx_pybuffer_slocs;
  __pyx_pybuffer_slens.pybuffer.buf = NULL;
  __pyx_pybuffer_slens.refcount = 0;
  __pyx_pybuffernd_slens.data = NULL;
  __pyx_pybuffernd_slens.rcbuffer = &__pyx_pybuffer_slens;
  __pyx_pybuffer_olocs.pybuffer.buf = NULL;
  __pyx_pybuffer_olocs.refcount = 0;
  __pyx_pybuffernd_olocs.data = NULL;
  __pyx_pybuffernd_olocs.rcbuffer = &__pyx_pybuffer_olocs;
  __pyx_pybuffer_olens.pybuffer.buf = NULL;
  __pyx_pybuffer_olens.refcount = 0;
  __pyx_pybuffernd_olens.data = NULL;
  __pyx_pybuffernd_olens.rcbuffer = &__pyx_pybuffer_olens;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_25reindex)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_fill_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_other_));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_other_));
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_other_));
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":543
 *                           float64_t fill_value, SparseIndex other_):
 *         cdef:
 *             Py_ssize_t i = 0, j = 0, ocur, ocurlen             # <<<<<<<<<<<<<<
 *             BlockIndex other
 *             ndarray[float64_t, ndim=1] result
 */
  __pyx_v_i = 0;
  __pyx_v_j = 0;

  /* "pandas/src/sparse.pyx":548
 *             ndarray[int32_t, ndim=1] slocs, slens, olocs, olens
 * 
 *         other = other_.to_block_index()             # <<<<<<<<<<<<<<
 * 
 *         olocs = other.blocs
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other_), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_other = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":550
 *         other = other_.to_block_index()
 * 
 *         olocs = other.blocs             # <<<<<<<<<<<<<<
 *         olens = other.blengths
 *         slocs = self.blocs
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_other->blocs);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer, (PyObject*)__pyx_v_olocs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_olocs.diminfo[0].strides = __pyx_pybuffernd_olocs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_olocs.diminfo[0].shape = __pyx_pybuffernd_olocs.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_olocs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":551
 * 
 *         olocs = other.blocs
 *         olens = other.blengths             # <<<<<<<<<<<<<<
 *         slocs = self.blocs
 *         slens = self.blengths
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_other->blengths);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olens.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_olens.rcbuffer->pybuffer, (PyObject*)__pyx_v_olens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_olens.diminfo[0].strides = __pyx_pybuffernd_olens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_olens.diminfo[0].shape = __pyx_pybuffernd_olens.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_olens = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":552
 *         olocs = other.blocs
 *         olens = other.blengths
 *         slocs = self.blocs             # <<<<<<<<<<<<<<
 *         slens = self.blengths
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blocs);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer, (PyObject*)__pyx_v_slocs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_slocs.diminfo[0].strides = __pyx_pybuffernd_slocs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_slocs.diminfo[0].shape = __pyx_pybuffernd_slocs.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_slocs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":553
 *         olens = other.blengths
 *         slocs = self.blocs
 *         slens = self.blengths             # <<<<<<<<<<<<<<
 * 
 *         result = np.empty(other.npoints, dtype=np.float64)
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->blengths);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slens.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slens.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slens.rcbuffer->pybuffer, (PyObject*)__pyx_v_slens, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_pybuffernd_slens.diminfo[0].strides = __pyx_pybuffernd_slens.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_slens.diminfo[0].shape = __pyx_pybuffernd_slens.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_slens = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":555
 *         slens = self.blengths
 * 
 *         result = np.empty(other.npoints, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *         for 0 <= i < other.nblocks:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_other->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pandas/src/sparse.pyx":557
 *         result = np.empty(other.npoints, dtype=np.float64)
 * 
 *         for 0 <= i < other.nblocks:             # <<<<<<<<<<<<<<
 *             ocur = olocs[i]
 *             ocurlen = olens[i]
 */
  __pyx_t_6 = __pyx_v_other->nblocks;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "pandas/src/sparse.pyx":558
 * 
 *         for 0 <= i < other.nblocks:
 *             ocur = olocs[i]             # <<<<<<<<<<<<<<
 *             ocurlen = olens[i]
 * 
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_olocs.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_olocs.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_ocur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_olocs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_olocs.diminfo[0].strides));

    /* "pandas/src/sparse.pyx":559
 *         for 0 <= i < other.nblocks:
 *             ocur = olocs[i]
 *             ocurlen = olens[i]             # <<<<<<<<<<<<<<
 * 
 *             while slocs[j] + slens[j] < ocur:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_olens.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_olens.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_ocurlen = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_olens.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_olens.diminfo[0].strides));

    /* "pandas/src/sparse.pyx":561
 *             ocurlen = olens[i]
 * 
 *             while slocs[j] + slens[j] < ocur:             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
    while (1) {
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_8 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_slocs.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_slocs.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = __pyx_v_j;
      __pyx_t_8 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_pybuffernd_slens.diminfo[0].shape;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_slens.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_slocs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_slocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_slens.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_slens.diminfo[0].strides))) < __pyx_v_ocur) != 0);
      if (!__pyx_t_17) break;

      /* "pandas/src/sparse.pyx":562
 * 
 *             while slocs[j] + slens[j] < ocur:
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *     cpdef put(self, ndarray[float64_t, ndim=1] values,
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }
  }

  /* "pandas/src/sparse.pyx":540
 *         return results
 * 
 *     cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                           float64_t fill_value, SparseIndex other_):
 *         cdef:
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olens.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slens.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olens.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_olocs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slens.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slocs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_other);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_slocs);
  __Pyx_XDECREF((PyObject *)__pyx_v_slens);
  __Pyx_XDECREF((PyObject *)__pyx_v_olocs);
  __Pyx_XDECREF((PyObject *)__pyx_v_olens);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fill_value;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_ = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reindex (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_fill_value,&__pyx_n_s_other,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reindex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_fill_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fill_value == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_other_ = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reindex", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other_), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "other_", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_24reindex(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_24reindex(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, __pyx_t_5numpy_float64_t __pyx_v_fill_value, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_other_) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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("reindex", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_7_sparse_10BlockIndex_reindex(__pyx_v_self, __pyx_v_values, __pyx_v_fill_value, __pyx_v_other_, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.reindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":564
 *                 j += 1
 * 
 *     cpdef put(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *               ndarray[int32_t, ndim=1] indices, object to_put):
 *         pass
 */

static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_put(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_to_put, int __pyx_skip_dispatch) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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("put", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_27put)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_indices));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_indices));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_indices));
      __Pyx_INCREF(__pyx_v_to_put);
      __Pyx_GIVEREF(__pyx_v_to_put);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_to_put);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":566
 *     cpdef put(self, ndarray[float64_t, ndim=1] values,
 *               ndarray[int32_t, ndim=1] indices, object to_put):
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef take(self, ndarray[float64_t, ndim=1] values,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":564
 *                 j += 1
 * 
 *     cpdef put(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *               ndarray[int32_t, ndim=1] indices, object to_put):
 *         pass
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_to_put = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,&__pyx_n_s_to_put,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_put)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_indices = ((PyArrayObject *)values[1]);
    __pyx_v_to_put = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_26put(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices, __pyx_v_to_put);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_26put(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyObject *__pyx_v_to_put) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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("put", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_10BlockIndex_put(__pyx_v_self, __pyx_v_values, __pyx_v_indices, __pyx_v_to_put, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":568
 *         pass
 * 
 *     cpdef take(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                ndarray[int32_t, ndim=1] indices):
 *         pass
 */

static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_29take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_10BlockIndex_take(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED PyArrayObject *__pyx_v_indices, int __pyx_skip_dispatch) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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;
  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("take", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_29take)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_indices));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_indices));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_indices));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/sparse.pyx":570
 *     cpdef take(self, ndarray[float64_t, ndim=1] values,
 *                ndarray[int32_t, ndim=1] indices):
 *         pass             # <<<<<<<<<<<<<<
 * 
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":568
 *         pass
 * 
 *     cpdef take(self, ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                ndarray[int32_t, ndim=1] indices):
 *         pass
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_29take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_29take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_indices = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_indices,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_indices = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_28take(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self), __pyx_v_values, __pyx_v_indices);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_28take(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indices;
  __Pyx_Buffer __pyx_pybuffer_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  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("take", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_indices.refcount = 0;
  __pyx_pybuffernd_indices.data = NULL;
  __pyx_pybuffernd_indices.rcbuffer = &__pyx_pybuffer_indices;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_10BlockIndex_take(__pyx_v_self, __pyx_v_values, __pyx_v_indices, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":282
 *     """
 *     cdef readonly:
 *         Py_ssize_t nblocks, npoints, length             # <<<<<<<<<<<<<<
 *         ndarray blocs, blengths
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7nblocks_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7nblocks_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_7nblocks___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7nblocks___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->nblocks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.nblocks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7npoints_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_7npoints_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_7npoints___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_7npoints___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.npoints.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_6length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_6length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_6length___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_6length___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.BlockIndex.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":283
 *     cdef readonly:
 *         Py_ssize_t nblocks, npoints, length
 *         ndarray blocs, blengths             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5blocs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_5blocs_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_5blocs___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_5blocs___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs));
  __pyx_r = ((PyObject *)__pyx_v_self->blocs);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_8blengths_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_8blengths_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_8blengths___get__(((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10BlockIndex_8blengths___get__(struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths));
  __pyx_r = ((PyObject *)__pyx_v_self->blengths);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":583
 *         int32_t xi, yi # block indices
 * 
 *     def __init__(self, BlockIndex x, BlockIndex y):             # <<<<<<<<<<<<<<
 *         self.x = x
 *         self.y = y
 */

/* Python wrapper */
static int __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)values[0]);
    __pyx_v_y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.BlockMerge.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_6pandas_7_sparse_BlockIndex, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_6pandas_7_sparse_BlockIndex, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockMerge___init__(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_7_sparse_10BlockMerge___init__(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_y) {
  int __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("__init__", 0);

  /* "pandas/src/sparse.pyx":584
 * 
 *     def __init__(self, BlockIndex x, BlockIndex y):
 *         self.x = x             # <<<<<<<<<<<<<<
 *         self.y = y
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_x));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_x));
  __Pyx_GOTREF(__pyx_v_self->x);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->x));
  __pyx_v_self->x = __pyx_v_x;

  /* "pandas/src/sparse.pyx":585
 *     def __init__(self, BlockIndex x, BlockIndex y):
 *         self.x = x
 *         self.y = y             # <<<<<<<<<<<<<<
 * 
 *         if x.length != y.length:
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_y));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_y));
  __Pyx_GOTREF(__pyx_v_self->y);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->y));
  __pyx_v_self->y = __pyx_v_y;

  /* "pandas/src/sparse.pyx":587
 *         self.y = y
 * 
 *         if x.length != y.length:             # <<<<<<<<<<<<<<
 *             raise Exception('Indices must reference same underlying length')
 * 
 */
  __pyx_t_1 = ((__pyx_v_x->length != __pyx_v_y->length) != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":588
 * 
 *         if x.length != y.length:
 *             raise Exception('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         self.xstart = self.x.blocs
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":587
 *         self.y = y
 * 
 *         if x.length != y.length:             # <<<<<<<<<<<<<<
 *             raise Exception('Indices must reference same underlying length')
 * 
 */
  }

  /* "pandas/src/sparse.pyx":590
 *             raise Exception('Indices must reference same underlying length')
 * 
 *         self.xstart = self.x.blocs             # <<<<<<<<<<<<<<
 *         self.ystart = self.y.blocs
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->x->blocs);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->xstart);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->xstart));
  __pyx_v_self->xstart = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":591
 * 
 *         self.xstart = self.x.blocs
 *         self.ystart = self.y.blocs             # <<<<<<<<<<<<<<
 * 
 *         self.xend = self.x.blocs + self.x.blengths
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->y->blocs);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->ystart);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->ystart));
  __pyx_v_self->ystart = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":593
 *         self.ystart = self.y.blocs
 * 
 *         self.xend = self.x.blocs + self.x.blengths             # <<<<<<<<<<<<<<
 *         self.yend = self.y.blocs + self.y.blengths
 * 
 */
  __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_self->x->blocs), ((PyObject *)__pyx_v_self->x->blengths)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->xend);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->xend));
  __pyx_v_self->xend = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":594
 * 
 *         self.xend = self.x.blocs + self.x.blengths
 *         self.yend = self.y.blocs + self.y.blengths             # <<<<<<<<<<<<<<
 * 
 *         # self.xlen = self.x.blengths
 */
  __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_self->y->blocs), ((PyObject *)__pyx_v_self->y->blengths)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->yend);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->yend));
  __pyx_v_self->yend = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":599
 *         # self.ylen = self.y.blengths
 * 
 *         self.xi = 0             # <<<<<<<<<<<<<<
 *         self.yi = 0
 * 
 */
  __pyx_v_self->xi = 0;

  /* "pandas/src/sparse.pyx":600
 * 
 *         self.xi = 0
 *         self.yi = 0             # <<<<<<<<<<<<<<
 * 
 *         self.result = self._make_merged_blocks()
 */
  __pyx_v_self->yi = 0;

  /* "pandas/src/sparse.pyx":602
 *         self.yi = 0
 * 
 *         self.result = self._make_merged_blocks()             # <<<<<<<<<<<<<<
 * 
 *     cdef _make_merged_blocks(self):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge *)__pyx_v_self->__pyx_vtab)->_make_merged_blocks(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->result);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->result));
  __pyx_v_self->result = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":583
 *         int32_t xi, yi # block indices
 * 
 *     def __init__(self, BlockIndex x, BlockIndex y):             # <<<<<<<<<<<<<<
 *         self.x = x
 *         self.y = y
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas._sparse.BlockMerge.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":604
 *         self.result = self._make_merged_blocks()
 * 
 *     cdef _make_merged_blocks(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

static PyObject *__pyx_f_6pandas_7_sparse_10BlockMerge__make_merged_blocks(CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_make_merged_blocks", 0);

  /* "pandas/src/sparse.pyx":605
 * 
 *     cdef _make_merged_blocks(self):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/sparse.pyx":604
 *         self.result = self._make_merged_blocks()
 * 
 *     cdef _make_merged_blocks(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas._sparse.BlockMerge._make_merged_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":607
 *         raise NotImplementedError
 * 
 *     cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode):             # <<<<<<<<<<<<<<
 *         if mode == 0:
 *             self.xi = xi
 */

static PyObject *__pyx_f_6pandas_7_sparse_10BlockMerge__set_current_indices(struct __pyx_obj_6pandas_7_sparse_BlockMerge *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_xi, __pyx_t_5numpy_int32_t __pyx_v_yi, int __pyx_v_mode) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_set_current_indices", 0);

  /* "pandas/src/sparse.pyx":608
 * 
 *     cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode):
 *         if mode == 0:             # <<<<<<<<<<<<<<
 *             self.xi = xi
 *             self.yi = yi
 */
  __pyx_t_1 = ((__pyx_v_mode == 0) != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":609
 *     cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode):
 *         if mode == 0:
 *             self.xi = xi             # <<<<<<<<<<<<<<
 *             self.yi = yi
 *         else:
 */
    __pyx_v_self->xi = __pyx_v_xi;

    /* "pandas/src/sparse.pyx":610
 *         if mode == 0:
 *             self.xi = xi
 *             self.yi = yi             # <<<<<<<<<<<<<<
 *         else:
 *             self.xi = yi
 */
    __pyx_v_self->yi = __pyx_v_yi;

    /* "pandas/src/sparse.pyx":608
 * 
 *     cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode):
 *         if mode == 0:             # <<<<<<<<<<<<<<
 *             self.xi = xi
 *             self.yi = yi
 */
    goto __pyx_L3;
  }

  /* "pandas/src/sparse.pyx":612
 *             self.yi = yi
 *         else:
 *             self.xi = yi             # <<<<<<<<<<<<<<
 *             self.yi = xi
 * 
 */
  /*else*/ {
    __pyx_v_self->xi = __pyx_v_yi;

    /* "pandas/src/sparse.pyx":613
 *         else:
 *             self.xi = yi
 *             self.yi = xi             # <<<<<<<<<<<<<<
 * 
 * cdef class BlockIntersection(BlockMerge):
 */
    __pyx_v_self->yi = __pyx_v_xi;
  }
  __pyx_L3:;

  /* "pandas/src/sparse.pyx":607
 *         raise NotImplementedError
 * 
 *     cdef _set_current_indices(self, int32_t xi, int32_t yi, bint mode):             # <<<<<<<<<<<<<<
 *         if mode == 0:
 *             self.xi = xi
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":627
 *     """
 * 
 *     cdef _make_merged_blocks(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray[int32_t, ndim=1] xstart, xend, ystart, yend
 */

static PyObject *__pyx_f_6pandas_7_sparse_10BlockUnion__make_merged_blocks(struct __pyx_obj_6pandas_7_sparse_BlockUnion *__pyx_v_self) {
  PyArrayObject *__pyx_v_xstart = 0;
  PyArrayObject *__pyx_v_xend = 0;
  PyArrayObject *__pyx_v_ystart = 0;
  PyArrayObject *__pyx_v_yend = 0;
  __pyx_t_5numpy_int32_t __pyx_v_nstart;
  __pyx_t_5numpy_int32_t __pyx_v_nend;
  PyObject *__pyx_v_out_blocs = 0;
  PyObject *__pyx_v_out_blengths = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xend;
  __Pyx_Buffer __pyx_pybuffer_xend;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xstart;
  __Pyx_Buffer __pyx_pybuffer_xstart;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_yend;
  __Pyx_Buffer __pyx_pybuffer_yend;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ystart;
  __Pyx_Buffer __pyx_pybuffer_ystart;
  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;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  __pyx_t_5numpy_int32_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_make_merged_blocks", 0);
  __pyx_pybuffer_xstart.pybuffer.buf = NULL;
  __pyx_pybuffer_xstart.refcount = 0;
  __pyx_pybuffernd_xstart.data = NULL;
  __pyx_pybuffernd_xstart.rcbuffer = &__pyx_pybuffer_xstart;
  __pyx_pybuffer_xend.pybuffer.buf = NULL;
  __pyx_pybuffer_xend.refcount = 0;
  __pyx_pybuffernd_xend.data = NULL;
  __pyx_pybuffernd_xend.rcbuffer = &__pyx_pybuffer_xend;
  __pyx_pybuffer_ystart.pybuffer.buf = NULL;
  __pyx_pybuffer_ystart.refcount = 0;
  __pyx_pybuffernd_ystart.data = NULL;
  __pyx_pybuffernd_ystart.rcbuffer = &__pyx_pybuffer_ystart;
  __pyx_pybuffer_yend.pybuffer.buf = NULL;
  __pyx_pybuffer_yend.refcount = 0;
  __pyx_pybuffernd_yend.data = NULL;
  __pyx_pybuffernd_yend.rcbuffer = &__pyx_pybuffer_yend;

  /* "pandas/src/sparse.pyx":631
 *             ndarray[int32_t, ndim=1] xstart, xend, ystart, yend
 *             int32_t nstart, nend, diff
 *             list out_blocs = [], out_blengths = []             # <<<<<<<<<<<<<<
 * 
 *         xstart = self.xstart
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out_blocs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out_blengths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":633
 *             list out_blocs = [], out_blengths = []
 * 
 *         xstart = self.xstart             # <<<<<<<<<<<<<<
 *         xend = self.xend
 *         ystart = self.ystart
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.xstart);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer);
    __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_2 < 0)) {
      PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)__pyx_v_xstart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      }
    }
    __pyx_pybuffernd_xstart.diminfo[0].strides = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xstart.diminfo[0].shape = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xstart = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":634
 * 
 *         xstart = self.xstart
 *         xend = self.xend             # <<<<<<<<<<<<<<
 *         ystart = self.ystart
 *         yend = self.yend
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.xend);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer);
    __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_2 < 0)) {
      PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)__pyx_v_xend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      }
    }
    __pyx_pybuffernd_xend.diminfo[0].strides = __pyx_pybuffernd_xend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xend.diminfo[0].shape = __pyx_pybuffernd_xend.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xend = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":635
 *         xstart = self.xstart
 *         xend = self.xend
 *         ystart = self.ystart             # <<<<<<<<<<<<<<
 *         yend = self.yend
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.ystart);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer);
    __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_2 < 0)) {
      PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)__pyx_v_ystart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      }
    }
    __pyx_pybuffernd_ystart.diminfo[0].strides = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ystart.diminfo[0].shape = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_ystart = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":636
 *         xend = self.xend
 *         ystart = self.ystart
 *         yend = self.yend             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.yend);
  __Pyx_INCREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer);
    __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_2 < 0)) {
      PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)__pyx_v_yend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      }
    }
    __pyx_pybuffernd_yend.diminfo[0].strides = __pyx_pybuffernd_yend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yend.diminfo[0].shape = __pyx_pybuffernd_yend.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yend = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":638
 *         yend = self.yend
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             # we are done (or possibly never began)
 *             if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks:
 */
  while (1) {

    /* "pandas/src/sparse.pyx":640
 *         while True:
 *             # we are done (or possibly never began)
 *             if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks:             # <<<<<<<<<<<<<<
 *                 break
 *             elif self.yi >= self.y.nblocks:
 */
    __pyx_t_7 = ((__pyx_v_self->__pyx_base.xi >= __pyx_v_self->__pyx_base.x->nblocks) != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_v_self->__pyx_base.yi >= __pyx_v_self->__pyx_base.y->nblocks) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":641
 *             # we are done (or possibly never began)
 *             if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks:
 *                 break             # <<<<<<<<<<<<<<
 *             elif self.yi >= self.y.nblocks:
 *                 # through with y, just pass through x blocks
 */
      goto __pyx_L4_break;

      /* "pandas/src/sparse.pyx":640
 *         while True:
 *             # we are done (or possibly never began)
 *             if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks:             # <<<<<<<<<<<<<<
 *                 break
 *             elif self.yi >= self.y.nblocks:
 */
    }

    /* "pandas/src/sparse.pyx":642
 *             if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks:
 *                 break
 *             elif self.yi >= self.y.nblocks:             # <<<<<<<<<<<<<<
 *                 # through with y, just pass through x blocks
 *                 nstart = xstart[self.xi]
 */
    __pyx_t_6 = ((__pyx_v_self->__pyx_base.yi >= __pyx_v_self->__pyx_base.y->nblocks) != 0);
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":644
 *             elif self.yi >= self.y.nblocks:
 *                 # through with y, just pass through x blocks
 *                 nstart = xstart[self.xi]             # <<<<<<<<<<<<<<
 *                 nend = xend[self.xi]
 *                 self.xi += 1
 */
      __pyx_t_8 = __pyx_v_self->__pyx_base.xi;
      __pyx_t_2 = -1;
      if (__pyx_t_8 < 0) {
        __pyx_t_8 += __pyx_pybuffernd_xstart.diminfo[0].shape;
        if (unlikely(__pyx_t_8 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_xstart.diminfo[0].shape)) __pyx_t_2 = 0;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xstart.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_xstart.diminfo[0].strides));

      /* "pandas/src/sparse.pyx":645
 *                 # through with y, just pass through x blocks
 *                 nstart = xstart[self.xi]
 *                 nend = xend[self.xi]             # <<<<<<<<<<<<<<
 *                 self.xi += 1
 *             elif self.xi >= self.x.nblocks:
 */
      __pyx_t_9 = __pyx_v_self->__pyx_base.xi;
      __pyx_t_2 = -1;
      if (__pyx_t_9 < 0) {
        __pyx_t_9 += __pyx_pybuffernd_xend.diminfo[0].shape;
        if (unlikely(__pyx_t_9 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_xend.diminfo[0].shape)) __pyx_t_2 = 0;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_nend = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xend.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_xend.diminfo[0].strides));

      /* "pandas/src/sparse.pyx":646
 *                 nstart = xstart[self.xi]
 *                 nend = xend[self.xi]
 *                 self.xi += 1             # <<<<<<<<<<<<<<
 *             elif self.xi >= self.x.nblocks:
 *                 # through with x, just pass through y blocks
 */
      __pyx_v_self->__pyx_base.xi = (__pyx_v_self->__pyx_base.xi + 1);

      /* "pandas/src/sparse.pyx":642
 *             if self.xi >= self.x.nblocks and self.yi >= self.y.nblocks:
 *                 break
 *             elif self.yi >= self.y.nblocks:             # <<<<<<<<<<<<<<
 *                 # through with y, just pass through x blocks
 *                 nstart = xstart[self.xi]
 */
      goto __pyx_L5;
    }

    /* "pandas/src/sparse.pyx":647
 *                 nend = xend[self.xi]
 *                 self.xi += 1
 *             elif self.xi >= self.x.nblocks:             # <<<<<<<<<<<<<<
 *                 # through with x, just pass through y blocks
 *                 nstart = ystart[self.yi]
 */
    __pyx_t_6 = ((__pyx_v_self->__pyx_base.xi >= __pyx_v_self->__pyx_base.x->nblocks) != 0);
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":649
 *             elif self.xi >= self.x.nblocks:
 *                 # through with x, just pass through y blocks
 *                 nstart = ystart[self.yi]             # <<<<<<<<<<<<<<
 *                 nend = yend[self.yi]
 *                 self.yi += 1
 */
      __pyx_t_10 = __pyx_v_self->__pyx_base.yi;
      __pyx_t_2 = -1;
      if (__pyx_t_10 < 0) {
        __pyx_t_10 += __pyx_pybuffernd_ystart.diminfo[0].shape;
        if (unlikely(__pyx_t_10 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_2 = 0;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_ystart.diminfo[0].strides));

      /* "pandas/src/sparse.pyx":650
 *                 # through with x, just pass through y blocks
 *                 nstart = ystart[self.yi]
 *                 nend = yend[self.yi]             # <<<<<<<<<<<<<<
 *                 self.yi += 1
 *             else:
 */
      __pyx_t_11 = __pyx_v_self->__pyx_base.yi;
      __pyx_t_2 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_pybuffernd_yend.diminfo[0].shape;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_yend.diminfo[0].shape)) __pyx_t_2 = 0;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_nend = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yend.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_yend.diminfo[0].strides));

      /* "pandas/src/sparse.pyx":651
 *                 nstart = ystart[self.yi]
 *                 nend = yend[self.yi]
 *                 self.yi += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 # find end of new block
 */
      __pyx_v_self->__pyx_base.yi = (__pyx_v_self->__pyx_base.yi + 1);

      /* "pandas/src/sparse.pyx":647
 *                 nend = xend[self.xi]
 *                 self.xi += 1
 *             elif self.xi >= self.x.nblocks:             # <<<<<<<<<<<<<<
 *                 # through with x, just pass through y blocks
 *                 nstart = ystart[self.yi]
 */
      goto __pyx_L5;
    }

    /* "pandas/src/sparse.pyx":654
 *             else:
 *                 # find end of new block
 *                 if xstart[self.xi] < ystart[self.yi]:             # <<<<<<<<<<<<<<
 *                     nstart = xstart[self.xi]
 *                     nend = self._find_next_block_end(0)
 */
    /*else*/ {
      __pyx_t_12 = __pyx_v_self->__pyx_base.xi;
      __pyx_t_2 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_xstart.diminfo[0].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_xstart.diminfo[0].shape)) __pyx_t_2 = 0;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = __pyx_v_self->__pyx_base.yi;
      __pyx_t_2 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_pybuffernd_ystart.diminfo[0].shape;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_2 = 0;
      if (unlikely(__pyx_t_2 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_2);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xstart.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_xstart.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0);
      if (__pyx_t_6) {

        /* "pandas/src/sparse.pyx":655
 *                 # find end of new block
 *                 if xstart[self.xi] < ystart[self.yi]:
 *                     nstart = xstart[self.xi]             # <<<<<<<<<<<<<<
 *                     nend = self._find_next_block_end(0)
 *                 else:
 */
        __pyx_t_14 = __pyx_v_self->__pyx_base.xi;
        __pyx_t_2 = -1;
        if (__pyx_t_14 < 0) {
          __pyx_t_14 += __pyx_pybuffernd_xstart.diminfo[0].shape;
          if (unlikely(__pyx_t_14 < 0)) __pyx_t_2 = 0;
        } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_xstart.diminfo[0].shape)) __pyx_t_2 = 0;
        if (unlikely(__pyx_t_2 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_2);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xstart.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_xstart.diminfo[0].strides));

        /* "pandas/src/sparse.pyx":656
 *                 if xstart[self.xi] < ystart[self.yi]:
 *                     nstart = xstart[self.xi]
 *                     nend = self._find_next_block_end(0)             # <<<<<<<<<<<<<<
 *                 else:
 *                     nstart = ystart[self.yi]
 */
        __pyx_t_15 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->_find_next_block_end(__pyx_v_self, 0); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_nend = __pyx_t_15;

        /* "pandas/src/sparse.pyx":654
 *             else:
 *                 # find end of new block
 *                 if xstart[self.xi] < ystart[self.yi]:             # <<<<<<<<<<<<<<
 *                     nstart = xstart[self.xi]
 *                     nend = self._find_next_block_end(0)
 */
        goto __pyx_L8;
      }

      /* "pandas/src/sparse.pyx":658
 *                     nend = self._find_next_block_end(0)
 *                 else:
 *                     nstart = ystart[self.yi]             # <<<<<<<<<<<<<<
 *                     nend = self._find_next_block_end(1)
 * 
 */
      /*else*/ {
        __pyx_t_16 = __pyx_v_self->__pyx_base.yi;
        __pyx_t_2 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_pybuffernd_ystart.diminfo[0].shape;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_2 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_2 = 0;
        if (unlikely(__pyx_t_2 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_2);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_nstart = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_ystart.diminfo[0].strides));

        /* "pandas/src/sparse.pyx":659
 *                 else:
 *                     nstart = ystart[self.yi]
 *                     nend = self._find_next_block_end(1)             # <<<<<<<<<<<<<<
 * 
 *             out_blocs.append(nstart)
 */
        __pyx_t_15 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->_find_next_block_end(__pyx_v_self, 1); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_nend = __pyx_t_15;
      }
      __pyx_L8:;
    }
    __pyx_L5:;

    /* "pandas/src/sparse.pyx":661
 *                     nend = self._find_next_block_end(1)
 * 
 *             out_blocs.append(nstart)             # <<<<<<<<<<<<<<
 *             out_blengths.append(nend - nstart)
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_nstart); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_out_blocs, __pyx_t_1); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pandas/src/sparse.pyx":662
 * 
 *             out_blocs.append(nstart)
 *             out_blengths.append(nend - nstart)             # <<<<<<<<<<<<<<
 * 
 *         return BlockIndex(self.x.length, out_blocs, out_blengths)
 */
    __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_nend - __pyx_v_nstart)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_out_blengths, __pyx_t_1); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4_break:;

  /* "pandas/src/sparse.pyx":664
 *             out_blengths.append(nend - nstart)
 * 
 *         return BlockIndex(self.x.length, out_blocs, out_blengths)             # <<<<<<<<<<<<<<
 * 
 *     cdef int32_t _find_next_block_end(self, bint mode) except -1:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->__pyx_base.x->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_out_blocs);
  __Pyx_GIVEREF(__pyx_v_out_blocs);
  PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_v_out_blocs);
  __Pyx_INCREF(__pyx_v_out_blengths);
  __Pyx_GIVEREF(__pyx_v_out_blengths);
  PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_v_out_blengths);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex), __pyx_t_18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":627
 *     """
 * 
 *     cdef _make_merged_blocks(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray[int32_t, ndim=1] xstart, xend, ystart, yend
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_18);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockUnion._make_merged_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_xstart);
  __Pyx_XDECREF((PyObject *)__pyx_v_xend);
  __Pyx_XDECREF((PyObject *)__pyx_v_ystart);
  __Pyx_XDECREF((PyObject *)__pyx_v_yend);
  __Pyx_XDECREF(__pyx_v_out_blocs);
  __Pyx_XDECREF(__pyx_v_out_blengths);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":666
 *         return BlockIndex(self.x.length, out_blocs, out_blengths)
 * 
 *     cdef int32_t _find_next_block_end(self, bint mode) except -1:             # <<<<<<<<<<<<<<
 *         """
 *         Wow, this got complicated in a hurry
 */

static __pyx_t_5numpy_int32_t __pyx_f_6pandas_7_sparse_10BlockUnion__find_next_block_end(struct __pyx_obj_6pandas_7_sparse_BlockUnion *__pyx_v_self, int __pyx_v_mode) {
  CYTHON_UNUSED PyArrayObject *__pyx_v_xstart = 0;
  PyArrayObject *__pyx_v_xend = 0;
  PyArrayObject *__pyx_v_ystart = 0;
  PyArrayObject *__pyx_v_yend = 0;
  __pyx_t_5numpy_int32_t __pyx_v_xi;
  __pyx_t_5numpy_int32_t __pyx_v_yi;
  __pyx_t_5numpy_int32_t __pyx_v_ynblocks;
  __pyx_t_5numpy_int32_t __pyx_v_nend;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xend;
  __Pyx_Buffer __pyx_pybuffer_xend;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xstart;
  __Pyx_Buffer __pyx_pybuffer_xstart;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_yend;
  __Pyx_Buffer __pyx_pybuffer_yend;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ystart;
  __Pyx_Buffer __pyx_pybuffer_ystart;
  __pyx_t_5numpy_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_5numpy_int32_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_find_next_block_end", 0);
  __pyx_pybuffer_xstart.pybuffer.buf = NULL;
  __pyx_pybuffer_xstart.refcount = 0;
  __pyx_pybuffernd_xstart.data = NULL;
  __pyx_pybuffernd_xstart.rcbuffer = &__pyx_pybuffer_xstart;
  __pyx_pybuffer_xend.pybuffer.buf = NULL;
  __pyx_pybuffer_xend.refcount = 0;
  __pyx_pybuffernd_xend.data = NULL;
  __pyx_pybuffernd_xend.rcbuffer = &__pyx_pybuffer_xend;
  __pyx_pybuffer_ystart.pybuffer.buf = NULL;
  __pyx_pybuffer_ystart.refcount = 0;
  __pyx_pybuffernd_ystart.data = NULL;
  __pyx_pybuffernd_ystart.rcbuffer = &__pyx_pybuffer_ystart;
  __pyx_pybuffer_yend.pybuffer.buf = NULL;
  __pyx_pybuffer_yend.refcount = 0;
  __pyx_pybuffernd_yend.data = NULL;
  __pyx_pybuffernd_yend.rcbuffer = &__pyx_pybuffer_yend;

  /* "pandas/src/sparse.pyx":677
 *             int32_t xi, yi, xnblocks, ynblocks, nend
 * 
 *         if mode != 0 and mode != 1:             # <<<<<<<<<<<<<<
 *             raise Exception('Mode must be 0 or 1')
 * 
 */
  switch (__pyx_v_mode) {
    case 0:
    case 1:
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":678
 * 
 *         if mode != 0 and mode != 1:
 *             raise Exception('Mode must be 0 or 1')             # <<<<<<<<<<<<<<
 * 
 *         # so symmetric code will work
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":677
 *             int32_t xi, yi, xnblocks, ynblocks, nend
 * 
 *         if mode != 0 and mode != 1:             # <<<<<<<<<<<<<<
 *             raise Exception('Mode must be 0 or 1')
 * 
 */
  }

  /* "pandas/src/sparse.pyx":681
 * 
 *         # so symmetric code will work
 *         if mode == 0:             # <<<<<<<<<<<<<<
 *             xstart = self.xstart
 *             xend = self.xend
 */
  __pyx_t_1 = ((__pyx_v_mode == 0) != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":682
 *         # so symmetric code will work
 *         if mode == 0:
 *             xstart = self.xstart             # <<<<<<<<<<<<<<
 *             xend = self.xend
 *             xi = self.xi
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xstart);
    __Pyx_INCREF(__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)__pyx_v_xstart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_xstart.diminfo[0].strides = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xstart.diminfo[0].shape = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_xstart = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":683
 *         if mode == 0:
 *             xstart = self.xstart
 *             xend = self.xend             # <<<<<<<<<<<<<<
 *             xi = self.xi
 * 
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xend);
    __Pyx_INCREF(__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)__pyx_v_xend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        }
      }
      __pyx_pybuffernd_xend.diminfo[0].strides = __pyx_pybuffernd_xend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xend.diminfo[0].shape = __pyx_pybuffernd_xend.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_xend = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":684
 *             xstart = self.xstart
 *             xend = self.xend
 *             xi = self.xi             # <<<<<<<<<<<<<<
 * 
 *             ystart = self.ystart
 */
    __pyx_t_7 = __pyx_v_self->__pyx_base.xi;
    __pyx_v_xi = __pyx_t_7;

    /* "pandas/src/sparse.pyx":686
 *             xi = self.xi
 * 
 *             ystart = self.ystart             # <<<<<<<<<<<<<<
 *             yend = self.yend
 *             yi = self.yi
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.ystart);
    __Pyx_INCREF(__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)__pyx_v_ystart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_ystart.diminfo[0].strides = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ystart.diminfo[0].shape = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_ystart = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":687
 * 
 *             ystart = self.ystart
 *             yend = self.yend             # <<<<<<<<<<<<<<
 *             yi = self.yi
 *             ynblocks = self.y.nblocks
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.yend);
    __Pyx_INCREF(__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)__pyx_v_yend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        }
      }
      __pyx_pybuffernd_yend.diminfo[0].strides = __pyx_pybuffernd_yend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yend.diminfo[0].shape = __pyx_pybuffernd_yend.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_yend = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":688
 *             ystart = self.ystart
 *             yend = self.yend
 *             yi = self.yi             # <<<<<<<<<<<<<<
 *             ynblocks = self.y.nblocks
 *         else:
 */
    __pyx_t_7 = __pyx_v_self->__pyx_base.yi;
    __pyx_v_yi = __pyx_t_7;

    /* "pandas/src/sparse.pyx":689
 *             yend = self.yend
 *             yi = self.yi
 *             ynblocks = self.y.nblocks             # <<<<<<<<<<<<<<
 *         else:
 *             xstart = self.ystart
 */
    __pyx_t_8 = __pyx_v_self->__pyx_base.y->nblocks;
    __pyx_v_ynblocks = __pyx_t_8;

    /* "pandas/src/sparse.pyx":681
 * 
 *         # so symmetric code will work
 *         if mode == 0:             # <<<<<<<<<<<<<<
 *             xstart = self.xstart
 *             xend = self.xend
 */
    goto __pyx_L4;
  }

  /* "pandas/src/sparse.pyx":691
 *             ynblocks = self.y.nblocks
 *         else:
 *             xstart = self.ystart             # <<<<<<<<<<<<<<
 *             xend = self.yend
 *             xi = self.yi
 */
  /*else*/ {
    __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.ystart);
    __Pyx_INCREF(__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer, (PyObject*)__pyx_v_xstart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_xstart.diminfo[0].strides = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xstart.diminfo[0].shape = __pyx_pybuffernd_xstart.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_xstart = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":692
 *         else:
 *             xstart = self.ystart
 *             xend = self.yend             # <<<<<<<<<<<<<<
 *             xi = self.yi
 * 
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.yend);
    __Pyx_INCREF(__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xend.rcbuffer->pybuffer, (PyObject*)__pyx_v_xend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        }
      }
      __pyx_pybuffernd_xend.diminfo[0].strides = __pyx_pybuffernd_xend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xend.diminfo[0].shape = __pyx_pybuffernd_xend.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_xend = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":693
 *             xstart = self.ystart
 *             xend = self.yend
 *             xi = self.yi             # <<<<<<<<<<<<<<
 * 
 *             ystart = self.xstart
 */
    __pyx_t_7 = __pyx_v_self->__pyx_base.yi;
    __pyx_v_xi = __pyx_t_7;

    /* "pandas/src/sparse.pyx":695
 *             xi = self.yi
 * 
 *             ystart = self.xstart             # <<<<<<<<<<<<<<
 *             yend = self.xend
 *             yi = self.xi
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xstart);
    __Pyx_INCREF(__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer, (PyObject*)__pyx_v_ystart, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_ystart.diminfo[0].strides = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ystart.diminfo[0].shape = __pyx_pybuffernd_ystart.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_ystart = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":696
 * 
 *             ystart = self.xstart
 *             yend = self.xend             # <<<<<<<<<<<<<<
 *             yi = self.xi
 *             ynblocks = self.x.nblocks
 */
    __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.xend);
    __Pyx_INCREF(__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yend.rcbuffer->pybuffer, (PyObject*)__pyx_v_yend, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        }
      }
      __pyx_pybuffernd_yend.diminfo[0].strides = __pyx_pybuffernd_yend.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yend.diminfo[0].shape = __pyx_pybuffernd_yend.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_yend = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":697
 *             ystart = self.xstart
 *             yend = self.xend
 *             yi = self.xi             # <<<<<<<<<<<<<<
 *             ynblocks = self.x.nblocks
 * 
 */
    __pyx_t_7 = __pyx_v_self->__pyx_base.xi;
    __pyx_v_yi = __pyx_t_7;

    /* "pandas/src/sparse.pyx":698
 *             yend = self.xend
 *             yi = self.xi
 *             ynblocks = self.x.nblocks             # <<<<<<<<<<<<<<
 * 
 *         nend = xend[xi]
 */
    __pyx_t_8 = __pyx_v_self->__pyx_base.x->nblocks;
    __pyx_v_ynblocks = __pyx_t_8;
  }
  __pyx_L4:;

  /* "pandas/src/sparse.pyx":700
 *             ynblocks = self.x.nblocks
 * 
 *         nend = xend[xi]             # <<<<<<<<<<<<<<
 * 
 *         # print 'here xi=%d, yi=%d, mode=%d, nend=%d' % (self.xi, self.yi,
 */
  __pyx_t_9 = __pyx_v_xi;
  __pyx_t_3 = -1;
  if (__pyx_t_9 < 0) {
    __pyx_t_9 += __pyx_pybuffernd_xend.diminfo[0].shape;
    if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0;
  } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_xend.diminfo[0].shape)) __pyx_t_3 = 0;
  if (unlikely(__pyx_t_3 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_3);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_nend = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xend.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_xend.diminfo[0].strides));

  /* "pandas/src/sparse.pyx":706
 * 
 *         # done with y?
 *         if yi == ynblocks:             # <<<<<<<<<<<<<<
 *             self._set_current_indices(xi + 1, yi, mode)
 *             return nend
 */
  __pyx_t_1 = ((__pyx_v_yi == __pyx_v_ynblocks) != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":707
 *         # done with y?
 *         if yi == ynblocks:
 *             self._set_current_indices(xi + 1, yi, mode)             # <<<<<<<<<<<<<<
 *             return nend
 *         elif nend < ystart[yi]:
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_current_indices(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), (__pyx_v_xi + 1), __pyx_v_yi, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":708
 *         if yi == ynblocks:
 *             self._set_current_indices(xi + 1, yi, mode)
 *             return nend             # <<<<<<<<<<<<<<
 *         elif nend < ystart[yi]:
 *             # block ends before y block
 */
    __pyx_r = __pyx_v_nend;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":706
 * 
 *         # done with y?
 *         if yi == ynblocks:             # <<<<<<<<<<<<<<
 *             self._set_current_indices(xi + 1, yi, mode)
 *             return nend
 */
  }

  /* "pandas/src/sparse.pyx":709
 *             self._set_current_indices(xi + 1, yi, mode)
 *             return nend
 *         elif nend < ystart[yi]:             # <<<<<<<<<<<<<<
 *             # block ends before y block
 *             self._set_current_indices(xi + 1, yi, mode)
 */
  __pyx_t_10 = __pyx_v_yi;
  __pyx_t_3 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_pybuffernd_ystart.diminfo[0].shape;
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_3 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_3 = 0;
  if (unlikely(__pyx_t_3 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_3);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = ((__pyx_v_nend < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":711
 *         elif nend < ystart[yi]:
 *             # block ends before y block
 *             self._set_current_indices(xi + 1, yi, mode)             # <<<<<<<<<<<<<<
 *             return nend
 *         else:
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_current_indices(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), (__pyx_v_xi + 1), __pyx_v_yi, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":712
 *             # block ends before y block
 *             self._set_current_indices(xi + 1, yi, mode)
 *             return nend             # <<<<<<<<<<<<<<
 *         else:
 *             while yi < ynblocks and nend > yend[yi]:
 */
    __pyx_r = __pyx_v_nend;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":709
 *             self._set_current_indices(xi + 1, yi, mode)
 *             return nend
 *         elif nend < ystart[yi]:             # <<<<<<<<<<<<<<
 *             # block ends before y block
 *             self._set_current_indices(xi + 1, yi, mode)
 */
  }

  /* "pandas/src/sparse.pyx":714
 *             return nend
 *         else:
 *             while yi < ynblocks and nend > yend[yi]:             # <<<<<<<<<<<<<<
 *                 yi += 1
 * 
 */
  /*else*/ {
    while (1) {
      __pyx_t_11 = ((__pyx_v_yi < __pyx_v_ynblocks) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_1 = __pyx_t_11;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_12 = __pyx_v_yi;
      __pyx_t_3 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_pybuffernd_yend.diminfo[0].shape;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_yend.diminfo[0].shape)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_11 = ((__pyx_v_nend > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yend.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_yend.diminfo[0].strides))) != 0);
      __pyx_t_1 = __pyx_t_11;
      __pyx_L8_bool_binop_done:;
      if (!__pyx_t_1) break;

      /* "pandas/src/sparse.pyx":715
 *         else:
 *             while yi < ynblocks and nend > yend[yi]:
 *                 yi += 1             # <<<<<<<<<<<<<<
 * 
 *             self._set_current_indices(xi + 1, yi, mode)
 */
      __pyx_v_yi = (__pyx_v_yi + 1);
    }

    /* "pandas/src/sparse.pyx":717
 *                 yi += 1
 * 
 *             self._set_current_indices(xi + 1, yi, mode)             # <<<<<<<<<<<<<<
 * 
 *             if yi == ynblocks:
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_current_indices(((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)__pyx_v_self), (__pyx_v_xi + 1), __pyx_v_yi, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":719
 *             self._set_current_indices(xi + 1, yi, mode)
 * 
 *             if yi == ynblocks:             # <<<<<<<<<<<<<<
 *                 return nend
 * 
 */
    __pyx_t_1 = ((__pyx_v_yi == __pyx_v_ynblocks) != 0);
    if (__pyx_t_1) {

      /* "pandas/src/sparse.pyx":720
 * 
 *             if yi == ynblocks:
 *                 return nend             # <<<<<<<<<<<<<<
 * 
 *             if nend < ystart[yi]:
 */
      __pyx_r = __pyx_v_nend;
      goto __pyx_L0;

      /* "pandas/src/sparse.pyx":719
 *             self._set_current_indices(xi + 1, yi, mode)
 * 
 *             if yi == ynblocks:             # <<<<<<<<<<<<<<
 *                 return nend
 * 
 */
    }

    /* "pandas/src/sparse.pyx":722
 *                 return nend
 * 
 *             if nend < ystart[yi]:             # <<<<<<<<<<<<<<
 *                 # we're done, return the block end
 *                 return nend
 */
    __pyx_t_13 = __pyx_v_yi;
    __pyx_t_3 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_ystart.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_ystart.diminfo[0].shape)) __pyx_t_3 = 0;
    if (unlikely(__pyx_t_3 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_3);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = ((__pyx_v_nend < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_ystart.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0);
    if (__pyx_t_1) {

      /* "pandas/src/sparse.pyx":724
 *             if nend < ystart[yi]:
 *                 # we're done, return the block end
 *                 return nend             # <<<<<<<<<<<<<<
 *             else:
 *                 # merge blocks, continue searching
 */
      __pyx_r = __pyx_v_nend;
      goto __pyx_L0;

      /* "pandas/src/sparse.pyx":722
 *                 return nend
 * 
 *             if nend < ystart[yi]:             # <<<<<<<<<<<<<<
 *                 # we're done, return the block end
 *                 return nend
 */
    }

    /* "pandas/src/sparse.pyx":728
 *                 # merge blocks, continue searching
 *                 # this also catches the case where blocks
 *                 return self._find_next_block_end(1 - mode)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion *)__pyx_v_self->__pyx_base.__pyx_vtab)->_find_next_block_end(__pyx_v_self, (1 - __pyx_v_mode)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = __pyx_t_7;
      goto __pyx_L0;
    }
  }

  /* "pandas/src/sparse.pyx":666
 *         return BlockIndex(self.x.length, out_blocs, out_blengths)
 * 
 *     cdef int32_t _find_next_block_end(self, bint mode) except -1:             # <<<<<<<<<<<<<<
 *         """
 *         Wow, this got complicated in a hurry
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.BlockUnion._find_next_block_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xend.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xstart.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yend.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ystart.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_xstart);
  __Pyx_XDECREF((PyObject *)__pyx_v_xend);
  __Pyx_XDECREF((PyObject *)__pyx_v_ystart);
  __Pyx_XDECREF((PyObject *)__pyx_v_yend);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":737
 * 
 * 
 * cdef inline tuple sparse_combine(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                                  ndarray y, SparseIndex yindex, float64_t yfill,
 *                                  double_func op):
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_sparse_combine(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sparse_combine", 0);

  /* "pandas/src/sparse.pyx":740
 *                                  ndarray y, SparseIndex yindex, float64_t yfill,
 *                                  double_func op):
 *     if isinstance(xindex, BlockIndex):             # <<<<<<<<<<<<<<
 *         return block_op(x, xindex.to_block_index(), xfill,
 *                         y, yindex.to_block_index(), yfill, op)
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_BlockIndex); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pandas/src/sparse.pyx":741
 *                                  double_func op):
 *     if isinstance(xindex, BlockIndex):
 *         return block_op(x, xindex.to_block_index(), xfill,             # <<<<<<<<<<<<<<
 *                         y, yindex.to_block_index(), yfill, op)
 *     elif isinstance(xindex, IntIndex):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xindex), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":742
 *     if isinstance(xindex, BlockIndex):
 *         return block_op(x, xindex.to_block_index(), xfill,
 *                         y, yindex.to_block_index(), yfill, op)             # <<<<<<<<<<<<<<
 *     elif isinstance(xindex, IntIndex):
 *         return int_op(x, xindex.to_int_index(), xfill,
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_yindex), __pyx_n_s_to_block_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pandas_7_sparse_BlockIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":741
 *                                  double_func op):
 *     if isinstance(xindex, BlockIndex):
 *         return block_op(x, xindex.to_block_index(), xfill,             # <<<<<<<<<<<<<<
 *                         y, yindex.to_block_index(), yfill, op)
 *     elif isinstance(xindex, IntIndex):
 */
    __pyx_t_5 = __pyx_f_6pandas_7_sparse_block_op(__pyx_v_x, ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_3), __pyx_v_xfill, __pyx_v_y, ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_4), __pyx_v_yfill, __pyx_v_op); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":740
 *                                  ndarray y, SparseIndex yindex, float64_t yfill,
 *                                  double_func op):
 *     if isinstance(xindex, BlockIndex):             # <<<<<<<<<<<<<<
 *         return block_op(x, xindex.to_block_index(), xfill,
 *                         y, yindex.to_block_index(), yfill, op)
 */
  }

  /* "pandas/src/sparse.pyx":743
 *         return block_op(x, xindex.to_block_index(), xfill,
 *                         y, yindex.to_block_index(), yfill, op)
 *     elif isinstance(xindex, IntIndex):             # <<<<<<<<<<<<<<
 *         return int_op(x, xindex.to_int_index(), xfill,
 *                       y, yindex.to_int_index(), yfill, op)
 */
  __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_IntIndex); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":744
 *                         y, yindex.to_block_index(), yfill, op)
 *     elif isinstance(xindex, IntIndex):
 *         return int_op(x, xindex.to_int_index(), xfill,             # <<<<<<<<<<<<<<
 *                       y, yindex.to_int_index(), yfill, op)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":745
 *     elif isinstance(xindex, IntIndex):
 *         return int_op(x, xindex.to_int_index(), xfill,
 *                       y, yindex.to_int_index(), yfill, op)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_yindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pandas_7_sparse_IntIndex))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":744
 *                         y, yindex.to_block_index(), yfill, op)
 *     elif isinstance(xindex, IntIndex):
 *         return int_op(x, xindex.to_int_index(), xfill,             # <<<<<<<<<<<<<<
 *                       y, yindex.to_int_index(), yfill, op)
 * 
 */
    __pyx_t_3 = __pyx_f_6pandas_7_sparse_int_op(__pyx_v_x, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_5), __pyx_v_xfill, __pyx_v_y, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_4), __pyx_v_yfill, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":743
 *         return block_op(x, xindex.to_block_index(), xfill,
 *                         y, yindex.to_block_index(), yfill, op)
 *     elif isinstance(xindex, IntIndex):             # <<<<<<<<<<<<<<
 *         return int_op(x, xindex.to_int_index(), xfill,
 *                       y, yindex.to_int_index(), yfill, op)
 */
  }

  /* "pandas/src/sparse.pyx":737
 * 
 * 
 * cdef inline tuple sparse_combine(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                                  ndarray y, SparseIndex yindex, float64_t yfill,
 *                                  double_func op):
 */

  /* function exit code */
  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas._sparse.sparse_combine", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":749
 * 
 * @cython.boundscheck(False)
 * cdef inline tuple block_op(ndarray x_, BlockIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                            ndarray y_, BlockIndex yindex, float64_t yfill,
 *                            double_func op):
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_block_op(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) {
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_out_index = 0;
  Py_ssize_t __pyx_v_xi;
  Py_ssize_t __pyx_v_yi;
  Py_ssize_t __pyx_v_out_i;
  Py_ssize_t __pyx_v_xbp;
  Py_ssize_t __pyx_v_ybp;
  __pyx_t_5numpy_int32_t __pyx_v_xloc;
  __pyx_t_5numpy_int32_t __pyx_v_yloc;
  Py_ssize_t __pyx_v_xblock;
  Py_ssize_t __pyx_v_yblock;
  PyArrayObject *__pyx_v_x = 0;
  PyArrayObject *__pyx_v_y = 0;
  PyArrayObject *__pyx_v_out = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  __Pyx_Buffer __pyx_pybuffer_x;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_y;
  __Pyx_Buffer __pyx_pybuffer_y;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("block_op", 0);
  __pyx_pybuffer_x.pybuffer.buf = NULL;
  __pyx_pybuffer_x.refcount = 0;
  __pyx_pybuffernd_x.data = NULL;
  __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  __pyx_pybuffer_y.pybuffer.buf = NULL;
  __pyx_pybuffer_y.refcount = 0;
  __pyx_pybuffernd_y.data = NULL;
  __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;

  /* "pandas/src/sparse.pyx":758
 *     cdef:
 *         BlockIndex out_index
 *         Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices             # <<<<<<<<<<<<<<
 *         Py_ssize_t xbp = 0, ybp = 0 # block positions
 *         int32_t xloc, yloc
 */
  __pyx_v_xi = 0;
  __pyx_v_yi = 0;
  __pyx_v_out_i = 0;

  /* "pandas/src/sparse.pyx":759
 *         BlockIndex out_index
 *         Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices
 *         Py_ssize_t xbp = 0, ybp = 0 # block positions             # <<<<<<<<<<<<<<
 *         int32_t xloc, yloc
 *         Py_ssize_t xblock = 0, yblock = 0 # block numbers
 */
  __pyx_v_xbp = 0;
  __pyx_v_ybp = 0;

  /* "pandas/src/sparse.pyx":761
 *         Py_ssize_t xbp = 0, ybp = 0 # block positions
 *         int32_t xloc, yloc
 *         Py_ssize_t xblock = 0, yblock = 0 # block numbers             # <<<<<<<<<<<<<<
 * 
 *         ndarray[float64_t, ndim=1] x, y
 */
  __pyx_v_xblock = 0;
  __pyx_v_yblock = 0;

  /* "pandas/src/sparse.pyx":767
 * 
 *     # to suppress Cython warning
 *     x = x_             # <<<<<<<<<<<<<<
 *     y = y_
 * 
 */
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      }
    }
    __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_x_));
  __pyx_v_x = ((PyArrayObject *)__pyx_v_x_);

  /* "pandas/src/sparse.pyx":768
 *     # to suppress Cython warning
 *     x = x_
 *     y = y_             # <<<<<<<<<<<<<<
 * 
 *     out_index = xindex.make_union(yindex)
 */
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      }
    }
    __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_y_));
  __pyx_v_y = ((PyArrayObject *)__pyx_v_y_);

  /* "pandas/src/sparse.pyx":770
 *     y = y_
 * 
 *     out_index = xindex.make_union(yindex)             # <<<<<<<<<<<<<<
 *     out = np.empty(out_index.npoints, dtype=np.float64)
 * 
 */
  __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex *)__pyx_v_xindex->__pyx_vtab)->make_union(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":771
 * 
 *     out_index = xindex.make_union(yindex)
 *     out = np.empty(out_index.npoints, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *     # Wow, what a hack job. Need to do something about this
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      }
    }
    __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = 0;
  __pyx_v_out = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":776
 * 
 *     # walk the two SparseVectors, adding matched locations...
 *     for out_i from 0 <= out_i < out_index.npoints:             # <<<<<<<<<<<<<<
 *         if yblock == yindex.nblocks:
 *             # use y fill value
 */
  __pyx_t_11 = __pyx_v_out_index->npoints;
  for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) {

    /* "pandas/src/sparse.pyx":777
 *     # walk the two SparseVectors, adding matched locations...
 *     for out_i from 0 <= out_i < out_index.npoints:
 *         if yblock == yindex.nblocks:             # <<<<<<<<<<<<<<
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 */
    __pyx_t_12 = ((__pyx_v_yblock == __pyx_v_yindex->nblocks) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/sparse.pyx":779
 *         if yblock == yindex.nblocks:
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)             # <<<<<<<<<<<<<<
 *             xi += 1
 * 
 */
      __pyx_t_13 = __pyx_v_xi;
      if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
      __pyx_t_14 = __pyx_v_out_i;
      if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill);

      /* "pandas/src/sparse.pyx":780
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 *             xi += 1             # <<<<<<<<<<<<<<
 * 
 *             # advance x location
 */
      __pyx_v_xi = (__pyx_v_xi + 1);

      /* "pandas/src/sparse.pyx":783
 * 
 *             # advance x location
 *             xbp += 1             # <<<<<<<<<<<<<<
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 */
      __pyx_v_xbp = (__pyx_v_xbp + 1);

      /* "pandas/src/sparse.pyx":784
 *             # advance x location
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:             # <<<<<<<<<<<<<<
 *                 xblock += 1
 *                 xbp = 0
 */
      __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/sparse.pyx":785
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1             # <<<<<<<<<<<<<<
 *                 xbp = 0
 *             continue
 */
        __pyx_v_xblock = (__pyx_v_xblock + 1);

        /* "pandas/src/sparse.pyx":786
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 *                 xbp = 0             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
        __pyx_v_xbp = 0;

        /* "pandas/src/sparse.pyx":784
 *             # advance x location
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:             # <<<<<<<<<<<<<<
 *                 xblock += 1
 *                 xbp = 0
 */
      }

      /* "pandas/src/sparse.pyx":787
 *                 xblock += 1
 *                 xbp = 0
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         if xblock == xindex.nblocks:
 */
      goto __pyx_L3_continue;

      /* "pandas/src/sparse.pyx":777
 *     # walk the two SparseVectors, adding matched locations...
 *     for out_i from 0 <= out_i < out_index.npoints:
 *         if yblock == yindex.nblocks:             # <<<<<<<<<<<<<<
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 */
    }

    /* "pandas/src/sparse.pyx":789
 *             continue
 * 
 *         if xblock == xindex.nblocks:             # <<<<<<<<<<<<<<
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])
 */
    __pyx_t_12 = ((__pyx_v_xblock == __pyx_v_xindex->nblocks) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/sparse.pyx":791
 *         if xblock == xindex.nblocks:
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])             # <<<<<<<<<<<<<<
 *             yi += 1
 * 
 */
      __pyx_t_15 = __pyx_v_yi;
      if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_y.diminfo[0].shape;
      __pyx_t_16 = __pyx_v_out_i;
      if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_y.diminfo[0].strides)));

      /* "pandas/src/sparse.pyx":792
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])
 *             yi += 1             # <<<<<<<<<<<<<<
 * 
 *             # advance y location
 */
      __pyx_v_yi = (__pyx_v_yi + 1);

      /* "pandas/src/sparse.pyx":795
 * 
 *             # advance y location
 *             ybp += 1             # <<<<<<<<<<<<<<
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 */
      __pyx_v_ybp = (__pyx_v_ybp + 1);

      /* "pandas/src/sparse.pyx":796
 *             # advance y location
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:             # <<<<<<<<<<<<<<
 *                 yblock += 1
 *                 ybp = 0
 */
      __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/sparse.pyx":797
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1             # <<<<<<<<<<<<<<
 *                 ybp = 0
 *             continue
 */
        __pyx_v_yblock = (__pyx_v_yblock + 1);

        /* "pandas/src/sparse.pyx":798
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 *                 ybp = 0             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
        __pyx_v_ybp = 0;

        /* "pandas/src/sparse.pyx":796
 *             # advance y location
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:             # <<<<<<<<<<<<<<
 *                 yblock += 1
 *                 ybp = 0
 */
      }

      /* "pandas/src/sparse.pyx":799
 *                 yblock += 1
 *                 ybp = 0
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         yloc = yindex.locbuf[yblock] + ybp
 */
      goto __pyx_L3_continue;

      /* "pandas/src/sparse.pyx":789
 *             continue
 * 
 *         if xblock == xindex.nblocks:             # <<<<<<<<<<<<<<
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])
 */
    }

    /* "pandas/src/sparse.pyx":801
 *             continue
 * 
 *         yloc = yindex.locbuf[yblock] + ybp             # <<<<<<<<<<<<<<
 *         xloc = xindex.locbuf[xblock] + xbp
 * 
 */
    __pyx_v_yloc = ((__pyx_v_yindex->locbuf[__pyx_v_yblock]) + __pyx_v_ybp);

    /* "pandas/src/sparse.pyx":802
 * 
 *         yloc = yindex.locbuf[yblock] + ybp
 *         xloc = xindex.locbuf[xblock] + xbp             # <<<<<<<<<<<<<<
 * 
 *         # each index in the out_index had to come from either x, y, or both
 */
    __pyx_v_xloc = ((__pyx_v_xindex->locbuf[__pyx_v_xblock]) + __pyx_v_xbp);

    /* "pandas/src/sparse.pyx":805
 * 
 *         # each index in the out_index had to come from either x, y, or both
 *         if xloc == yloc:             # <<<<<<<<<<<<<<
 *             out[out_i] = op(x[xi], y[yi])
 *             xi += 1
 */
    __pyx_t_12 = ((__pyx_v_xloc == __pyx_v_yloc) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/sparse.pyx":806
 *         # each index in the out_index had to come from either x, y, or both
 *         if xloc == yloc:
 *             out[out_i] = op(x[xi], y[yi])             # <<<<<<<<<<<<<<
 *             xi += 1
 *             yi += 1
 */
      __pyx_t_17 = __pyx_v_xi;
      if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape;
      __pyx_t_18 = __pyx_v_yi;
      if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_y.diminfo[0].shape;
      __pyx_t_19 = __pyx_v_out_i;
      if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_y.diminfo[0].strides)));

      /* "pandas/src/sparse.pyx":807
 *         if xloc == yloc:
 *             out[out_i] = op(x[xi], y[yi])
 *             xi += 1             # <<<<<<<<<<<<<<
 *             yi += 1
 * 
 */
      __pyx_v_xi = (__pyx_v_xi + 1);

      /* "pandas/src/sparse.pyx":808
 *             out[out_i] = op(x[xi], y[yi])
 *             xi += 1
 *             yi += 1             # <<<<<<<<<<<<<<
 * 
 *             # advance both locations
 */
      __pyx_v_yi = (__pyx_v_yi + 1);

      /* "pandas/src/sparse.pyx":811
 * 
 *             # advance both locations
 *             xbp += 1             # <<<<<<<<<<<<<<
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 */
      __pyx_v_xbp = (__pyx_v_xbp + 1);

      /* "pandas/src/sparse.pyx":812
 *             # advance both locations
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:             # <<<<<<<<<<<<<<
 *                 xblock += 1
 *                 xbp = 0
 */
      __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/sparse.pyx":813
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1             # <<<<<<<<<<<<<<
 *                 xbp = 0
 * 
 */
        __pyx_v_xblock = (__pyx_v_xblock + 1);

        /* "pandas/src/sparse.pyx":814
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 *                 xbp = 0             # <<<<<<<<<<<<<<
 * 
 *             ybp += 1
 */
        __pyx_v_xbp = 0;

        /* "pandas/src/sparse.pyx":812
 *             # advance both locations
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:             # <<<<<<<<<<<<<<
 *                 xblock += 1
 *                 xbp = 0
 */
      }

      /* "pandas/src/sparse.pyx":816
 *                 xbp = 0
 * 
 *             ybp += 1             # <<<<<<<<<<<<<<
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 */
      __pyx_v_ybp = (__pyx_v_ybp + 1);

      /* "pandas/src/sparse.pyx":817
 * 
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:             # <<<<<<<<<<<<<<
 *                 yblock += 1
 *                 ybp = 0
 */
      __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/sparse.pyx":818
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1             # <<<<<<<<<<<<<<
 *                 ybp = 0
 * 
 */
        __pyx_v_yblock = (__pyx_v_yblock + 1);

        /* "pandas/src/sparse.pyx":819
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 *                 ybp = 0             # <<<<<<<<<<<<<<
 * 
 *         elif xloc < yloc:
 */
        __pyx_v_ybp = 0;

        /* "pandas/src/sparse.pyx":817
 * 
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:             # <<<<<<<<<<<<<<
 *                 yblock += 1
 *                 ybp = 0
 */
      }

      /* "pandas/src/sparse.pyx":805
 * 
 *         # each index in the out_index had to come from either x, y, or both
 *         if xloc == yloc:             # <<<<<<<<<<<<<<
 *             out[out_i] = op(x[xi], y[yi])
 *             xi += 1
 */
      goto __pyx_L9;
    }

    /* "pandas/src/sparse.pyx":821
 *                 ybp = 0
 * 
 *         elif xloc < yloc:             # <<<<<<<<<<<<<<
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 */
    __pyx_t_12 = ((__pyx_v_xloc < __pyx_v_yloc) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/sparse.pyx":823
 *         elif xloc < yloc:
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)             # <<<<<<<<<<<<<<
 *             xi += 1
 * 
 */
      __pyx_t_20 = __pyx_v_xi;
      if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_x.diminfo[0].shape;
      __pyx_t_21 = __pyx_v_out_i;
      if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill);

      /* "pandas/src/sparse.pyx":824
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 *             xi += 1             # <<<<<<<<<<<<<<
 * 
 *             # advance x location
 */
      __pyx_v_xi = (__pyx_v_xi + 1);

      /* "pandas/src/sparse.pyx":827
 * 
 *             # advance x location
 *             xbp += 1             # <<<<<<<<<<<<<<
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 */
      __pyx_v_xbp = (__pyx_v_xbp + 1);

      /* "pandas/src/sparse.pyx":828
 *             # advance x location
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:             # <<<<<<<<<<<<<<
 *                 xblock += 1
 *                 xbp = 0
 */
      __pyx_t_12 = ((__pyx_v_xbp == (__pyx_v_xindex->lenbuf[__pyx_v_xblock])) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/sparse.pyx":829
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1             # <<<<<<<<<<<<<<
 *                 xbp = 0
 *         else:
 */
        __pyx_v_xblock = (__pyx_v_xblock + 1);

        /* "pandas/src/sparse.pyx":830
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 *                 xbp = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # use x fill value
 */
        __pyx_v_xbp = 0;

        /* "pandas/src/sparse.pyx":828
 *             # advance x location
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:             # <<<<<<<<<<<<<<
 *                 xblock += 1
 *                 xbp = 0
 */
      }

      /* "pandas/src/sparse.pyx":821
 *                 ybp = 0
 * 
 *         elif xloc < yloc:             # <<<<<<<<<<<<<<
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 */
      goto __pyx_L9;
    }

    /* "pandas/src/sparse.pyx":833
 *         else:
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])             # <<<<<<<<<<<<<<
 *             yi += 1
 * 
 */
    /*else*/ {
      __pyx_t_22 = __pyx_v_yi;
      if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_y.diminfo[0].shape;
      __pyx_t_23 = __pyx_v_out_i;
      if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_y.diminfo[0].strides)));

      /* "pandas/src/sparse.pyx":834
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])
 *             yi += 1             # <<<<<<<<<<<<<<
 * 
 *             # advance y location
 */
      __pyx_v_yi = (__pyx_v_yi + 1);

      /* "pandas/src/sparse.pyx":837
 * 
 *             # advance y location
 *             ybp += 1             # <<<<<<<<<<<<<<
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 */
      __pyx_v_ybp = (__pyx_v_ybp + 1);

      /* "pandas/src/sparse.pyx":838
 *             # advance y location
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:             # <<<<<<<<<<<<<<
 *                 yblock += 1
 *                 ybp = 0
 */
      __pyx_t_12 = ((__pyx_v_ybp == (__pyx_v_yindex->lenbuf[__pyx_v_yblock])) != 0);
      if (__pyx_t_12) {

        /* "pandas/src/sparse.pyx":839
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1             # <<<<<<<<<<<<<<
 *                 ybp = 0
 * 
 */
        __pyx_v_yblock = (__pyx_v_yblock + 1);

        /* "pandas/src/sparse.pyx":840
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 *                 ybp = 0             # <<<<<<<<<<<<<<
 * 
 *     return out, out_index
 */
        __pyx_v_ybp = 0;

        /* "pandas/src/sparse.pyx":838
 *             # advance y location
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:             # <<<<<<<<<<<<<<
 *                 yblock += 1
 *                 ybp = 0
 */
      }
    }
    __pyx_L9:;
    __pyx_L3_continue:;
  }

  /* "pandas/src/sparse.pyx":842
 *                 ybp = 0
 * 
 *     return out, out_index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out));
  __Pyx_INCREF(((PyObject *)__pyx_v_out_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index));
  __pyx_r = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":749
 * 
 * @cython.boundscheck(False)
 * cdef inline tuple block_op(ndarray x_, BlockIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                            ndarray y_, BlockIndex yindex, float64_t yfill,
 *                            double_func op):
 */

  /* function exit code */
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.block_op", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out_index);
  __Pyx_XDECREF((PyObject *)__pyx_v_x);
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":846
 * 
 * @cython.boundscheck(False)
 * cdef inline tuple int_op(ndarray x_, IntIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                          ndarray y_, IntIndex yindex, float64_t yfill,
 *                          double_func op):
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_op(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, __pyx_t_6pandas_7_sparse_double_func __pyx_v_op) {
  struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_out_index = 0;
  Py_ssize_t __pyx_v_xi;
  Py_ssize_t __pyx_v_yi;
  Py_ssize_t __pyx_v_out_i;
  __pyx_t_5numpy_int32_t __pyx_v_xloc;
  __pyx_t_5numpy_int32_t __pyx_v_yloc;
  PyArrayObject *__pyx_v_xindices = 0;
  PyArrayObject *__pyx_v_yindices = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_out_indices = 0;
  PyArrayObject *__pyx_v_x = 0;
  PyArrayObject *__pyx_v_y = 0;
  PyArrayObject *__pyx_v_out = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out;
  __Pyx_Buffer __pyx_pybuffer_out;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_out_indices;
  __Pyx_Buffer __pyx_pybuffer_out_indices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  __Pyx_Buffer __pyx_pybuffer_x;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xindices;
  __Pyx_Buffer __pyx_pybuffer_xindices;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_y;
  __Pyx_Buffer __pyx_pybuffer_y;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_yindices;
  __Pyx_Buffer __pyx_pybuffer_yindices;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("int_op", 0);
  __pyx_pybuffer_xindices.pybuffer.buf = NULL;
  __pyx_pybuffer_xindices.refcount = 0;
  __pyx_pybuffernd_xindices.data = NULL;
  __pyx_pybuffernd_xindices.rcbuffer = &__pyx_pybuffer_xindices;
  __pyx_pybuffer_yindices.pybuffer.buf = NULL;
  __pyx_pybuffer_yindices.refcount = 0;
  __pyx_pybuffernd_yindices.data = NULL;
  __pyx_pybuffernd_yindices.rcbuffer = &__pyx_pybuffer_yindices;
  __pyx_pybuffer_out_indices.pybuffer.buf = NULL;
  __pyx_pybuffer_out_indices.refcount = 0;
  __pyx_pybuffernd_out_indices.data = NULL;
  __pyx_pybuffernd_out_indices.rcbuffer = &__pyx_pybuffer_out_indices;
  __pyx_pybuffer_x.pybuffer.buf = NULL;
  __pyx_pybuffer_x.refcount = 0;
  __pyx_pybuffernd_x.data = NULL;
  __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  __pyx_pybuffer_y.pybuffer.buf = NULL;
  __pyx_pybuffer_y.refcount = 0;
  __pyx_pybuffernd_y.data = NULL;
  __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y;
  __pyx_pybuffer_out.pybuffer.buf = NULL;
  __pyx_pybuffer_out.refcount = 0;
  __pyx_pybuffernd_out.data = NULL;
  __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out;

  /* "pandas/src/sparse.pyx":851
 *     cdef:
 *         IntIndex out_index
 *         Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices             # <<<<<<<<<<<<<<
 *         int32_t xloc, yloc
 *         ndarray[int32_t, ndim=1] xindices, yindices, out_indices
 */
  __pyx_v_xi = 0;
  __pyx_v_yi = 0;
  __pyx_v_out_i = 0;

  /* "pandas/src/sparse.pyx":858
 * 
 *     # suppress Cython compiler warnings due to inlining
 *     x = x_             # <<<<<<<<<<<<<<
 *     y = y_
 * 
 */
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_x_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      }
    }
    __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_x_));
  __pyx_v_x = ((PyArrayObject *)__pyx_v_x_);

  /* "pandas/src/sparse.pyx":859
 *     # suppress Cython compiler warnings due to inlining
 *     x = x_
 *     y = y_             # <<<<<<<<<<<<<<
 * 
 *     # need to do this first to know size of result array
 */
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_y_), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      }
    }
    __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_y_));
  __pyx_v_y = ((PyArrayObject *)__pyx_v_y_);

  /* "pandas/src/sparse.pyx":862
 * 
 *     # need to do this first to know size of result array
 *     out_index = xindex.make_union(yindex)             # <<<<<<<<<<<<<<
 *     out = np.empty(out_index.npoints, dtype=np.float64)
 * 
 */
  __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex *)__pyx_v_xindex->__pyx_vtab)->make_union(__pyx_v_xindex, ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)__pyx_v_yindex), 0)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_out_index = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":863
 *     # need to do this first to know size of result array
 *     out_index = xindex.make_union(yindex)
 *     out = np.empty(out_index.npoints, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *     xindices = xindex.indices
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_out_index->npoints); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      }
    }
    __pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = 0;
  __pyx_v_out = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":865
 *     out = np.empty(out_index.npoints, dtype=np.float64)
 * 
 *     xindices = xindex.indices             # <<<<<<<<<<<<<<
 *     yindices = yindex.indices
 *     out_indices = out_index.indices
 */
  __pyx_t_9 = ((PyObject *)__pyx_v_xindex->indices);
  __Pyx_INCREF(__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_xindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      }
    }
    __pyx_pybuffernd_xindices.diminfo[0].strides = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xindices.diminfo[0].shape = __pyx_pybuffernd_xindices.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xindices = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":866
 * 
 *     xindices = xindex.indices
 *     yindices = yindex.indices             # <<<<<<<<<<<<<<
 *     out_indices = out_index.indices
 * 
 */
  __pyx_t_9 = ((PyObject *)__pyx_v_yindex->indices);
  __Pyx_INCREF(__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer, (PyObject*)__pyx_v_yindices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_2); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      }
    }
    __pyx_pybuffernd_yindices.diminfo[0].strides = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_yindices.diminfo[0].shape = __pyx_pybuffernd_yindices.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yindices = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":867
 *     xindices = xindex.indices
 *     yindices = yindex.indices
 *     out_indices = out_index.indices             # <<<<<<<<<<<<<<
 * 
 *     # walk the two SparseVectors, adding matched locations...
 */
  __pyx_t_9 = ((PyObject *)__pyx_v_out_index->indices);
  __Pyx_INCREF(__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer);
    __pyx_t_1 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_9), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_1 < 0)) {
      PyErr_Fetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_out_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_2);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      }
    }
    __pyx_pybuffernd_out_indices.diminfo[0].strides = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out_indices.diminfo[0].shape = __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_out_indices = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":870
 * 
 *     # walk the two SparseVectors, adding matched locations...
 *     for out_i from 0 <= out_i < out_index.npoints:             # <<<<<<<<<<<<<<
 *         if xi == xindex.npoints:
 *             # use x fill value
 */
  __pyx_t_11 = __pyx_v_out_index->npoints;
  for (__pyx_v_out_i = 0; __pyx_v_out_i < __pyx_t_11; __pyx_v_out_i++) {

    /* "pandas/src/sparse.pyx":871
 *     # walk the two SparseVectors, adding matched locations...
 *     for out_i from 0 <= out_i < out_index.npoints:
 *         if xi == xindex.npoints:             # <<<<<<<<<<<<<<
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])
 */
    __pyx_t_12 = ((__pyx_v_xi == __pyx_v_xindex->npoints) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/sparse.pyx":873
 *         if xi == xindex.npoints:
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])             # <<<<<<<<<<<<<<
 *             yi += 1
 *             continue
 */
      __pyx_t_13 = __pyx_v_yi;
      if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_y.diminfo[0].shape;
      __pyx_t_14 = __pyx_v_out_i;
      if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_y.diminfo[0].strides)));

      /* "pandas/src/sparse.pyx":874
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])
 *             yi += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_yi = (__pyx_v_yi + 1);

      /* "pandas/src/sparse.pyx":875
 *             out[out_i] = op(xfill, y[yi])
 *             yi += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         if yi == yindex.npoints:
 */
      goto __pyx_L3_continue;

      /* "pandas/src/sparse.pyx":871
 *     # walk the two SparseVectors, adding matched locations...
 *     for out_i from 0 <= out_i < out_index.npoints:
 *         if xi == xindex.npoints:             # <<<<<<<<<<<<<<
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])
 */
    }

    /* "pandas/src/sparse.pyx":877
 *             continue
 * 
 *         if yi == yindex.npoints:             # <<<<<<<<<<<<<<
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 */
    __pyx_t_12 = ((__pyx_v_yi == __pyx_v_yindex->npoints) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/sparse.pyx":879
 *         if yi == yindex.npoints:
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)             # <<<<<<<<<<<<<<
 *             xi += 1
 *             continue
 */
      __pyx_t_15 = __pyx_v_xi;
      if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
      __pyx_t_16 = __pyx_v_out_i;
      if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill);

      /* "pandas/src/sparse.pyx":880
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 *             xi += 1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_v_xi = (__pyx_v_xi + 1);

      /* "pandas/src/sparse.pyx":881
 *             out[out_i] = op(x[xi], yfill)
 *             xi += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         xloc = xindices[xi]
 */
      goto __pyx_L3_continue;

      /* "pandas/src/sparse.pyx":877
 *             continue
 * 
 *         if yi == yindex.npoints:             # <<<<<<<<<<<<<<
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 */
    }

    /* "pandas/src/sparse.pyx":883
 *             continue
 * 
 *         xloc = xindices[xi]             # <<<<<<<<<<<<<<
 *         yloc = yindices[yi]
 * 
 */
    __pyx_t_17 = __pyx_v_xi;
    if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_pybuffernd_xindices.diminfo[0].shape;
    __pyx_v_xloc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_xindices.diminfo[0].strides));

    /* "pandas/src/sparse.pyx":884
 * 
 *         xloc = xindices[xi]
 *         yloc = yindices[yi]             # <<<<<<<<<<<<<<
 * 
 *         # each index in the out_index had to come from either x, y, or both
 */
    __pyx_t_18 = __pyx_v_yi;
    if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_pybuffernd_yindices.diminfo[0].shape;
    __pyx_v_yloc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_yindices.diminfo[0].strides));

    /* "pandas/src/sparse.pyx":887
 * 
 *         # each index in the out_index had to come from either x, y, or both
 *         if xloc == yloc:             # <<<<<<<<<<<<<<
 *             out[out_i] = op(x[xi], y[yi])
 *             xi += 1
 */
    __pyx_t_12 = ((__pyx_v_xloc == __pyx_v_yloc) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/sparse.pyx":888
 *         # each index in the out_index had to come from either x, y, or both
 *         if xloc == yloc:
 *             out[out_i] = op(x[xi], y[yi])             # <<<<<<<<<<<<<<
 *             xi += 1
 *             yi += 1
 */
      __pyx_t_19 = __pyx_v_xi;
      if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_pybuffernd_x.diminfo[0].shape;
      __pyx_t_20 = __pyx_v_yi;
      if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_pybuffernd_y.diminfo[0].shape;
      __pyx_t_21 = __pyx_v_out_i;
      if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_x.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_y.diminfo[0].strides)));

      /* "pandas/src/sparse.pyx":889
 *         if xloc == yloc:
 *             out[out_i] = op(x[xi], y[yi])
 *             xi += 1             # <<<<<<<<<<<<<<
 *             yi += 1
 *         elif xloc < yloc:
 */
      __pyx_v_xi = (__pyx_v_xi + 1);

      /* "pandas/src/sparse.pyx":890
 *             out[out_i] = op(x[xi], y[yi])
 *             xi += 1
 *             yi += 1             # <<<<<<<<<<<<<<
 *         elif xloc < yloc:
 *             # use y fill value
 */
      __pyx_v_yi = (__pyx_v_yi + 1);

      /* "pandas/src/sparse.pyx":887
 * 
 *         # each index in the out_index had to come from either x, y, or both
 *         if xloc == yloc:             # <<<<<<<<<<<<<<
 *             out[out_i] = op(x[xi], y[yi])
 *             xi += 1
 */
      goto __pyx_L7;
    }

    /* "pandas/src/sparse.pyx":891
 *             xi += 1
 *             yi += 1
 *         elif xloc < yloc:             # <<<<<<<<<<<<<<
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 */
    __pyx_t_12 = ((__pyx_v_xloc < __pyx_v_yloc) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/sparse.pyx":893
 *         elif xloc < yloc:
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)             # <<<<<<<<<<<<<<
 *             xi += 1
 *         else:
 */
      __pyx_t_22 = __pyx_v_xi;
      if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_pybuffernd_x.diminfo[0].shape;
      __pyx_t_23 = __pyx_v_out_i;
      if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_x.diminfo[0].strides)), __pyx_v_yfill);

      /* "pandas/src/sparse.pyx":894
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 *             xi += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # use x fill value
 */
      __pyx_v_xi = (__pyx_v_xi + 1);

      /* "pandas/src/sparse.pyx":891
 *             xi += 1
 *             yi += 1
 *         elif xloc < yloc:             # <<<<<<<<<<<<<<
 *             # use y fill value
 *             out[out_i] = op(x[xi], yfill)
 */
      goto __pyx_L7;
    }

    /* "pandas/src/sparse.pyx":897
 *         else:
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])             # <<<<<<<<<<<<<<
 *             yi += 1
 * 
 */
    /*else*/ {
      __pyx_t_24 = __pyx_v_yi;
      if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_pybuffernd_y.diminfo[0].shape;
      __pyx_t_25 = __pyx_v_out_i;
      if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_pybuffernd_out.diminfo[0].shape;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_out.diminfo[0].strides) = __pyx_v_op(__pyx_v_xfill, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_y.diminfo[0].strides)));

      /* "pandas/src/sparse.pyx":898
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])
 *             yi += 1             # <<<<<<<<<<<<<<
 * 
 *     return out, out_index
 */
      __pyx_v_yi = (__pyx_v_yi + 1);
    }
    __pyx_L7:;
    __pyx_L3_continue:;
  }

  /* "pandas/src/sparse.pyx":900
 *             yi += 1
 * 
 *     return out, out_index             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __add(float64_t a, float64_t b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out));
  __Pyx_INCREF(((PyObject *)__pyx_v_out_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index));
  __pyx_r = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":846
 * 
 * @cython.boundscheck(False)
 * cdef inline tuple int_op(ndarray x_, IntIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                          ndarray y_, IntIndex yindex, float64_t yfill,
 *                          double_func op):
 */

  /* function exit code */
  __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);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.int_op", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_out_indices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xindices.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_yindices.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out_index);
  __Pyx_XDECREF((PyObject *)__pyx_v_xindices);
  __Pyx_XDECREF((PyObject *)__pyx_v_yindices);
  __Pyx_XDECREF((PyObject *)__pyx_v_out_indices);
  __Pyx_XDECREF((PyObject *)__pyx_v_x);
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":902
 *     return out, out_index
 * 
 * cdef inline float64_t __add(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a + b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___add(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add", 0);

  /* "pandas/src/sparse.pyx":903
 * 
 * cdef inline float64_t __add(float64_t a, float64_t b):
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __sub(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":902
 *     return out, out_index
 * 
 * cdef inline float64_t __add(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a + b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":905
 *     return a + b
 * 
 * cdef inline float64_t __sub(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a - b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___sub(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub", 0);

  /* "pandas/src/sparse.pyx":906
 * 
 * cdef inline float64_t __sub(float64_t a, float64_t b):
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __rsub(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":905
 *     return a + b
 * 
 * cdef inline float64_t __sub(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a - b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":908
 *     return a - b
 * 
 * cdef inline float64_t __rsub(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return b - a
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rsub(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__rsub", 0);

  /* "pandas/src/sparse.pyx":909
 * 
 * cdef inline float64_t __rsub(float64_t a, float64_t b):
 *     return b - a             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __div(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_b - __pyx_v_a);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":908
 *     return a - b
 * 
 * cdef inline float64_t __rsub(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return b - a
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":911
 *     return b - a
 * 
 * cdef inline float64_t __div(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     if b == 0:
 *         if a > 0:
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___div(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__div", 0);

  /* "pandas/src/sparse.pyx":912
 * 
 * cdef inline float64_t __div(float64_t a, float64_t b):
 *     if b == 0:             # <<<<<<<<<<<<<<
 *         if a > 0:
 *             return INF
 */
  __pyx_t_1 = ((__pyx_v_b == 0.0) != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":913
 * cdef inline float64_t __div(float64_t a, float64_t b):
 *     if b == 0:
 *         if a > 0:             # <<<<<<<<<<<<<<
 *             return INF
 *         elif a < 0:
 */
    __pyx_t_1 = ((__pyx_v_a > 0.0) != 0);
    if (__pyx_t_1) {

      /* "pandas/src/sparse.pyx":914
 *     if b == 0:
 *         if a > 0:
 *             return INF             # <<<<<<<<<<<<<<
 *         elif a < 0:
 *             return -INF
 */
      __pyx_r = __pyx_v_6pandas_7_sparse_INF;
      goto __pyx_L0;

      /* "pandas/src/sparse.pyx":913
 * cdef inline float64_t __div(float64_t a, float64_t b):
 *     if b == 0:
 *         if a > 0:             # <<<<<<<<<<<<<<
 *             return INF
 *         elif a < 0:
 */
    }

    /* "pandas/src/sparse.pyx":915
 *         if a > 0:
 *             return INF
 *         elif a < 0:             # <<<<<<<<<<<<<<
 *             return -INF
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_a < 0.0) != 0);
    if (__pyx_t_1) {

      /* "pandas/src/sparse.pyx":916
 *             return INF
 *         elif a < 0:
 *             return -INF             # <<<<<<<<<<<<<<
 *         else:
 *             return NaN
 */
      __pyx_r = (-__pyx_v_6pandas_7_sparse_INF);
      goto __pyx_L0;

      /* "pandas/src/sparse.pyx":915
 *         if a > 0:
 *             return INF
 *         elif a < 0:             # <<<<<<<<<<<<<<
 *             return -INF
 *         else:
 */
    }

    /* "pandas/src/sparse.pyx":918
 *             return -INF
 *         else:
 *             return NaN             # <<<<<<<<<<<<<<
 *     else:
 *         return a / b
 */
    /*else*/ {
      __pyx_r = __pyx_v_6pandas_7_sparse_NaN;
      goto __pyx_L0;
    }

    /* "pandas/src/sparse.pyx":912
 * 
 * cdef inline float64_t __div(float64_t a, float64_t b):
 *     if b == 0:             # <<<<<<<<<<<<<<
 *         if a > 0:
 *             return INF
 */
  }

  /* "pandas/src/sparse.pyx":920
 *             return NaN
 *     else:
 *         return a / b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __rdiv(float64_t a, float64_t b):
 */
  /*else*/ {
    if (unlikely(__pyx_v_b == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_r = (__pyx_v_a / __pyx_v_b);
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":911
 *     return b - a
 * 
 * cdef inline float64_t __div(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     if b == 0:
 *         if a > 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pandas._sparse.__div", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":922
 *         return a / b
 * 
 * cdef inline float64_t __rdiv(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return __div(b, a)
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rdiv(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__rdiv", 0);

  /* "pandas/src/sparse.pyx":923
 * 
 * cdef inline float64_t __rdiv(float64_t a, float64_t b):
 *     return __div(b, a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __floordiv(float64_t a, float64_t b):
 */
  __pyx_r = __pyx_f_6pandas_7_sparse___div(__pyx_v_b, __pyx_v_a);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":922
 *         return a / b
 * 
 * cdef inline float64_t __rdiv(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return __div(b, a)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":925
 *     return __div(b, a)
 * 
 * cdef inline float64_t __floordiv(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     if b == 0:
 *         # numpy >= 1.11 returns NaN
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___floordiv(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __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("__floordiv", 0);

  /* "pandas/src/sparse.pyx":926
 * 
 * cdef inline float64_t __floordiv(float64_t a, float64_t b):
 *     if b == 0:             # <<<<<<<<<<<<<<
 *         # numpy >= 1.11 returns NaN
 *         # for a // 0, rather than +-inf
 */
  __pyx_t_1 = ((__pyx_v_b == 0.0) != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":929
 *         # numpy >= 1.11 returns NaN
 *         # for a // 0, rather than +-inf
 *         if _np_version_under1p11:             # <<<<<<<<<<<<<<
 *             if a > 0:
 *                 return INF
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version_under1p11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pandas/src/sparse.pyx":930
 *         # for a // 0, rather than +-inf
 *         if _np_version_under1p11:
 *             if a > 0:             # <<<<<<<<<<<<<<
 *                 return INF
 *             elif a < 0:
 */
      __pyx_t_1 = ((__pyx_v_a > 0.0) != 0);
      if (__pyx_t_1) {

        /* "pandas/src/sparse.pyx":931
 *         if _np_version_under1p11:
 *             if a > 0:
 *                 return INF             # <<<<<<<<<<<<<<
 *             elif a < 0:
 *                 return -INF
 */
        __pyx_r = __pyx_v_6pandas_7_sparse_INF;
        goto __pyx_L0;

        /* "pandas/src/sparse.pyx":930
 *         # for a // 0, rather than +-inf
 *         if _np_version_under1p11:
 *             if a > 0:             # <<<<<<<<<<<<<<
 *                 return INF
 *             elif a < 0:
 */
      }

      /* "pandas/src/sparse.pyx":932
 *             if a > 0:
 *                 return INF
 *             elif a < 0:             # <<<<<<<<<<<<<<
 *                 return -INF
 *         return NaN
 */
      __pyx_t_1 = ((__pyx_v_a < 0.0) != 0);
      if (__pyx_t_1) {

        /* "pandas/src/sparse.pyx":933
 *                 return INF
 *             elif a < 0:
 *                 return -INF             # <<<<<<<<<<<<<<
 *         return NaN
 *     else:
 */
        __pyx_r = (-__pyx_v_6pandas_7_sparse_INF);
        goto __pyx_L0;

        /* "pandas/src/sparse.pyx":932
 *             if a > 0:
 *                 return INF
 *             elif a < 0:             # <<<<<<<<<<<<<<
 *                 return -INF
 *         return NaN
 */
      }

      /* "pandas/src/sparse.pyx":929
 *         # numpy >= 1.11 returns NaN
 *         # for a // 0, rather than +-inf
 *         if _np_version_under1p11:             # <<<<<<<<<<<<<<
 *             if a > 0:
 *                 return INF
 */
    }

    /* "pandas/src/sparse.pyx":934
 *             elif a < 0:
 *                 return -INF
 *         return NaN             # <<<<<<<<<<<<<<
 *     else:
 *         return a // b
 */
    __pyx_r = __pyx_v_6pandas_7_sparse_NaN;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":926
 * 
 * cdef inline float64_t __floordiv(float64_t a, float64_t b):
 *     if b == 0:             # <<<<<<<<<<<<<<
 *         # numpy >= 1.11 returns NaN
 *         # for a // 0, rather than +-inf
 */
  }

  /* "pandas/src/sparse.pyx":936
 *         return NaN
 *     else:
 *         return a // b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __rfloordiv(float64_t a, float64_t b):
 */
  /*else*/ {
    if (unlikely(__pyx_v_b == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_r = floor(__pyx_v_a / __pyx_v_b);
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":925
 *     return __div(b, a)
 * 
 * cdef inline float64_t __floordiv(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     if b == 0:
 *         # numpy >= 1.11 returns NaN
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas._sparse.__floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":938
 *         return a // b
 * 
 * cdef inline float64_t __rfloordiv(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return __floordiv(b, a)
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rfloordiv(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__rfloordiv", 0);

  /* "pandas/src/sparse.pyx":939
 * 
 * cdef inline float64_t __rfloordiv(float64_t a, float64_t b):
 *     return __floordiv(b, a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __mul(float64_t a, float64_t b):
 */
  __pyx_r = __pyx_f_6pandas_7_sparse___floordiv(__pyx_v_b, __pyx_v_a);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":938
 *         return a // b
 * 
 * cdef inline float64_t __rfloordiv(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return __floordiv(b, a)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":941
 *     return __floordiv(b, a)
 * 
 * cdef inline float64_t __mul(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a * b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___mul(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul", 0);

  /* "pandas/src/sparse.pyx":942
 * 
 * cdef inline float64_t __mul(float64_t a, float64_t b):
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __eq(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":941
 *     return __floordiv(b, a)
 * 
 * cdef inline float64_t __mul(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a * b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":944
 *     return a * b
 * 
 * cdef inline float64_t __eq(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a == b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___eq(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq", 0);

  /* "pandas/src/sparse.pyx":945
 * 
 * cdef inline float64_t __eq(float64_t a, float64_t b):
 *     return a == b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __ne(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a == __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":944
 *     return a * b
 * 
 * cdef inline float64_t __eq(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a == b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":947
 *     return a == b
 * 
 * cdef inline float64_t __ne(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a != b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___ne(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne", 0);

  /* "pandas/src/sparse.pyx":948
 * 
 * cdef inline float64_t __ne(float64_t a, float64_t b):
 *     return a != b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __lt(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a != __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":947
 *     return a == b
 * 
 * cdef inline float64_t __ne(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a != b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":950
 *     return a != b
 * 
 * cdef inline float64_t __lt(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a < b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___lt(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__lt", 0);

  /* "pandas/src/sparse.pyx":951
 * 
 * cdef inline float64_t __lt(float64_t a, float64_t b):
 *     return a < b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __gt(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a < __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":950
 *     return a != b
 * 
 * cdef inline float64_t __lt(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a < b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":953
 *     return a < b
 * 
 * cdef inline float64_t __gt(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a > b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___gt(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__gt", 0);

  /* "pandas/src/sparse.pyx":954
 * 
 * cdef inline float64_t __gt(float64_t a, float64_t b):
 *     return a > b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __le(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a > __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":953
 *     return a < b
 * 
 * cdef inline float64_t __gt(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a > b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":956
 *     return a > b
 * 
 * cdef inline float64_t __le(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a <= b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___le(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__le", 0);

  /* "pandas/src/sparse.pyx":957
 * 
 * cdef inline float64_t __le(float64_t a, float64_t b):
 *     return a <= b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __ge(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a <= __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":956
 *     return a > b
 * 
 * cdef inline float64_t __le(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a <= b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":959
 *     return a <= b
 * 
 * cdef inline float64_t __ge(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a >= b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___ge(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ge", 0);

  /* "pandas/src/sparse.pyx":960
 * 
 * cdef inline float64_t __ge(float64_t a, float64_t b):
 *     return a >= b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __mod(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a >= __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":959
 *     return a <= b
 * 
 * cdef inline float64_t __ge(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a >= b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":962
 *     return a >= b
 * 
 * cdef inline float64_t __mod(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     if b == 0:
 *         return NaN
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___mod(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__mod", 0);

  /* "pandas/src/sparse.pyx":963
 * 
 * cdef inline float64_t __mod(float64_t a, float64_t b):
 *     if b == 0:             # <<<<<<<<<<<<<<
 *         return NaN
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_b == 0.0) != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":964
 * cdef inline float64_t __mod(float64_t a, float64_t b):
 *     if b == 0:
 *         return NaN             # <<<<<<<<<<<<<<
 *     else:
 *         return a % b
 */
    __pyx_r = __pyx_v_6pandas_7_sparse_NaN;
    goto __pyx_L0;

    /* "pandas/src/sparse.pyx":963
 * 
 * cdef inline float64_t __mod(float64_t a, float64_t b):
 *     if b == 0:             # <<<<<<<<<<<<<<
 *         return NaN
 *     else:
 */
  }

  /* "pandas/src/sparse.pyx":966
 *         return NaN
 *     else:
 *         return a % b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __rmod(float64_t a, float64_t b):
 */
  /*else*/ {
    if (unlikely(__pyx_v_b == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float divmod()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_r = __Pyx_mod___pyx_t_5numpy_float64_t(__pyx_v_a, __pyx_v_b);
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":962
 *     return a >= b
 * 
 * cdef inline float64_t __mod(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     if b == 0:
 *         return NaN
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pandas._sparse.__mod", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":968
 *         return a % b
 * 
 * cdef inline float64_t __rmod(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return __mod(b, a)
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rmod(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__rmod", 0);

  /* "pandas/src/sparse.pyx":969
 * 
 * cdef inline float64_t __rmod(float64_t a, float64_t b):
 *     return __mod(b, a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __pow(float64_t a, float64_t b):
 */
  __pyx_r = __pyx_f_6pandas_7_sparse___mod(__pyx_v_b, __pyx_v_a);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":968
 *         return a % b
 * 
 * cdef inline float64_t __rmod(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return __mod(b, a)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":971
 *     return __mod(b, a)
 * 
 * cdef inline float64_t __pow(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a ** b
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___pow(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pow", 0);

  /* "pandas/src/sparse.pyx":972
 * 
 * cdef inline float64_t __pow(float64_t a, float64_t b):
 *     return a ** b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __rpow(float64_t a, float64_t b):
 */
  __pyx_r = pow(__pyx_v_a, __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":971
 *     return __mod(b, a)
 * 
 * cdef inline float64_t __pow(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return a ** b
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":974
 *     return a ** b
 * 
 * cdef inline float64_t __rpow(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return __pow(b, a)
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_7_sparse___rpow(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__rpow", 0);

  /* "pandas/src/sparse.pyx":975
 * 
 * cdef inline float64_t __rpow(float64_t a, float64_t b):
 *     return __pow(b, a)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_6pandas_7_sparse___pow(__pyx_v_b, __pyx_v_a);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":974
 *     return a ** b
 * 
 * cdef inline float64_t __rpow(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     return __pow(b, a)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":981
 * # TODO: quantify performance boost to "templating"
 * 
 * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_add(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_add", 0);

  /* "pandas/src/sparse.pyx":983
 * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill,
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                              y, yindex, yfill, __add)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":984
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                              y, yindex, yfill, __add)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":981
 * # TODO: quantify performance boost to "templating"
 * 
 * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_add", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_2sparse_add(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_2sparse_add(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_add(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":986
 *                              y, yindex, yfill, __add)
 * 
 * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_sub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_sub", 0);

  /* "pandas/src/sparse.pyx":988
 * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill,
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                              y, yindex, yfill, __sub)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":989
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                              y, yindex, yfill, __sub)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":986
 *                              y, yindex, yfill, __add)
 * 
 * cpdef sparse_sub(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_sub (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_sub", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_4sparse_sub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_4sparse_sub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_sub(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":991
 *                              y, yindex, yfill, __sub)
 * 
 * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rsub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_rsub", 0);

  /* "pandas/src/sparse.pyx":993
 * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill,
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                              y, yindex, yfill, __rsub)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":994
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                              y, yindex, yfill, __rsub)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rsub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":991
 *                              y, yindex, yfill, __sub)
 * 
 * cpdef sparse_rsub(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_rsub (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rsub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_rsub", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_6sparse_rsub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_6sparse_rsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_rsub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rsub(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":996
 *                              y, yindex, yfill, __rsub)
 * 
 * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_mul(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_mul", 0);

  /* "pandas/src/sparse.pyx":998
 * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill,
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                              y, yindex, yfill, __mul)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":999
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                              y, yindex, yfill, __mul)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___mul); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":996
 *                              y, yindex, yfill, __rsub)
 * 
 * cpdef sparse_mul(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_mul (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_mul", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8sparse_mul(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_8sparse_mul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_mul(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1001
 *                              y, yindex, yfill, __mul)
 * 
 * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_div(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_div", 0);

  /* "pandas/src/sparse.pyx":1003
 * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill,
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                              y, yindex, yfill, __div)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1004
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                              y, yindex, yfill, __div)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1001
 *                              y, yindex, yfill, __mul)
 * 
 * cpdef sparse_div(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_div (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_div", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10sparse_div(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_10sparse_div(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_div(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1006
 *                              y, yindex, yfill, __div)
 * 
 * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rdiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_rdiv", 0);

  /* "pandas/src/sparse.pyx":1008
 * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill,
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                              y, yindex, yfill, __rdiv)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1009
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                              y, yindex, yfill, __rdiv)             # <<<<<<<<<<<<<<
 * 
 * sparse_truediv = sparse_div
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1006
 *                              y, yindex, yfill, __div)
 * 
 * cpdef sparse_rdiv(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_rdiv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rdiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_rdiv", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_12sparse_rdiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_12sparse_rdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_rdiv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rdiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1014
 * sparse_rtruediv = sparse_rdiv
 * 
 * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                       ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_floordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_floordiv", 0);

  /* "pandas/src/sparse.pyx":1016
 * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill,
 *                       ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __floordiv)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1017
 *                       ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __floordiv)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___floordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1014
 * sparse_rtruediv = sparse_rdiv
 * 
 * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                       ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_floordiv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_floordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_floordiv", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_14sparse_floordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_14sparse_floordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_floordiv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_floordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1019
 *                           y, yindex, yfill, __floordiv)
 * 
 * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                        ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rfloordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_rfloordiv", 0);

  /* "pandas/src/sparse.pyx":1021
 * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill,
 *                        ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __rfloordiv)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1022
 *                        ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __rfloordiv)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_mod(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rfloordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1019
 *                           y, yindex, yfill, __floordiv)
 * 
 * cpdef sparse_rfloordiv(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                        ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_rfloordiv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rfloordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_rfloordiv", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_rfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_16sparse_rfloordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_16sparse_rfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_rfloordiv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rfloordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1024
 *                           y, yindex, yfill, __rfloordiv)
 * 
 * cpdef sparse_mod(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_mod(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_mod", 0);

  /* "pandas/src/sparse.pyx":1026
 * cpdef sparse_mod(ndarray x, SparseIndex xindex, float64_t xfill,
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __mod)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1027
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __mod)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_rmod(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___mod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1024
 *                           y, yindex, yfill, __rfloordiv)
 * 
 * cpdef sparse_mod(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_mod (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mod", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mod", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mod", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mod", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_mod", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_mod", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_18sparse_mod(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_18sparse_mod(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_mod", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_mod(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1029
 *                           y, yindex, yfill, __mod)
 * 
 * cpdef sparse_rmod(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_rmod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rmod(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_rmod", 0);

  /* "pandas/src/sparse.pyx":1031
 * cpdef sparse_rmod(ndarray x, SparseIndex xindex, float64_t xfill,
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __rmod)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1032
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __rmod)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rmod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1029
 *                           y, yindex, yfill, __mod)
 * 
 * cpdef sparse_rmod(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_rmod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_rmod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_rmod (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rmod", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rmod", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rmod", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rmod", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rmod", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rmod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_rmod", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_rmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_20sparse_rmod(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_20sparse_rmod(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_rmod", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rmod(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1034
 *                           y, yindex, yfill, __rmod)
 * 
 * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_pow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_pow", 0);

  /* "pandas/src/sparse.pyx":1036
 * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill,
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __pow)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1037
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __pow)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___pow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1034
 *                           y, yindex, yfill, __rmod)
 * 
 * cpdef sparse_pow(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_pow (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_pow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_pow", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_22sparse_pow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_22sparse_pow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_pow", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_pow(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_pow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1039
 *                           y, yindex, yfill, __pow)
 * 
 * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_rpow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_rpow", 0);

  /* "pandas/src/sparse.pyx":1041
 * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill,
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __rpow)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1042
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __rpow)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_eq(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___rpow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1039
 *                           y, yindex, yfill, __pow)
 * 
 * cpdef sparse_rpow(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rpow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_rpow (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_rpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_rpow", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_rpow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_24sparse_rpow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_24sparse_rpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_rpow", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_rpow(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_rpow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1044
 *                           y, yindex, yfill, __rpow)
 * 
 * cpdef sparse_eq(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_eq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_eq(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_eq", 0);

  /* "pandas/src/sparse.pyx":1046
 * cpdef sparse_eq(ndarray x, SparseIndex xindex, float64_t xfill,
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __eq)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1047
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __eq)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_ne(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___eq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1044
 *                           y, yindex, yfill, __rpow)
 * 
 * cpdef sparse_eq(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_eq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_eq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_eq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_eq (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_eq", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_eq", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_eq", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_eq", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_eq", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_eq") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_eq", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_eq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_26sparse_eq(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_26sparse_eq(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_eq", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_eq(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_eq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1049
 *                           y, yindex, yfill, __eq)
 * 
 * cpdef sparse_ne(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_ne(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_ne(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_ne", 0);

  /* "pandas/src/sparse.pyx":1051
 * cpdef sparse_ne(ndarray x, SparseIndex xindex, float64_t xfill,
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __ne)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1052
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __ne)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_lt(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___ne); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1049
 *                           y, yindex, yfill, __eq)
 * 
 * cpdef sparse_ne(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_ne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_ne(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_ne(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_ne (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ne", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ne", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ne", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ne", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ne", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_ne") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_ne", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_ne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_28sparse_ne(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_28sparse_ne(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_ne", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_ne(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_ne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1054
 *                           y, yindex, yfill, __ne)
 * 
 * cpdef sparse_lt(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_lt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_lt(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_lt", 0);

  /* "pandas/src/sparse.pyx":1056
 * cpdef sparse_lt(ndarray x, SparseIndex xindex, float64_t xfill,
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __lt)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1057
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __lt)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_gt(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___lt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1054
 *                           y, yindex, yfill, __ne)
 * 
 * cpdef sparse_lt(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_lt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_lt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_lt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_lt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_lt", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_lt", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_lt", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_lt", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_lt", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_lt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_lt", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_lt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_30sparse_lt(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_30sparse_lt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_lt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_lt(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_lt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1059
 *                           y, yindex, yfill, __lt)
 * 
 * cpdef sparse_gt(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_gt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_gt(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_gt", 0);

  /* "pandas/src/sparse.pyx":1061
 * cpdef sparse_gt(ndarray x, SparseIndex xindex, float64_t xfill,
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __gt)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1062
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __gt)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_le(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___gt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1059
 *                           y, yindex, yfill, __lt)
 * 
 * cpdef sparse_gt(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                   ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_gt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_gt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_gt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_gt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_gt", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_gt", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_gt", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_gt", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_gt", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_gt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_gt", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_gt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_32sparse_gt(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_32sparse_gt(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_gt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_gt(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_gt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1064
 *                           y, yindex, yfill, __gt)
 * 
 * cpdef sparse_le(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                 ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_le(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_le(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_le", 0);

  /* "pandas/src/sparse.pyx":1066
 * cpdef sparse_le(ndarray x, SparseIndex xindex, float64_t xfill,
 *                 ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __le)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1067
 *                 ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __le)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_ge(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___le); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1064
 *                           y, yindex, yfill, __gt)
 * 
 * cpdef sparse_le(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                 ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_le", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_le(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_le(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_le (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_le", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_le", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_le", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_le", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_le", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_le") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_le", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_le", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_34sparse_le(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_34sparse_le(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_le", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_le(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_le", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1069
 *                           y, yindex, yfill, __le)
 * 
 * cpdef sparse_ge(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                 ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_ge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_ge(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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("sparse_ge", 0);

  /* "pandas/src/sparse.pyx":1071
 * cpdef sparse_ge(ndarray x, SparseIndex xindex, float64_t xfill,
 *                 ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,             # <<<<<<<<<<<<<<
 *                           y, yindex, yfill, __ge)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pandas/src/sparse.pyx":1072
 *                 ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                           y, yindex, yfill, __ge)             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_combine(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, __pyx_f_6pandas_7_sparse___ge); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1069
 *                           y, yindex, yfill, __le)
 * 
 * cpdef sparse_ge(ndarray x, SparseIndex xindex, float64_t xfill,             # <<<<<<<<<<<<<<
 *                 ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_ge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_ge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_ge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_x = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_xfill;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  __pyx_t_5numpy_float64_t __pyx_v_yfill;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_ge (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_xfill,&__pyx_n_s_y,&__pyx_n_s_yindex,&__pyx_n_s_yfill,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ge", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ge", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ge", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ge", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yfill)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_ge", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparse_ge") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_xfill = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y = ((PyArrayObject *)values[3]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[4]);
    __pyx_v_yfill = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_yfill == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_ge", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_ge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "xindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yindex), __pyx_ptype_6pandas_7_sparse_SparseIndex, 1, "yindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_36sparse_ge(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_36sparse_ge(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, __pyx_t_5numpy_float64_t __pyx_v_xfill, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, __pyx_t_5numpy_float64_t __pyx_v_yfill) {
  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("sparse_ge", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_ge(__pyx_v_x, __pyx_v_xindex, __pyx_v_xfill, __pyx_v_y, __pyx_v_yindex, __pyx_v_yfill, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_ge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1077
 * # Indexing operations
 * 
 * def get_reindexer(ndarray[object, ndim=1] values, dict index_map):             # <<<<<<<<<<<<<<
 *     cdef object idx
 *     cdef Py_ssize_t i
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_39get_reindexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_7_sparse_39get_reindexer = {"get_reindexer", (PyCFunction)__pyx_pw_6pandas_7_sparse_39get_reindexer, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_7_sparse_39get_reindexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_index_map = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_reindexer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_index_map,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_map)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_reindexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reindexer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_index_map = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_reindexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.get_reindexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index_map), (&PyDict_Type), 1, "index_map", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_38get_reindexer(__pyx_self, __pyx_v_values, __pyx_v_index_map);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_38get_reindexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_index_map) {
  PyObject *__pyx_v_idx = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_new_length;
  PyArrayObject *__pyx_v_indexer = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  __pyx_t_5numpy_int32_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_reindexer", 0);
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];

  /* "pandas/src/sparse.pyx":1080
 *     cdef object idx
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t new_length = len(values)             # <<<<<<<<<<<<<<
 *     cdef ndarray[int32_t, ndim=1] indexer
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_new_length = __pyx_t_1;

  /* "pandas/src/sparse.pyx":1083
 *     cdef ndarray[int32_t, ndim=1] indexer
 * 
 *     indexer = np.empty(new_length, dtype=np.int32)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(new_length):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_new_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/sparse.pyx":1085
 *     indexer = np.empty(new_length, dtype=np.int32)
 * 
 *     for i in range(new_length):             # <<<<<<<<<<<<<<
 *         idx = values[i]
 *         if idx in index_map:
 */
  __pyx_t_1 = __pyx_v_new_length;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/sparse.pyx":1086
 * 
 *     for i in range(new_length):
 *         idx = values[i]             # <<<<<<<<<<<<<<
 *         if idx in index_map:
 *             indexer[i] = index_map[idx]
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_pybuffernd_values.diminfo[0].shape;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_values.diminfo[0].shape)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = (PyObject *) *__Pyx_BufPtrStrided1d(PyObject **, __pyx_pybuffernd_values.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_values.diminfo[0].strides);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pandas/src/sparse.pyx":1087
 *     for i in range(new_length):
 *         idx = values[i]
 *         if idx in index_map:             # <<<<<<<<<<<<<<
 *             indexer[i] = index_map[idx]
 *         else:
 */
    if (unlikely(__pyx_v_index_map == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = (__Pyx_PyDict_ContainsTF(__pyx_v_idx, __pyx_v_index_map, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = (__pyx_t_14 != 0);
    if (__pyx_t_15) {

      /* "pandas/src/sparse.pyx":1088
 *         idx = values[i]
 *         if idx in index_map:
 *             indexer[i] = index_map[idx]             # <<<<<<<<<<<<<<
 *         else:
 *             indexer[i] = -1
 */
      if (unlikely(__pyx_v_index_map == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_index_map, __pyx_v_idx); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_6); if (unlikely((__pyx_t_16 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_pybuffernd_indexer.diminfo[0].shape;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_indexer.diminfo[0].strides) = __pyx_t_16;

      /* "pandas/src/sparse.pyx":1087
 *     for i in range(new_length):
 *         idx = values[i]
 *         if idx in index_map:             # <<<<<<<<<<<<<<
 *             indexer[i] = index_map[idx]
 *         else:
 */
      goto __pyx_L5;
    }

    /* "pandas/src/sparse.pyx":1090
 *             indexer[i] = index_map[idx]
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
    /*else*/ {
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_pybuffernd_indexer.diminfo[0].shape;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_indexer.diminfo[0].shape)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_indexer.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_indexer.diminfo[0].strides) = -1;
    }
    __pyx_L5:;
  }

  /* "pandas/src/sparse.pyx":1092
 *             indexer[i] = -1
 * 
 *     return indexer             # <<<<<<<<<<<<<<
 * 
 * # def reindex_block(ndarray[float64_t, ndim=1] values,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  __pyx_r = ((PyObject *)__pyx_v_indexer);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1077
 * # Indexing operations
 * 
 * def get_reindexer(ndarray[object, ndim=1] values, dict index_map):             # <<<<<<<<<<<<<<
 *     cdef object idx
 *     cdef Py_ssize_t i
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.get_reindexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1124
 * 
 * 
 * def reindex_integer(ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                     IntIndex sparse_index,
 *                     ndarray[int32_t, ndim=1] indexer):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7_sparse_41reindex_integer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_7_sparse_41reindex_integer = {"reindex_integer", (PyCFunction)__pyx_pw_6pandas_7_sparse_41reindex_integer, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_7_sparse_41reindex_integer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyArrayObject *__pyx_v_values = 0;
  CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_sparse_index = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_indexer = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reindex_integer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_sparse_index,&__pyx_n_s_indexer,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sparse_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reindex_integer", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indexer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reindex_integer", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reindex_integer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_sparse_index = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)values[1]);
    __pyx_v_indexer = ((PyArrayObject *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reindex_integer", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.reindex_integer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sparse_index), __pyx_ptype_6pandas_7_sparse_IntIndex, 1, "sparse_index", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_40reindex_integer(__pyx_self, __pyx_v_values, __pyx_v_sparse_index, __pyx_v_indexer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_7_sparse_40reindex_integer(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_values, CYTHON_UNUSED struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_sparse_index, CYTHON_UNUSED PyArrayObject *__pyx_v_indexer) {
  __Pyx_LocalBuf_ND __pyx_pybuffernd_indexer;
  __Pyx_Buffer __pyx_pybuffer_indexer;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reindex_integer", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_indexer.pybuffer.buf = NULL;
  __pyx_pybuffer_indexer.refcount = 0;
  __pyx_pybuffernd_indexer.data = NULL;
  __pyx_pybuffernd_indexer.rcbuffer = &__pyx_pybuffer_indexer;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_indexer.diminfo[0].strides = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indexer.diminfo[0].shape = __pyx_pybuffernd_indexer.rcbuffer->pybuffer.shape[0];

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas._sparse.reindex_integer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_indexer.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":196
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "numpy.pxd":202
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "numpy.pxd":205
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":206
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":208
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "numpy.pxd":210
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":211
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;

    /* "numpy.pxd":210
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
    goto __pyx_L4;
  }

  /* "numpy.pxd":213
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
  /*else*/ {
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "numpy.pxd":215
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "numpy.pxd":216
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;

  /* "numpy.pxd":215
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  if (__pyx_t_1) {

    /* "numpy.pxd":217
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "numpy.pxd":215
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  }

  /* "numpy.pxd":219
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "numpy.pxd":220
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;

  /* "numpy.pxd":219
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  if (__pyx_t_1) {

    /* "numpy.pxd":221
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "numpy.pxd":219
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  }

  /* "numpy.pxd":223
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "numpy.pxd":224
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "numpy.pxd":225
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  __pyx_t_1 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":228
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "numpy.pxd":229
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "numpy.pxd":230
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_4 = __pyx_v_ndim;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "numpy.pxd":231
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "numpy.pxd":232
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }

    /* "numpy.pxd":225
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
    goto __pyx_L11;
  }

  /* "numpy.pxd":234
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
  /*else*/ {
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "numpy.pxd":235
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L11:;

  /* "numpy.pxd":236
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "numpy.pxd":237
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "numpy.pxd":238
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "numpy.pxd":241
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "numpy.pxd":242
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "numpy.pxd":246
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "numpy.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "numpy.pxd":250
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;

    /* "numpy.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
    goto __pyx_L14;
  }

  /* "numpy.pxd":253
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
  /*else*/ {
    __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);
  }
  __pyx_L14:;

  /* "numpy.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 */
  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":256
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 */
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "numpy.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L20_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_L20_next_or:;

    /* "numpy.pxd":258
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;

    /* "numpy.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_1) {

      /* "numpy.pxd":259
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "numpy.pxd":257
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "numpy.pxd":260
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    switch (__pyx_v_t) {
      case NPY_BYTE:
      __pyx_v_f = __pyx_k_b;
      break;

      /* "numpy.pxd":261
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
      case NPY_UBYTE:
      __pyx_v_f = __pyx_k_B;
      break;

      /* "numpy.pxd":262
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
      case NPY_SHORT:
      __pyx_v_f = __pyx_k_h;
      break;

      /* "numpy.pxd":263
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
      case NPY_USHORT:
      __pyx_v_f = __pyx_k_H;
      break;

      /* "numpy.pxd":264
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
      case NPY_INT:
      __pyx_v_f = __pyx_k_i;
      break;

      /* "numpy.pxd":265
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
      case NPY_UINT:
      __pyx_v_f = __pyx_k_I;
      break;

      /* "numpy.pxd":266
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
      case NPY_LONG:
      __pyx_v_f = __pyx_k_l;
      break;

      /* "numpy.pxd":267
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
      case NPY_ULONG:
      __pyx_v_f = __pyx_k_L;
      break;

      /* "numpy.pxd":268
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
      case NPY_LONGLONG:
      __pyx_v_f = __pyx_k_q;
      break;

      /* "numpy.pxd":269
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
      case NPY_ULONGLONG:
      __pyx_v_f = __pyx_k_Q;
      break;

      /* "numpy.pxd":270
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
      case NPY_FLOAT:
      __pyx_v_f = __pyx_k_f;
      break;

      /* "numpy.pxd":271
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
      case NPY_DOUBLE:
      __pyx_v_f = __pyx_k_d;
      break;

      /* "numpy.pxd":272
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
      case NPY_LONGDOUBLE:
      __pyx_v_f = __pyx_k_g;
      break;

      /* "numpy.pxd":273
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
      case NPY_CFLOAT:
      __pyx_v_f = __pyx_k_Zf;
      break;

      /* "numpy.pxd":274
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
      case NPY_CDOUBLE:
      __pyx_v_f = __pyx_k_Zd;
      break;

      /* "numpy.pxd":275
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
      case NPY_CLONGDOUBLE:
      __pyx_v_f = __pyx_k_Zg;
      break;

      /* "numpy.pxd":276
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      case NPY_OBJECT:
      __pyx_v_f = __pyx_k_O;
      break;
      default:

      /* "numpy.pxd":278
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }

    /* "numpy.pxd":279
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "numpy.pxd":280
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "numpy.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 */
  }

  /* "numpy.pxd":282
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0
 */
  /*else*/ {
    __pyx_v_info->format = ((char *)malloc(0xFF));

    /* "numpy.pxd":283
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "numpy.pxd":284
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "numpy.pxd":285
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_7;

    /* "numpy.pxd":288
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = 0;
  }

  /* "numpy.pxd":196
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":290
 *                 f[0] = 0 # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "numpy.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":292
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);

    /* "numpy.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  }

  /* "numpy.pxd":293
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":294
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);

    /* "numpy.pxd":293
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  }

  /* "numpy.pxd":290
 *                 f[0] = 0 # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":772
 * ctypedef npy_cdouble     complex_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);

  /* "numpy.pxd":773
 * 
 * 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_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "numpy.pxd":772
 * ctypedef npy_cdouble     complex_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;
}

/* "numpy.pxd":775
 *     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);

  /* "numpy.pxd":776
 * 
 * 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_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "numpy.pxd":775
 *     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;
}

/* "numpy.pxd":778
 *     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);

  /* "numpy.pxd":779
 * 
 * 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_filename = __pyx_f[1]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "numpy.pxd":778
 *     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;
}

/* "numpy.pxd":781
 *     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);

  /* "numpy.pxd":782
 * 
 * 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_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "numpy.pxd":781
 *     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;
}

/* "numpy.pxd":784
 *     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);

  /* "numpy.pxd":785
 * 
 * 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 char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "numpy.pxd":784
 *     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;
}

/* "numpy.pxd":787
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "numpy.pxd":794
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":795
 *     cdef tuple i
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":798
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "numpy.pxd":799
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "numpy.pxd":800
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 */
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __pyx_v_fields;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "numpy.pxd":802
 *         child, new_offset = fields
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "numpy.pxd":803
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "numpy.pxd":802
 *         child, new_offset = fields
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    }

    /* "numpy.pxd":805
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "numpy.pxd":806
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;

    /* "numpy.pxd":805
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    if (__pyx_t_6) {

      /* "numpy.pxd":807
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "numpy.pxd":805
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    }

    /* "numpy.pxd":817
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_6) break;

      /* "numpy.pxd":818
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 0x78;

      /* "numpy.pxd":819
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "numpy.pxd":820
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "numpy.pxd":822
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "numpy.pxd":824
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "numpy.pxd":825
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "numpy.pxd":826
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (__pyx_t_6) {

        /* "numpy.pxd":827
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "numpy.pxd":826
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      }

      /* "numpy.pxd":830
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "numpy.pxd":831
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_5 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "numpy.pxd":832
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x68;
        goto __pyx_L15;
      }

      /* "numpy.pxd":833
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_5 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "numpy.pxd":834
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x69;
        goto __pyx_L15;
      }

      /* "numpy.pxd":835
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_5 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "numpy.pxd":836
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x6C;
        goto __pyx_L15;
      }

      /* "numpy.pxd":837
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_5 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "numpy.pxd":838
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x71;
        goto __pyx_L15;
      }

      /* "numpy.pxd":839
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_5 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "numpy.pxd":840
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x66;
        goto __pyx_L15;
      }

      /* "numpy.pxd":841
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_5 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x64;
        goto __pyx_L15;
      }

      /* "numpy.pxd":842
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x67;
        goto __pyx_L15;
      }

      /* "numpy.pxd":843
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_5 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x66;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "numpy.pxd":844
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x64;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "numpy.pxd":845
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_5 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x67;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "numpy.pxd":846
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }

      /* "numpy.pxd":848
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
      /*else*/ {
        __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L15:;

      /* "numpy.pxd":849
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "numpy.pxd":824
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
      goto __pyx_L13;
    }

    /* "numpy.pxd":853
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
    /*else*/ {
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "numpy.pxd":798
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "numpy.pxd":854
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "numpy.pxd":787
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":970
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "numpy.pxd":972
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "numpy.pxd":973
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;

    /* "numpy.pxd":972
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
    goto __pyx_L3;
  }

  /* "numpy.pxd":975
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
  /*else*/ {
    Py_INCREF(__pyx_v_base);

    /* "numpy.pxd":976
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "numpy.pxd":977
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "numpy.pxd":978
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  /* "numpy.pxd":970
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":980
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "numpy.pxd":981
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  if (__pyx_t_1) {

    /* "numpy.pxd":982
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "numpy.pxd":981
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  }

  /* "numpy.pxd":984
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }

  /* "numpy.pxd":980
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_6pandas_7_sparse_SparseIndex(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6pandas_7_sparse_SparseIndex[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pandas_7_sparse_SparseIndex = {
  PyVarObject_HEAD_INIT(0, 0)
  "pandas._sparse.SparseIndex", /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_7_sparse_SparseIndex), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Abstract superclass for sparse index types\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_7_sparse_SparseIndex, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6pandas_7_sparse_11SparseIndex_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_7_sparse_SparseIndex, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_7_sparse_IntIndex __pyx_vtable_6pandas_7_sparse_IntIndex;

static PyObject *__pyx_tp_new_6pandas_7_sparse_IntIndex(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_7_sparse_IntIndex *p;
  PyObject *o = __pyx_tp_new_6pandas_7_sparse_SparseIndex(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_7_sparse_IntIndex;
  p->indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_7_sparse_IntIndex(PyObject *o) {
  struct __pyx_obj_6pandas_7_sparse_IntIndex *p = (struct __pyx_obj_6pandas_7_sparse_IntIndex *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->indices);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex(o);
}

static int __pyx_tp_traverse_6pandas_7_sparse_IntIndex(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_7_sparse_IntIndex *p = (struct __pyx_obj_6pandas_7_sparse_IntIndex *)o;
  e = ((likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) ? ((__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse) ? __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6pandas_7_sparse_IntIndex)); if (e) return e;
  if (p->indices) {
    e = (*v)(((PyObject*)p->indices), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_7_sparse_IntIndex(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pandas_7_sparse_IntIndex *p = (struct __pyx_obj_6pandas_7_sparse_IntIndex *)o;
  if (likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) { if (__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear) __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6pandas_7_sparse_IntIndex);
  tmp = ((PyObject*)p->indices);
  p->indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_7_sparse_8IntIndex_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_7_sparse_8IntIndex_6length_1__get__(o);
}

static PyObject *__pyx_getprop_6pandas_7_sparse_8IntIndex_npoints(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_7_sparse_8IntIndex_7npoints_1__get__(o);
}

static PyObject *__pyx_getprop_6pandas_7_sparse_8IntIndex_indices(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_7_sparse_8IntIndex_7indices_1__get__(o);
}

static PyMethodDef __pyx_methods_6pandas_7_sparse_IntIndex[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_3__reduce__, METH_NOARGS, 0},
  {"check_integrity", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_7check_integrity, METH_NOARGS, __pyx_doc_6pandas_7_sparse_8IntIndex_6check_integrity},
  {"equals", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_9equals, METH_O, 0},
  {"ngaps", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_11ngaps, METH_NOARGS, 0},
  {"to_int_index", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_13to_int_index, METH_NOARGS, 0},
  {"to_block_index", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_15to_block_index, METH_NOARGS, 0},
  {"intersect", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_17intersect, METH_O, 0},
  {"make_union", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_19make_union, METH_O, 0},
  {"lookup", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup, METH_O, __pyx_doc_6pandas_7_sparse_8IntIndex_20lookup},
  {"lookup_array", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_23lookup_array, METH_O, __pyx_doc_6pandas_7_sparse_8IntIndex_22lookup_array},
  {"reindex", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_25reindex, METH_VARARGS|METH_KEYWORDS, 0},
  {"put", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_27put, METH_VARARGS|METH_KEYWORDS, 0},
  {"take", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_29take, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_7_sparse_IntIndex[] = {
  {(char *)"length", __pyx_getprop_6pandas_7_sparse_8IntIndex_length, 0, 0, 0},
  {(char *)"npoints", __pyx_getprop_6pandas_7_sparse_8IntIndex_npoints, 0, 0, 0},
  {(char *)"indices", __pyx_getprop_6pandas_7_sparse_8IntIndex_indices, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pandas_7_sparse_IntIndex = {
  PyVarObject_HEAD_INIT(0, 0)
  "pandas._sparse.IntIndex", /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_7_sparse_IntIndex), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_7_sparse_IntIndex, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pandas_7_sparse_8IntIndex_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Object for holding exact integer sparse indexing information\n\n    Parameters\n    ----------\n    length : integer\n    indices : array-like\n        Contains integers corresponding to\n    ", /*tp_doc*/
  __pyx_tp_traverse_6pandas_7_sparse_IntIndex, /*tp_traverse*/
  __pyx_tp_clear_6pandas_7_sparse_IntIndex, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_7_sparse_IntIndex, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_7_sparse_IntIndex, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6pandas_7_sparse_8IntIndex_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_7_sparse_IntIndex, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIndex __pyx_vtable_6pandas_7_sparse_BlockIndex;

static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIndex(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *p;
  PyObject *o = __pyx_tp_new_6pandas_7_sparse_SparseIndex(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_7_sparse_BlockIndex;
  p->blocs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->blengths = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_7_sparse_BlockIndex(PyObject *o) {
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *p = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  Py_CLEAR(p->blocs);
  Py_CLEAR(p->blengths);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6pandas_7_sparse_SparseIndex(o);
}

static int __pyx_tp_traverse_6pandas_7_sparse_BlockIndex(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *p = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o;
  e = ((likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) ? ((__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse) ? __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6pandas_7_sparse_BlockIndex)); if (e) return e;
  if (p->blocs) {
    e = (*v)(((PyObject*)p->blocs), a); if (e) return e;
  }
  if (p->blengths) {
    e = (*v)(((PyObject*)p->blengths), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_7_sparse_BlockIndex(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pandas_7_sparse_BlockIndex *p = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *)o;
  if (likely(__pyx_ptype_6pandas_7_sparse_SparseIndex)) { if (__pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear) __pyx_ptype_6pandas_7_sparse_SparseIndex->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6pandas_7_sparse_BlockIndex);
  tmp = ((PyObject*)p->blocs);
  p->blocs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->blengths);
  p->blengths = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_nblocks(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_7_sparse_10BlockIndex_7nblocks_1__get__(o);
}

static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_npoints(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_7_sparse_10BlockIndex_7npoints_1__get__(o);
}

static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_7_sparse_10BlockIndex_6length_1__get__(o);
}

static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_blocs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_7_sparse_10BlockIndex_5blocs_1__get__(o);
}

static PyObject *__pyx_getprop_6pandas_7_sparse_10BlockIndex_blengths(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6pandas_7_sparse_10BlockIndex_8blengths_1__get__(o);
}

static PyMethodDef __pyx_methods_6pandas_7_sparse_BlockIndex[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_3__reduce__, METH_NOARGS, 0},
  {"ngaps", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_7ngaps, METH_NOARGS, 0},
  {"check_integrity", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_9check_integrity, METH_NOARGS, __pyx_doc_6pandas_7_sparse_10BlockIndex_8check_integrity},
  {"equals", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_11equals, METH_O, 0},
  {"to_block_index", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_13to_block_index, METH_NOARGS, 0},
  {"to_int_index", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_15to_int_index, METH_NOARGS, 0},
  {"intersect", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_17intersect, METH_O, __pyx_doc_6pandas_7_sparse_10BlockIndex_16intersect},
  {"make_union", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_19make_union, METH_O, __pyx_doc_6pandas_7_sparse_10BlockIndex_18make_union},
  {"lookup", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup, METH_O, __pyx_doc_6pandas_7_sparse_10BlockIndex_20lookup},
  {"lookup_array", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_23lookup_array, METH_O, __pyx_doc_6pandas_7_sparse_10BlockIndex_22lookup_array},
  {"reindex", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_25reindex, METH_VARARGS|METH_KEYWORDS, 0},
  {"put", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_27put, METH_VARARGS|METH_KEYWORDS, 0},
  {"take", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_29take, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_7_sparse_BlockIndex[] = {
  {(char *)"nblocks", __pyx_getprop_6pandas_7_sparse_10BlockIndex_nblocks, 0, 0, 0},
  {(char *)"npoints", __pyx_getprop_6pandas_7_sparse_10BlockIndex_npoints, 0, 0, 0},
  {(char *)"length", __pyx_getprop_6pandas_7_sparse_10BlockIndex_length, 0, 0, 0},
  {(char *)"blocs", __pyx_getprop_6pandas_7_sparse_10BlockIndex_blocs, 0, 0, 0},
  {(char *)"blengths", __pyx_getprop_6pandas_7_sparse_10BlockIndex_blengths, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pandas_7_sparse_BlockIndex = {
  PyVarObject_HEAD_INIT(0, 0)
  "pandas._sparse.BlockIndex", /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_7_sparse_BlockIndex), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_7_sparse_BlockIndex, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6pandas_7_sparse_10BlockIndex_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Object for holding block-based sparse indexing information\n\n    Parameters\n    ----------\n    ", /*tp_doc*/
  __pyx_tp_traverse_6pandas_7_sparse_BlockIndex, /*tp_traverse*/
  __pyx_tp_clear_6pandas_7_sparse_BlockIndex, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_7_sparse_BlockIndex, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_7_sparse_BlockIndex, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6pandas_7_sparse_10BlockIndex_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_7_sparse_BlockIndex, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge __pyx_vtable_6pandas_7_sparse_BlockMerge;

static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockMerge(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6pandas_7_sparse_BlockMerge *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_7_sparse_BlockMerge;
  p->x = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None);
  p->y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None);
  p->result = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None);
  p->xstart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->xlen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->xend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->ystart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->ylen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->yend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge(PyObject *o) {
  struct __pyx_obj_6pandas_7_sparse_BlockMerge *p = (struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->x);
  Py_CLEAR(p->y);
  Py_CLEAR(p->result);
  Py_CLEAR(p->xstart);
  Py_CLEAR(p->xlen);
  Py_CLEAR(p->xend);
  Py_CLEAR(p->ystart);
  Py_CLEAR(p->ylen);
  Py_CLEAR(p->yend);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_7_sparse_BlockMerge(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_7_sparse_BlockMerge *p = (struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o;
  if (p->x) {
    e = (*v)(((PyObject*)p->x), a); if (e) return e;
  }
  if (p->y) {
    e = (*v)(((PyObject*)p->y), a); if (e) return e;
  }
  if (p->result) {
    e = (*v)(((PyObject*)p->result), a); if (e) return e;
  }
  if (p->xstart) {
    e = (*v)(((PyObject*)p->xstart), a); if (e) return e;
  }
  if (p->xlen) {
    e = (*v)(((PyObject*)p->xlen), a); if (e) return e;
  }
  if (p->xend) {
    e = (*v)(((PyObject*)p->xend), a); if (e) return e;
  }
  if (p->ystart) {
    e = (*v)(((PyObject*)p->ystart), a); if (e) return e;
  }
  if (p->ylen) {
    e = (*v)(((PyObject*)p->ylen), a); if (e) return e;
  }
  if (p->yend) {
    e = (*v)(((PyObject*)p->yend), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_7_sparse_BlockMerge(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6pandas_7_sparse_BlockMerge *p = (struct __pyx_obj_6pandas_7_sparse_BlockMerge *)o;
  tmp = ((PyObject*)p->x);
  p->x = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->y);
  p->y = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->result);
  p->result = ((struct __pyx_obj_6pandas_7_sparse_BlockIndex *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->xstart);
  p->xstart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->xlen);
  p->xlen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->xend);
  p->xend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->ystart);
  p->ystart = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->ylen);
  p->ylen = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->yend);
  p->yend = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6pandas_7_sparse_BlockMerge[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6pandas_7_sparse_BlockMerge = {
  PyVarObject_HEAD_INIT(0, 0)
  "pandas._sparse.BlockMerge", /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_7_sparse_BlockMerge), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Object-oriented approach makes sharing state between recursive functions a\n    lot easier and reduces code duplication\n    ", /*tp_doc*/
  __pyx_tp_traverse_6pandas_7_sparse_BlockMerge, /*tp_traverse*/
  __pyx_tp_clear_6pandas_7_sparse_BlockMerge, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_7_sparse_BlockMerge, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_7_sparse_BlockMerge, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_7_sparse_BlockIntersection __pyx_vtable_6pandas_7_sparse_BlockIntersection;

static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockIntersection(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_7_sparse_BlockIntersection *p;
  PyObject *o = __pyx_tp_new_6pandas_7_sparse_BlockMerge(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pandas_7_sparse_BlockIntersection *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge*)__pyx_vtabptr_6pandas_7_sparse_BlockIntersection;
  return o;
}

static PyTypeObject __pyx_type_6pandas_7_sparse_BlockIntersection = {
  PyVarObject_HEAD_INIT(0, 0)
  "pandas._sparse.BlockIntersection", /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_7_sparse_BlockIntersection), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    not done yet\n    ", /*tp_doc*/
  __pyx_tp_traverse_6pandas_7_sparse_BlockMerge, /*tp_traverse*/
  __pyx_tp_clear_6pandas_7_sparse_BlockMerge, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_7_sparse_BlockIntersection, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_7_sparse_BlockUnion __pyx_vtable_6pandas_7_sparse_BlockUnion;

static PyObject *__pyx_tp_new_6pandas_7_sparse_BlockUnion(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_7_sparse_BlockUnion *p;
  PyObject *o = __pyx_tp_new_6pandas_7_sparse_BlockMerge(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6pandas_7_sparse_BlockUnion *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_7_sparse_BlockMerge*)__pyx_vtabptr_6pandas_7_sparse_BlockUnion;
  return o;
}

static PyTypeObject __pyx_type_6pandas_7_sparse_BlockUnion = {
  PyVarObject_HEAD_INIT(0, 0)
  "pandas._sparse.BlockUnion", /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_7_sparse_BlockUnion), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_7_sparse_BlockMerge, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Object-oriented approach makes sharing state between recursive functions a\n    lot easier and reduces code duplication\n    ", /*tp_doc*/
  __pyx_tp_traverse_6pandas_7_sparse_BlockMerge, /*tp_traverse*/
  __pyx_tp_clear_6pandas_7_sparse_BlockMerge, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6pandas_7_sparse_10BlockMerge_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_7_sparse_BlockUnion, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"get_blocks", (PyCFunction)__pyx_pw_6pandas_7_sparse_1get_blocks, METH_O, 0},
  {"sparse_add", (PyCFunction)__pyx_pw_6pandas_7_sparse_3sparse_add, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_sub", (PyCFunction)__pyx_pw_6pandas_7_sparse_5sparse_sub, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_rsub", (PyCFunction)__pyx_pw_6pandas_7_sparse_7sparse_rsub, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_mul", (PyCFunction)__pyx_pw_6pandas_7_sparse_9sparse_mul, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_div", (PyCFunction)__pyx_pw_6pandas_7_sparse_11sparse_div, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_rdiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_13sparse_rdiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_floordiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_15sparse_floordiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_rfloordiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_17sparse_rfloordiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_mod", (PyCFunction)__pyx_pw_6pandas_7_sparse_19sparse_mod, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_rmod", (PyCFunction)__pyx_pw_6pandas_7_sparse_21sparse_rmod, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_pow", (PyCFunction)__pyx_pw_6pandas_7_sparse_23sparse_pow, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_rpow", (PyCFunction)__pyx_pw_6pandas_7_sparse_25sparse_rpow, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_eq", (PyCFunction)__pyx_pw_6pandas_7_sparse_27sparse_eq, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_ne", (PyCFunction)__pyx_pw_6pandas_7_sparse_29sparse_ne, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_lt", (PyCFunction)__pyx_pw_6pandas_7_sparse_31sparse_lt, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_gt", (PyCFunction)__pyx_pw_6pandas_7_sparse_33sparse_gt, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_le", (PyCFunction)__pyx_pw_6pandas_7_sparse_35sparse_le, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_ge", (PyCFunction)__pyx_pw_6pandas_7_sparse_37sparse_ge, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "_sparse",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1_10, __pyx_k_1_10, sizeof(__pyx_k_1_10), 0, 0, 1, 0},
  {&__pyx_kp_s_1_11, __pyx_k_1_11, sizeof(__pyx_k_1_11), 0, 0, 1, 0},
  {&__pyx_kp_s_1_8, __pyx_k_1_8, sizeof(__pyx_k_1_8), 0, 0, 1, 0},
  {&__pyx_kp_s_1_9, __pyx_k_1_9, sizeof(__pyx_k_1_9), 0, 0, 1, 0},
  {&__pyx_n_s_BlockIndex, __pyx_k_BlockIndex, sizeof(__pyx_k_BlockIndex), 0, 0, 1, 1},
  {&__pyx_kp_s_Block_d_extends_beyond_end, __pyx_k_Block_d_extends_beyond_end, sizeof(__pyx_k_Block_d_extends_beyond_end), 0, 0, 1, 0},
  {&__pyx_kp_s_Block_d_overlaps, __pyx_k_Block_d_overlaps, sizeof(__pyx_k_Block_d_overlaps), 0, 0, 1, 0},
  {&__pyx_kp_s_Block_lengths_s, __pyx_k_Block_lengths_s, sizeof(__pyx_k_Block_lengths_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Block_locations_s, __pyx_k_Block_locations_s, sizeof(__pyx_k_Block_locations_s), 0, 0, 1, 0},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  {&__pyx_kp_s_Indices_must_reference_same_unde, __pyx_k_Indices_must_reference_same_unde, sizeof(__pyx_k_Indices_must_reference_same_unde), 0, 0, 1, 0},
  {&__pyx_kp_s_Indices_s, __pyx_k_Indices_s, sizeof(__pyx_k_Indices_s), 0, 0, 1, 0},
  {&__pyx_n_s_IntIndex, __pyx_k_IntIndex, sizeof(__pyx_k_IntIndex), 0, 0, 1, 1},
  {&__pyx_kp_s_Locations_not_in_ascending_order, __pyx_k_Locations_not_in_ascending_order, sizeof(__pyx_k_Locations_not_in_ascending_order), 0, 0, 1, 0},
  {&__pyx_n_s_LooseVersion, __pyx_k_LooseVersion, sizeof(__pyx_k_LooseVersion), 0, 0, 1, 1},
  {&__pyx_kp_s_Mode_must_be_0_or_1, __pyx_k_Mode_must_be_0_or_1, sizeof(__pyx_k_Mode_must_be_0_or_1), 0, 0, 1, 0},
  {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1},
  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s_Zero_length_block_d, __pyx_k_Zero_length_block_d, sizeof(__pyx_k_Zero_length_block_d), 0, 0, 1, 0},
  {&__pyx_n_s_array_equal, __pyx_k_array_equal, sizeof(__pyx_k_array_equal), 0, 0, 1, 1},
  {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1},
  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
  {&__pyx_n_s_blengths, __pyx_k_blengths, sizeof(__pyx_k_blengths), 0, 0, 1, 1},
  {&__pyx_kp_s_block_bound_arrays_must_be_same, __pyx_k_block_bound_arrays_must_be_same, sizeof(__pyx_k_block_bound_arrays_must_be_same), 0, 0, 1, 0},
  {&__pyx_n_s_blocs, __pyx_k_blocs, sizeof(__pyx_k_blocs), 0, 0, 1, 1},
  {&__pyx_n_s_check_integrity, __pyx_k_check_integrity, sizeof(__pyx_k_check_integrity), 0, 0, 1, 1},
  {&__pyx_n_s_distutils_version, __pyx_k_distutils_version, sizeof(__pyx_k_distutils_version), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
  {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1},
  {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_s_get_reindexer, __pyx_k_get_reindexer, sizeof(__pyx_k_get_reindexer), 0, 0, 1, 1},
  {&__pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_k_home_yoh_deb_gits_pkg_exppsy_pa, sizeof(__pyx_k_home_yoh_deb_gits_pkg_exppsy_pa), 0, 0, 1, 0},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index_map, __pyx_k_index_map, sizeof(__pyx_k_index_map), 0, 0, 1, 1},
  {&__pyx_n_s_indexer, __pyx_k_indexer, sizeof(__pyx_k_indexer), 0, 0, 1, 1},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_s_intersect, __pyx_k_intersect, sizeof(__pyx_k_intersect), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1},
  {&__pyx_n_s_lookup_array, __pyx_k_lookup_array, sizeof(__pyx_k_lookup_array), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_make_union, __pyx_k_make_union, sizeof(__pyx_k_make_union), 0, 0, 1, 1},
  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  {&__pyx_n_s_new_length, __pyx_k_new_length, sizeof(__pyx_k_new_length), 0, 0, 1, 1},
  {&__pyx_n_s_ngaps, __pyx_k_ngaps, sizeof(__pyx_k_ngaps), 0, 0, 1, 1},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_np_version, __pyx_k_np_version, sizeof(__pyx_k_np_version), 0, 0, 1, 1},
  {&__pyx_n_s_np_version_under1p10, __pyx_k_np_version_under1p10, sizeof(__pyx_k_np_version_under1p10), 0, 0, 1, 1},
  {&__pyx_n_s_np_version_under1p11, __pyx_k_np_version_under1p11, sizeof(__pyx_k_np_version_under1p11), 0, 0, 1, 1},
  {&__pyx_n_s_np_version_under1p8, __pyx_k_np_version_under1p8, sizeof(__pyx_k_np_version_under1p8), 0, 0, 1, 1},
  {&__pyx_n_s_np_version_under1p9, __pyx_k_np_version_under1p9, sizeof(__pyx_k_np_version_under1p9), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_pandas__sparse, __pyx_k_pandas__sparse, sizeof(__pyx_k_pandas__sparse), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_reindex, __pyx_k_reindex, sizeof(__pyx_k_reindex), 0, 0, 1, 1},
  {&__pyx_n_s_reindex_integer, __pyx_k_reindex_integer, sizeof(__pyx_k_reindex_integer), 0, 0, 1, 1},
  {&__pyx_n_s_searchsorted, __pyx_k_searchsorted, sizeof(__pyx_k_searchsorted), 0, 0, 1, 1},
  {&__pyx_n_s_short_version, __pyx_k_short_version, sizeof(__pyx_k_short_version), 0, 0, 1, 1},
  {&__pyx_n_s_sparse_div, __pyx_k_sparse_div, sizeof(__pyx_k_sparse_div), 0, 0, 1, 1},
  {&__pyx_n_s_sparse_index, __pyx_k_sparse_index, sizeof(__pyx_k_sparse_index), 0, 0, 1, 1},
  {&__pyx_n_s_sparse_rdiv, __pyx_k_sparse_rdiv, sizeof(__pyx_k_sparse_rdiv), 0, 0, 1, 1},
  {&__pyx_n_s_sparse_rtruediv, __pyx_k_sparse_rtruediv, sizeof(__pyx_k_sparse_rtruediv), 0, 0, 1, 1},
  {&__pyx_n_s_sparse_truediv, __pyx_k_sparse_truediv, sizeof(__pyx_k_sparse_truediv), 0, 0, 1, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_to_block_index, __pyx_k_to_block_index, sizeof(__pyx_k_to_block_index), 0, 0, 1, 1},
  {&__pyx_n_s_to_int_index, __pyx_k_to_int_index, sizeof(__pyx_k_to_int_index), 0, 0, 1, 1},
  {&__pyx_n_s_to_put, __pyx_k_to_put, sizeof(__pyx_k_to_put), 0, 0, 1, 1},
  {&__pyx_n_s_union1d, __pyx_k_union1d, sizeof(__pyx_k_union1d), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xfill, __pyx_k_xfill, sizeof(__pyx_k_xfill), 0, 0, 1, 1},
  {&__pyx_n_s_xindex, __pyx_k_xindex, sizeof(__pyx_k_xindex), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_yfill, __pyx_k_yfill, sizeof(__pyx_k_yfill), 0, 0, 1, 1},
  {&__pyx_n_s_yindex, __pyx_k_yindex, sizeof(__pyx_k_yindex), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pandas/src/sparse.pyx":111
 * 
 *         if self.length != y.length:
 *             raise Exception('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         xindices = self.indices
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "pandas/src/sparse.pyx":141
 * 
 *         if self.length != y.length:
 *             raise ValueError('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         new_indices = np.union1d(self.indices, y.indices)
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "pandas/src/sparse.pyx":185
 *         n = len(indexer)
 *         results = np.empty(n, dtype=np.int32)
 *         results.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *         if self.npoints == 0:
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "pandas/src/sparse.pyx":338
 * 
 *         if len(blocs) != len(blengths):
 *             raise ValueError('block bound arrays must be same length')             # <<<<<<<<<<<<<<
 * 
 *         for i from 0 <= i < self.nblocks:
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_block_bound_arrays_must_be_same); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "pandas/src/sparse.pyx":343
 *             if i > 0:
 *                 if blocs[i] <= blocs[i-1]:
 *                     raise ValueError('Locations not in ascending order')             # <<<<<<<<<<<<<<
 * 
 *             if i < self.nblocks - 1:
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Locations_not_in_ascending_order); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "pandas/src/sparse.pyx":412
 * 
 *         if self.length != y.length:
 *             raise Exception('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         xloc = self.blocs
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "pandas/src/sparse.pyx":525
 *         n = len(indexer)
 *         results = np.empty(n, dtype=np.int32)
 *         results.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *         if self.npoints == 0:
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "pandas/src/sparse.pyx":588
 * 
 *         if x.length != y.length:
 *             raise Exception('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         self.xstart = self.x.blocs
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "pandas/src/sparse.pyx":678
 * 
 *         if mode != 0 and mode != 1:
 *             raise Exception('Mode must be 0 or 1')             # <<<<<<<<<<<<<<
 * 
 *         # so symmetric code will work
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Mode_must_be_0_or_1); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "numpy.pxd":217
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "numpy.pxd":221
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "numpy.pxd":259
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "numpy.pxd":803
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "numpy.pxd":807
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "numpy.pxd":827
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pandas/src/sparse.pyx":1077
 * # Indexing operations
 * 
 * def get_reindexer(ndarray[object, ndim=1] values, dict index_map):             # <<<<<<<<<<<<<<
 *     cdef object idx
 *     cdef Py_ssize_t i
 */
  __pyx_tuple__16 = PyTuple_Pack(6, __pyx_n_s_values, __pyx_n_s_index_map, __pyx_n_s_idx, __pyx_n_s_i, __pyx_n_s_new_length, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_get_reindexer, 1077, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/sparse.pyx":1124
 * 
 * 
 * def reindex_integer(ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                     IntIndex sparse_index,
 *                     ndarray[int32_t, ndim=1] indexer):
 */
  __pyx_tuple__18 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_sparse_index, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_yoh_deb_gits_pkg_exppsy_pa, __pyx_n_s_reindex_integer, 1124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_sparse(void); /*proto*/
PyMODINIT_FUNC init_sparse(void)
#else
PyMODINIT_FUNC PyInit__sparse(void); /*proto*/
PyMODINIT_FUNC PyInit__sparse(void)
#endif
{
  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;
  __pyx_t_5numpy_float64_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__sparse(void)", 0);
  if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_sparse", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_pandas___sparse) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "pandas._sparse")) {
      if (unlikely(PyDict_SetItemString(modules, "pandas._sparse", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_6pandas_7_sparse_SparseIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6pandas_7_sparse_SparseIndex.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "SparseIndex", (PyObject *)&__pyx_type_6pandas_7_sparse_SparseIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_7_sparse_SparseIndex = &__pyx_type_6pandas_7_sparse_SparseIndex;
  __pyx_vtabptr_6pandas_7_sparse_IntIndex = &__pyx_vtable_6pandas_7_sparse_IntIndex;
  __pyx_vtable_6pandas_7_sparse_IntIndex.intersect = (struct __pyx_obj_6pandas_7_sparse_IntIndex *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_intersect;
  __pyx_vtable_6pandas_7_sparse_IntIndex.make_union = (struct __pyx_obj_6pandas_7_sparse_IntIndex *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_make_union;
  __pyx_vtable_6pandas_7_sparse_IntIndex.lookup = (int (*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_lookup;
  __pyx_vtable_6pandas_7_sparse_IntIndex.lookup_array = (PyArrayObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_lookup_array;
  __pyx_vtable_6pandas_7_sparse_IntIndex.reindex = (PyArrayObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_reindex;
  __pyx_vtable_6pandas_7_sparse_IntIndex.put = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_put;
  __pyx_vtable_6pandas_7_sparse_IntIndex.take = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_8IntIndex_take;
  __pyx_type_6pandas_7_sparse_IntIndex.tp_base = __pyx_ptype_6pandas_7_sparse_SparseIndex;
  if (PyType_Ready(&__pyx_type_6pandas_7_sparse_IntIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6pandas_7_sparse_IntIndex.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_IntIndex.tp_dict, __pyx_vtabptr_6pandas_7_sparse_IntIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "IntIndex", (PyObject *)&__pyx_type_6pandas_7_sparse_IntIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_7_sparse_IntIndex = &__pyx_type_6pandas_7_sparse_IntIndex;
  __pyx_vtabptr_6pandas_7_sparse_BlockIndex = &__pyx_vtable_6pandas_7_sparse_BlockIndex;
  __pyx_vtable_6pandas_7_sparse_BlockIndex.check_integrity = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_check_integrity;
  __pyx_vtable_6pandas_7_sparse_BlockIndex.intersect = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_intersect;
  __pyx_vtable_6pandas_7_sparse_BlockIndex.make_union = (struct __pyx_obj_6pandas_7_sparse_BlockIndex *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_make_union;
  __pyx_vtable_6pandas_7_sparse_BlockIndex.lookup = (int (*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_lookup;
  __pyx_vtable_6pandas_7_sparse_BlockIndex.lookup_array = (PyArrayObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_lookup_array;
  __pyx_vtable_6pandas_7_sparse_BlockIndex.reindex = (PyArrayObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, __pyx_t_5numpy_float64_t, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_reindex;
  __pyx_vtable_6pandas_7_sparse_BlockIndex.put = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_put;
  __pyx_vtable_6pandas_7_sparse_BlockIndex.take = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_7_sparse_10BlockIndex_take;
  __pyx_type_6pandas_7_sparse_BlockIndex.tp_base = __pyx_ptype_6pandas_7_sparse_SparseIndex;
  if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6pandas_7_sparse_BlockIndex.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockIndex.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "BlockIndex", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_type_6pandas_7_sparse_BlockIndex.tp_weaklistoffset == 0) __pyx_type_6pandas_7_sparse_BlockIndex.tp_weaklistoffset = offsetof(struct __pyx_obj_6pandas_7_sparse_BlockIndex, __weakref__);
  __pyx_ptype_6pandas_7_sparse_BlockIndex = &__pyx_type_6pandas_7_sparse_BlockIndex;
  __pyx_vtabptr_6pandas_7_sparse_BlockMerge = &__pyx_vtable_6pandas_7_sparse_BlockMerge;
  __pyx_vtable_6pandas_7_sparse_BlockMerge._make_merged_blocks = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *))__pyx_f_6pandas_7_sparse_10BlockMerge__make_merged_blocks;
  __pyx_vtable_6pandas_7_sparse_BlockMerge._set_current_indices = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t, int))__pyx_f_6pandas_7_sparse_10BlockMerge__set_current_indices;
  if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockMerge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6pandas_7_sparse_BlockMerge.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockMerge.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockMerge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "BlockMerge", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockMerge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_7_sparse_BlockMerge = &__pyx_type_6pandas_7_sparse_BlockMerge;
  __pyx_vtabptr_6pandas_7_sparse_BlockIntersection = &__pyx_vtable_6pandas_7_sparse_BlockIntersection;
  __pyx_vtable_6pandas_7_sparse_BlockIntersection.__pyx_base = *__pyx_vtabptr_6pandas_7_sparse_BlockMerge;
  __pyx_type_6pandas_7_sparse_BlockIntersection.tp_base = __pyx_ptype_6pandas_7_sparse_BlockMerge;
  if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockIntersection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6pandas_7_sparse_BlockIntersection.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockIntersection.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockIntersection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "BlockIntersection", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockIntersection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_7_sparse_BlockIntersection = &__pyx_type_6pandas_7_sparse_BlockIntersection;
  __pyx_vtabptr_6pandas_7_sparse_BlockUnion = &__pyx_vtable_6pandas_7_sparse_BlockUnion;
  __pyx_vtable_6pandas_7_sparse_BlockUnion.__pyx_base = *__pyx_vtabptr_6pandas_7_sparse_BlockMerge;
  __pyx_vtable_6pandas_7_sparse_BlockUnion.__pyx_base._make_merged_blocks = (PyObject *(*)(struct __pyx_obj_6pandas_7_sparse_BlockMerge *))__pyx_f_6pandas_7_sparse_10BlockUnion__make_merged_blocks;
  __pyx_vtable_6pandas_7_sparse_BlockUnion._find_next_block_end = (__pyx_t_5numpy_int32_t (*)(struct __pyx_obj_6pandas_7_sparse_BlockUnion *, int))__pyx_f_6pandas_7_sparse_10BlockUnion__find_next_block_end;
  __pyx_type_6pandas_7_sparse_BlockUnion.tp_base = __pyx_ptype_6pandas_7_sparse_BlockMerge;
  if (PyType_Ready(&__pyx_type_6pandas_7_sparse_BlockUnion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6pandas_7_sparse_BlockUnion.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_6pandas_7_sparse_BlockUnion.tp_dict, __pyx_vtabptr_6pandas_7_sparse_BlockUnion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "BlockUnion", (PyObject *)&__pyx_type_6pandas_7_sparse_BlockUnion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_7_sparse_BlockUnion = &__pyx_type_6pandas_7_sparse_BlockUnion;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

  /* "pandas/src/sparse.pyx":6
 * cimport cython
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * import operator
 * import sys
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":7
 * 
 * import numpy as np
 * import operator             # <<<<<<<<<<<<<<
 * import sys
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":8
 * import numpy as np
 * import operator
 * import sys             # <<<<<<<<<<<<<<
 * 
 * from distutils.version import LooseVersion
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":10
 * import sys
 * 
 * from distutils.version import LooseVersion             # <<<<<<<<<<<<<<
 * 
 * # numpy versioning
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_LooseVersion);
  __Pyx_GIVEREF(__pyx_n_s_LooseVersion);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_LooseVersion);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_distutils_version, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LooseVersion, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":13
 * 
 * # numpy versioning
 * _np_version = np.version.short_version             # <<<<<<<<<<<<<<
 * _np_version_under1p8 = LooseVersion(_np_version) < '1.8'
 * _np_version_under1p9 = LooseVersion(_np_version) < '1.9'
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_short_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":14
 * # numpy versioning
 * _np_version = np.version.short_version
 * _np_version_under1p8 = LooseVersion(_np_version) < '1.8'             # <<<<<<<<<<<<<<
 * _np_version_under1p9 = LooseVersion(_np_version) < '1.9'
 * _np_version_under1p10 = LooseVersion(_np_version) < '1.10'
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_s_1_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version_under1p8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":15
 * _np_version = np.version.short_version
 * _np_version_under1p8 = LooseVersion(_np_version) < '1.8'
 * _np_version_under1p9 = LooseVersion(_np_version) < '1.9'             # <<<<<<<<<<<<<<
 * _np_version_under1p10 = LooseVersion(_np_version) < '1.10'
 * _np_version_under1p11 = LooseVersion(_np_version) < '1.11'
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_kp_s_1_9, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version_under1p9, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":16
 * _np_version_under1p8 = LooseVersion(_np_version) < '1.8'
 * _np_version_under1p9 = LooseVersion(_np_version) < '1.9'
 * _np_version_under1p10 = LooseVersion(_np_version) < '1.10'             # <<<<<<<<<<<<<<
 * _np_version_under1p11 = LooseVersion(_np_version) < '1.11'
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_kp_s_1_10, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version_under1p10, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":17
 * _np_version_under1p9 = LooseVersion(_np_version) < '1.9'
 * _np_version_under1p10 = LooseVersion(_np_version) < '1.10'
 * _np_version_under1p11 = LooseVersion(_np_version) < '1.11'             # <<<<<<<<<<<<<<
 * 
 * np.import_array()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_kp_s_1_11, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np_version_under1p11, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":19
 * _np_version_under1p11 = LooseVersion(_np_version) < '1.11'
 * 
 * np.import_array()             # <<<<<<<<<<<<<<
 * np.import_ufunc()
 * 
 */
  import_array();

  /* "pandas/src/sparse.pyx":20
 * 
 * np.import_array()
 * np.import_ufunc()             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  import_ufunc();

  /* "pandas/src/sparse.pyx":25
 * # Preamble stuff
 * 
 * cdef float64_t NaN = <float64_t> np.NaN             # <<<<<<<<<<<<<<
 * cdef float64_t INF = <float64_t> np.inf
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_7_sparse_NaN = ((__pyx_t_5numpy_float64_t)__pyx_t_6);

  /* "pandas/src/sparse.pyx":26
 * 
 * cdef float64_t NaN = <float64_t> np.NaN
 * cdef float64_t INF = <float64_t> np.inf             # <<<<<<<<<<<<<<
 * 
 * cdef inline int int_max(int a, int b): return a if a >= b else b
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_7_sparse_INF = ((__pyx_t_5numpy_float64_t)__pyx_t_6);

  /* "pandas/src/sparse.pyx":89
 * 
 *     @property
 *     def ngaps(self):             # <<<<<<<<<<<<<<
 *         return self.length - self.npoints
 * 
 */
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex, __pyx_n_s_ngaps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "pandas/src/sparse.pyx":88
 *         return same_length and same_indices
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ngaps(self):
 *         return self.length - self.npoints
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex->tp_dict, __pyx_n_s_ngaps, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6pandas_7_sparse_IntIndex);

  /* "pandas/src/sparse.pyx":320
 * 
 *     @property
 *     def ngaps(self):             # <<<<<<<<<<<<<<
 *         return self.length - self.npoints
 * 
 */
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex, __pyx_n_s_ngaps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "pandas/src/sparse.pyx":319
 *         return output
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ngaps(self):
 *         return self.length - self.npoints
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex->tp_dict, __pyx_n_s_ngaps, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6pandas_7_sparse_BlockIndex);

  /* "pandas/src/sparse.pyx":1011
 *                              y, yindex, yfill, __rdiv)
 * 
 * sparse_truediv = sparse_div             # <<<<<<<<<<<<<<
 * sparse_rtruediv = sparse_rdiv
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_div); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_truediv, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":1012
 * 
 * sparse_truediv = sparse_div
 * sparse_rtruediv = sparse_rdiv             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_rdiv); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_rtruediv, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":1077
 * # Indexing operations
 * 
 * def get_reindexer(ndarray[object, ndim=1] values, dict index_map):             # <<<<<<<<<<<<<<
 *     cdef object idx
 *     cdef Py_ssize_t i
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7_sparse_39get_reindexer, NULL, __pyx_n_s_pandas__sparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reindexer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":1124
 * 
 * 
 * def reindex_integer(ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                     IntIndex sparse_index,
 *                     ndarray[int32_t, ndim=1] indexer):
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7_sparse_41reindex_integer, NULL, __pyx_n_s_pandas__sparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reindex_integer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":1
 * from numpy cimport ndarray, uint8_t, int32_t, float64_t             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "numpy.pxd":980
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __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);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init pandas._sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pandas._sparse");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

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)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t < '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static CYTHON_INLINE PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number;
    int ndim = ctx->head->field->type->ndim;
;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
      case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}
static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#endif
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

static CYTHON_INLINE __pyx_t_5numpy_float64_t __Pyx_mod___pyx_t_5numpy_float64_t(__pyx_t_5numpy_float64_t a, __pyx_t_5numpy_float64_t b) {
    __pyx_t_5numpy_float64_t r = fmod(a, b);
    r += ((r != 0) & ((r < 0) ^ (b < 0))) * b;
    return r;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result)
        result = __Pyx_GetModuleGlobalName(name);
    return result;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
    Py_DECREF(obj);
    view->obj = NULL;
}
#endif


          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
    const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_int32) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(npy_int32) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
                                     little, !is_unsigned);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
    const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(npy_int32) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (npy_int32) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (npy_int32) 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
                case 2:
                    if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
                            return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
                            return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
                            return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (npy_int32) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(npy_int32) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (npy_int32) 0;
                case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(npy_int32,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
                            return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
                            return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
                            return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
                            return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
                            return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
                            return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(npy_int32) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
            } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            npy_int32 val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (npy_int32) -1;
        }
    } else {
        npy_int32 val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (npy_int32) -1;
        val = __Pyx_PyInt_As_npy_int32(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_int32");
    return (npy_int32) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_int32");
    return (npy_int32) -1;
}

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(a, a);
                    case 3:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, a);
                    case 4:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_absf(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(a, a);
                    case 3:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, a);
                    case 4:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_abs(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) {
    const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = (ptrdiff_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(ptrdiff_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(ptrdiff_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(ptrdiff_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(ptrdiff_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
    const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum NPY_TYPES) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
