/* Generated by Cython 0.22 */

#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 0
#else
#include "pyconfig.h"
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 1
#else
#define CYTHON_USE_PYLONG_INTERNALS 0
#endif
#endif
#endif
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_22"
#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 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
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x030400a1 && !defined(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)
  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
#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))
  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(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
#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
#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
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet NaN. */
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None)
#ifdef __cplusplus
template<typename T>
void __Pyx_call_destructor(T* x) {
    x->~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(T& ref) : ptr(&ref) { }
    T *operator->() { return ptr; }
    operator T&() { return *ptr; }
  private:
    T *ptr;
};
#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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#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
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_fits_Py_ssize_t(v, type, is_signed)  (    \
    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
    (sizeof(type) > sizeof(Py_ssize_t) &&               \
          likely(v < (type)PY_SSIZE_T_MAX ||            \
                 v == (type)PY_SSIZE_T_MAX)  &&         \
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
                                v == (type)PY_SSIZE_T_MIN)))  ||  \
    (sizeof(type) == sizeof(Py_ssize_t) &&              \
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE 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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#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[] = {
  "das/src/sparse.pyx",
  "das/src/numpy.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":688
 * # Sparse arithmetic
 * 
 * ctypedef float64_t (* double_func)(float64_t a, float64_t b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tuple sparse_nancombine(ndarray x, SparseIndex xindex,
 */
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":25
 * 
 * 
 * cdef class SparseIndex:             # <<<<<<<<<<<<<<
 *     '''
 *     Abstract superclass for sparse index types
 */
struct __pyx_obj_6pandas_7_sparse_SparseIndex {
  PyObject_HEAD
};


/* "pandas/src/sparse.pyx":33
 * 
 * 
 * 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":259
 * # 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":527
 * 
 * 
 * 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":569
 *             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":575
 *     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":33
 * 
 * 
 * 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);
  PyObject *(*lookup)(struct __pyx_obj_6pandas_7_sparse_IntIndex *, Py_ssize_t, 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":259
 * # 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);
  PyObject *(*lookup)(struct __pyx_obj_6pandas_7_sparse_BlockIndex *, Py_ssize_t, 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":527
 * 
 * 
 * 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":569
 *             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":575
 *     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);

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

static CYTHON_INLINE int __Pyx_PyDict_Contains(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
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_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 PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);

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 int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t 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 PyObject *__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_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 PyObject *__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_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 'cpython.ref' */

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

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

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

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

/* Module declarations from 'numpy' */

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

/* Module declarations from '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_nancombine(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, __pyx_t_6pandas_7_sparse_double_func); /*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_int_nanop(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_IntIndex *, __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___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_nanadd(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nansub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrsub(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanmul(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nandiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrdiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanfloordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrfloordiv(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanpow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrpow(PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, PyArrayObject *, struct __pyx_obj_6pandas_7_sparse_SparseIndex *, int __pyx_skip_dispatch); /*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_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 __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_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 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_22reindex(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_24put(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_26take(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_22reindex(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_24put(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_26take(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_nanadd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_4sparse_nansub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_6sparse_nanrsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_8sparse_nanmul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_10sparse_nandiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_12sparse_nanrdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_14sparse_nanfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_16sparse_nanrfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_18sparse_nanpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_20sparse_nanrpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_22sparse_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_24sparse_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_26sparse_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_28sparse_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_30sparse_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_32sparse_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_34sparse_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_36sparse_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_38sparse_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_40sparse_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_42get_reindexer(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_index_map); /* proto */
static PyObject *__pyx_pf_6pandas_7_sparse_44reindex_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 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_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_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_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_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_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_RuntimeError[] = "RuntimeError";
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_sparse_nandiv[] = "sparse_nandiv";
static char __pyx_k_pandas__sparse[] = "pandas._sparse";
static char __pyx_k_sparse_nanrdiv[] = "sparse_nanrdiv";
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_sparse_nantruediv[] = "sparse_nantruediv";
static char __pyx_k_sparse_nanrtruediv[] = "sparse_nanrtruediv";
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_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_Users_jreback_pandas_pandas_src[] = "/Users/jreback/pandas/pandas/src/sparse.pyx";
static char __pyx_k_block_bound_arrays_must_be_same[] = "block bound arrays must be same length";
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_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_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_kp_s_Users_jreback_pandas_pandas_src;
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_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_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_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_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_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_sparse_div;
static PyObject *__pyx_n_s_sparse_index;
static PyObject *__pyx_n_s_sparse_nandiv;
static PyObject *__pyx_n_s_sparse_nanrdiv;
static PyObject *__pyx_n_s_sparse_nanrtruediv;
static PyObject *__pyx_n_s_sparse_nantruediv;
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_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_n_s_values;
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 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__16;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__17;

/* "pandas/src/sparse.pyx":19
 * 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":20
 * 
 * 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":29
 *     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":30
 *     '''
 *     def __init__(self):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/sparse.pyx":29
 *     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":47
 *         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 = 47; __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 = 47; __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 = 47; __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 = 47; __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":48
 * 
 *     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":49
 *     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 = 49; __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 = 49; __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 = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_indices);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
  __Pyx_GIVEREF(__pyx_v_indices);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __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 = 49; __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 = 49; __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 = 49; __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 = 49; __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 = 49; __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":50
 *         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 = 50; __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":47
 *         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":52
 *         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":53
 * 
 *     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 = 53; __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 = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->indices));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->indices));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->indices));
  __pyx_t_1 = 0;
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":54
 *     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 = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)));
  __Pyx_INCREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":52
 *         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":56
 *         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":57
 * 
 *     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":58
 *     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 = 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 = __Pyx_PyString_Format(__pyx_kp_s_Indices_s, __pyx_t_2); 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_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 = 58; __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":59
 *         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":56
 *         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":61
 *         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":68
 *         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":69
 * 
 *     def equals(self, other):
 *         if not isinstance(other, IntIndex):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/sparse.pyx":70
 *     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":72
 *             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":73
 * 
 *         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":75
 *             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 = 75; __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 = 75; __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 = 75; __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":76
 * 
 *         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 = 76; __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 = 76; __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 = 76; __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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_6) {
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->indices));
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_self->indices));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->indices));
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
  __Pyx_GIVEREF(__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 = 76; __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":77
 *         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 = 77; __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":68
 *         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":80
 * 
 *     @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":81
 *     @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 = 81; __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":80
 * 
 *     @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":83
 *         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":84
 * 
 *     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":83
 *         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":86
 *         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":87
 * 
 *     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 = 87; __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 = 87; __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 = 87; __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 = 87; __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 = 87; __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 = 87; __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 = 87; __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":88
 *     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 = 88; __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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_locs);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_locs);
  __Pyx_GIVEREF(__pyx_v_locs);
  __Pyx_INCREF(__pyx_v_lens);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_lens);
  __Pyx_GIVEREF(__pyx_v_lens);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)), __pyx_t_3, 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_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":86
 *         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":90
 *         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 = 90; __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 = 90; __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 = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_y_));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_y_));
        __Pyx_GIVEREF(((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 = 90; __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 = 90; __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":92
 *     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":95
 *             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 = 95; __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":99
 * 
 *         # 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 = 99; __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 = 99; __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 = 99; __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 = 99; __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":101
 *         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":102
 * 
 *         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 = 102; __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 = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/sparse.pyx":104
 *             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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xindices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":105
 * 
 *         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 = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yindices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":107
 *         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":108
 * 
 *         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 = 108; __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":110
 *             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 = 110; __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":111
 * 
 *             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":113
 *                 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":114
 * 
 *             if yi >= y.npoints:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             # TODO: would a two-pass algorithm be faster?
 */
      goto __pyx_L5_break;
    }

    /* "pandas/src/sparse.pyx":117
 * 
 *             # 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 = 117; __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":118
 *             # 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 = 118; __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 = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L11;
    }
    __pyx_L11:;
  }
  __pyx_L5_break:;

  /* "pandas/src/sparse.pyx":120
 *                 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 = 120; __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_new_list);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_new_list);
  __Pyx_GIVEREF(__pyx_v_new_list);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __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":90
 *         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 = 90; __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 = 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;

  /* 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":122
 *         return IntIndex(self.length, new_list)
 * 
 *     cpdef IntIndex make_union(self, SparseIndex y_):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t out_length, i, xi, yi
 */

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) {
  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_x = 0;
  struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_y = 0;
  PyObject *__pyx_v_yind = NULL;
  __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;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_union", 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_make_union); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __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 = 122; __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 = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_y_));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_y_));
        __Pyx_GIVEREF(((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 = 122; __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 = 122; __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":127
 *             int32_t xind
 *             ndarray[int32_t, ndim=1] xindices, yindices
 *             list new_list = []             # <<<<<<<<<<<<<<
 *             IntIndex x, y
 * 
 */
  __pyx_t_1 = PyList_New(0); 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_v_new_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":130
 *             IntIndex x, y
 * 
 *         x = self             # <<<<<<<<<<<<<<
 * 
 *         # if is one already, returns self
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_v_x = __pyx_v_self;

  /* "pandas/src/sparse.pyx":133
 * 
 *         # 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 = 133; __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 = 133; __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 = 133; __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 = 133; __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":135
 *         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":136
 * 
 *         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__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __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 = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/sparse.pyx":138
 *             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 = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xindices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":139
 * 
 *         xindices = self.indices
 *         yindices = y.indices             # <<<<<<<<<<<<<<
 * 
 *         xi = yi = 0
 */
  __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 = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yindices = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":141
 *         yindices = y.indices
 * 
 *         xi = yi = 0             # <<<<<<<<<<<<<<
 *         while True:
 *             if xi == x.npoints:
 */
  __pyx_v_xi = 0;
  __pyx_v_yi = 0;

  /* "pandas/src/sparse.pyx":142
 * 
 *         xi = yi = 0
 *         while True:             # <<<<<<<<<<<<<<
 *             if xi == x.npoints:
 *                 while yi < y.npoints:
 */
  while (1) {

    /* "pandas/src/sparse.pyx":143
 *         xi = yi = 0
 *         while True:
 *             if xi == x.npoints:             # <<<<<<<<<<<<<<
 *                 while yi < y.npoints:
 *                     new_list.append(yindices[yi])
 */
    __pyx_t_6 = ((__pyx_v_xi == __pyx_v_x->npoints) != 0);
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":144
 *         while True:
 *             if xi == x.npoints:
 *                 while yi < y.npoints:             # <<<<<<<<<<<<<<
 *                     new_list.append(yindices[yi])
 *                     yi += 1
 */
      while (1) {
        __pyx_t_6 = ((__pyx_v_yi < __pyx_v_y->npoints) != 0);
        if (!__pyx_t_6) break;

        /* "pandas/src/sparse.pyx":145
 *             if xi == x.npoints:
 *                 while yi < y.npoints:
 *                     new_list.append(yindices[yi])             # <<<<<<<<<<<<<<
 *                     yi += 1
 *                 break
 */
        __pyx_t_11 = __pyx_v_yi;
        __pyx_t_7 = -1;
        if (__pyx_t_11 < 0) {
          __pyx_t_11 += __pyx_pybuffernd_yindices.diminfo[0].shape;
          if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_11 >= __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 = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_yindices.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_1); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pandas/src/sparse.pyx":146
 *                 while yi < y.npoints:
 *                     new_list.append(yindices[yi])
 *                     yi += 1             # <<<<<<<<<<<<<<
 *                 break
 *             elif yi == y.npoints:
 */
        __pyx_v_yi = (__pyx_v_yi + 1);
      }

      /* "pandas/src/sparse.pyx":147
 *                     new_list.append(yindices[yi])
 *                     yi += 1
 *                 break             # <<<<<<<<<<<<<<
 *             elif yi == y.npoints:
 *                 while xi < x.npoints:
 */
      goto __pyx_L5_break;
    }

    /* "pandas/src/sparse.pyx":148
 *                     yi += 1
 *                 break
 *             elif yi == y.npoints:             # <<<<<<<<<<<<<<
 *                 while xi < x.npoints:
 *                     new_list.append(xindices[xi])
 */
    __pyx_t_6 = ((__pyx_v_yi == __pyx_v_y->npoints) != 0);
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":149
 *                 break
 *             elif yi == y.npoints:
 *                 while xi < x.npoints:             # <<<<<<<<<<<<<<
 *                     new_list.append(xindices[xi])
 *                     xi += 1
 */
      while (1) {
        __pyx_t_6 = ((__pyx_v_xi < __pyx_v_x->npoints) != 0);
        if (!__pyx_t_6) break;

        /* "pandas/src/sparse.pyx":150
 *             elif yi == y.npoints:
 *                 while xi < x.npoints:
 *                     new_list.append(xindices[xi])             # <<<<<<<<<<<<<<
 *                     xi += 1
 *                 break
 */
        __pyx_t_13 = __pyx_v_xi;
        __pyx_t_7 = -1;
        if (__pyx_t_13 < 0) {
          __pyx_t_13 += __pyx_pybuffernd_xindices.diminfo[0].shape;
          if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_13 >= __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 = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_xindices.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_1); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pandas/src/sparse.pyx":151
 *                 while xi < x.npoints:
 *                     new_list.append(xindices[xi])
 *                     xi += 1             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
        __pyx_v_xi = (__pyx_v_xi + 1);
      }

      /* "pandas/src/sparse.pyx":152
 *                     new_list.append(xindices[xi])
 *                     xi += 1
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             xind = xindices[xi]
 */
      goto __pyx_L5_break;
    }

    /* "pandas/src/sparse.pyx":154
 *                 break
 * 
 *             xind = xindices[xi]             # <<<<<<<<<<<<<<
 *             yind = yindices[yi]
 * 
 */
    __pyx_t_14 = __pyx_v_xi;
    __pyx_t_7 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_pybuffernd_xindices.diminfo[0].shape;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_14 >= __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 = 154; __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_14, __pyx_pybuffernd_xindices.diminfo[0].strides));

    /* "pandas/src/sparse.pyx":155
 * 
 *             xind = xindices[xi]
 *             yind = yindices[yi]             # <<<<<<<<<<<<<<
 * 
 *             if xind == yind:
 */
    __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 = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_PyInt_From_npy_int32((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_yindices.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_yind, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pandas/src/sparse.pyx":157
 *             yind = yindices[yi]
 * 
 *             if xind == yind:             # <<<<<<<<<<<<<<
 *                 new_list.append(xind)
 *                 xi += 1
 */
    __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_yind, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":158
 * 
 *             if xind == yind:
 *                 new_list.append(xind)             # <<<<<<<<<<<<<<
 *                 xi += 1
 *                 yi += 1
 */
      __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_2); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pandas/src/sparse.pyx":159
 *             if xind == yind:
 *                 new_list.append(xind)
 *                 xi += 1             # <<<<<<<<<<<<<<
 *                 yi += 1
 *             elif xind < yind:
 */
      __pyx_v_xi = (__pyx_v_xi + 1);

      /* "pandas/src/sparse.pyx":160
 *                 new_list.append(xind)
 *                 xi += 1
 *                 yi += 1             # <<<<<<<<<<<<<<
 *             elif xind < yind:
 *                 new_list.append(xind)
 */
      __pyx_v_yi = (__pyx_v_yi + 1);
      goto __pyx_L11;
    }

    /* "pandas/src/sparse.pyx":161
 *                 xi += 1
 *                 yi += 1
 *             elif xind < yind:             # <<<<<<<<<<<<<<
 *                 new_list.append(xind)
 *                 xi += 1
 */
    __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_yind, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "pandas/src/sparse.pyx":162
 *                 yi += 1
 *             elif xind < yind:
 *                 new_list.append(xind)             # <<<<<<<<<<<<<<
 *                 xi += 1
 *             else:
 */
      __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_xind); 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_t_12 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_t_1); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pandas/src/sparse.pyx":163
 *             elif xind < yind:
 *                 new_list.append(xind)
 *                 xi += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 new_list.append(yind)
 */
      __pyx_v_xi = (__pyx_v_xi + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pandas/src/sparse.pyx":165
 *                 xi += 1
 *             else:
 *                 new_list.append(yind)             # <<<<<<<<<<<<<<
 *                 yi += 1
 * 
 */
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_new_list, __pyx_v_yind); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "pandas/src/sparse.pyx":166
 *             else:
 *                 new_list.append(yind)
 *                 yi += 1             # <<<<<<<<<<<<<<
 * 
 *         return IntIndex(x.length, new_list)
 */
      __pyx_v_yi = (__pyx_v_yi + 1);
    }
    __pyx_L11:;
  }
  __pyx_L5_break:;

  /* "pandas/src/sparse.pyx":168
 *                 yi += 1
 * 
 *         return IntIndex(x.length, new_list)             # <<<<<<<<<<<<<<
 * 
 *     @cython.wraparound(False)
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_x->length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_new_list);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_new_list);
  __Pyx_GIVEREF(__pyx_v_new_list);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __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":122
 *         return IntIndex(self.length, new_list)
 * 
 *     cpdef IntIndex make_union(self, SparseIndex y_):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t out_length, i, xi, yi
 */

  /* 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.make_union", __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_x);
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_yind);
  __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 = 122; __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 = 122; __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":171
 * 
 *     @cython.wraparound(False)
 *     cpdef lookup(self, Py_ssize_t index):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t res, n, cum_len = 0
 */

static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static PyObject *__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;
  CYTHON_UNUSED Py_ssize_t __pyx_v_cum_len;
  PyArrayObject *__pyx_v_inds = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_inds;
  __Pyx_Buffer __pyx_pybuffer_inds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  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;
  int __pyx_t_12;
  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 = 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_21lookup)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __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 = 171; __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 = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__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 = 171; __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_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":173
 *     cpdef lookup(self, Py_ssize_t index):
 *         cdef:
 *             Py_ssize_t res, n, cum_len = 0             # <<<<<<<<<<<<<<
 *             ndarray[int32_t, ndim=1] inds
 * 
 */
  __pyx_v_cum_len = 0;

  /* "pandas/src/sparse.pyx":176
 *             ndarray[int32_t, ndim=1] inds
 * 
 *         inds = self.indices             # <<<<<<<<<<<<<<
 *         res = inds.searchsorted(index)
 *         if res == self.npoints:
 */
  __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 = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_inds = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":177
 * 
 *         inds = self.indices
 *         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 = 177; __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 = 177; __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 = 177; __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 = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
    __Pyx_GIVEREF(__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 = 177; __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_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_res = __pyx_t_11;

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

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

  /* "pandas/src/sparse.pyx":180
 *         if res == self.npoints:
 *             return -1
 *         elif inds[res] == index:             # <<<<<<<<<<<<<<
 *             return res
 *         else:
 */
  __pyx_t_11 = __pyx_v_res;
  __pyx_t_7 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_11 >= __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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_inds.diminfo[0].strides)) == __pyx_v_index) != 0);
  if (__pyx_t_12) {

    /* "pandas/src/sparse.pyx":181
 *             return -1
 *         elif inds[res] == index:
 *             return res             # <<<<<<<<<<<<<<
 *         else:
 *             return -1
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_res); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "pandas/src/sparse.pyx":183
 *             return res
 *         else:
 *             return -1             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values,
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":171
 * 
 *     @cython.wraparound(False)
 *     cpdef lookup(self, Py_ssize_t index):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t res, n, cum_len = 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);
  __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_AddTraceback("pandas._sparse.IntIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_inds);
  __Pyx_XGIVEREF(__pyx_r);
  __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 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 = 171; __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_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 = 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);
  __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":185
 *             return -1
 * 
 *     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_23reindex(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 = 185; __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 = 185; __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_23reindex)) {
      __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 = 185; __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 = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_other_));
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_other_));
      __Pyx_GIVEREF(((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 = 185; __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 = 185; __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":188
 *                           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":193
 *             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 = 193; __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 = 193; __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 = 193; __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 = 193; __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":195
 *         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 = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_oinds = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":196
 * 
 *         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 = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_sinds = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":198
 *         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 = 198; __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 = 198; __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 = 198; __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 = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __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 = 198; __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 = 198; __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 = 198; __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 = 198; __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 = 198; __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 = 198; __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":199
 * 
 *         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 = 199; __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 = 199; __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 = 199; __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 = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
    __Pyx_GIVEREF(__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 = 199; __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":201
 *         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":202
 * 
 *         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 = 202; __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 = 202; __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":203
 *         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":205
 *                 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":206
 * 
 *             if j == self.npoints:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             if oinds[i] < sinds[j]:
 */
      goto __pyx_L4_break;
    }

    /* "pandas/src/sparse.pyx":208
 *                 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 = 208; __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 = 208; __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":209
 * 
 *             if oinds[i] < sinds[j]:
 *                 continue             # <<<<<<<<<<<<<<
 *             elif oinds[i] == sinds[j]:
 *                 result[i] = values[j]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/sparse.pyx":210
 *             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 = 210; __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 = 210; __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":211
 *                 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 = 211; __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 = 211; __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":212
 *             elif oinds[i] == sinds[j]:
 *                 result[i] = values[j]
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_v_j = (__pyx_v_j + 1);
      goto __pyx_L10;
    }
    __pyx_L10:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pandas/src/sparse.pyx":214
 *                 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":185
 *             return -1
 * 
 *     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_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex(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 = 185; __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 = 185; __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 = 185; __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 = 186; __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 = 185; __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 = 185; __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_22reindex(((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_22reindex(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 = 185; __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 = 185; __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":216
 *         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_25put(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 = 216; __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 = 216; __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 = 216; __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_25put)) {
      __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 = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_indices));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_indices));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_indices));
      __Pyx_INCREF(__pyx_v_to_put);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_to_put);
      __Pyx_GIVEREF(__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 = 216; __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":218
 *     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":216
 *         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_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_25put(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 = 216; __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 = 216; __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 = 216; __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 = 216; __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 = 216; __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 = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_24put(((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_24put(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 = 216; __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 = 216; __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 = 216; __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":220
 *         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_27take(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 = 220; __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 = 220; __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 = 220; __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_27take)) {
      __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 = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_indices));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_indices));
      __Pyx_GIVEREF(((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 = 220; __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":222
 *     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":220
 *         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_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_8IntIndex_27take(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 = 220; __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 = 220; __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 = 220; __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 = 220; __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 = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8IntIndex_26take(((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_26take(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 = 220; __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 = 220; __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 = 220; __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":44
 *     '''
 *     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 = 44; __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 = 44; __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":45
 *     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":224
 *         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;
  long __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 = 224; __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":227
 *     cdef:
 *         Py_ssize_t i, npoints
 *         int32_t block, length = 1, cur, prev             # <<<<<<<<<<<<<<
 *         list locs = [], lens = []
 * 
 */
  __pyx_v_length = 1;

  /* "pandas/src/sparse.pyx":228
 *         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 = 228; __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 = 228; __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":230
 *         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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_npoints = __pyx_t_2;

  /* "pandas/src/sparse.pyx":233
 * 
 *     # 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":234
 *     # 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 = 234; __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 = 234; __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 = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __Pyx_GIVEREF(__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":237
 * 
 *     # 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 = 237; __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":238
 *     # 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":239
 *     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 = 239; __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":240
 *     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":242
 *         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 = 242; __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 = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pandas/src/sparse.pyx":243
 *             # 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 = 243; __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 = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

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

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

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

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

  /* "pandas/src/sparse.pyx":252
 *         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 = 252; __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 = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":253
 * 
 *     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 = 253; __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 = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/sparse.pyx":254
 *     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 = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_locs);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_locs);
  __Pyx_GIVEREF(__pyx_v_locs);
  __Pyx_INCREF(__pyx_v_lens);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_lens);
  __Pyx_GIVEREF(__pyx_v_lens);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":224
 *         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 = 224; __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 = 224; __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 = 224; __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":274
 *         int32_t* locbuf, *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 = 274; __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 = 274; __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 = 274; __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 = 274; __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":276
 *     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 = 276; __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 = 276; __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 = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_blocs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_blocs);
  __Pyx_GIVEREF(__pyx_v_blocs);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __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 = 276; __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 = 276; __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 = 276; __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 = 276; __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 = 276; __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":277
 * 
 *         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 = 277; __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 = 277; __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 = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_blengths);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_blengths);
  __Pyx_GIVEREF(__pyx_v_blengths);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __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 = 277; __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 = 277; __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 = 277; __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 = 277; __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 = 277; __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":280
 * 
 *         # 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":281
 *         # 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":283
 *         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 = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->length = __pyx_t_6;

  /* "pandas/src/sparse.pyx":284
 * 
 *         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 = 284; __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":285
 *         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 = 285; __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 = 285; __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 = 285; __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 = 285; __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":290
 *         # 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 = 290; __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":274
 *         int32_t* locbuf, *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":292
 *         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":293
 * 
 *     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 = 293; __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 = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->blocs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blocs));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->blengths));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blengths));
  __pyx_t_1 = 0;
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/sparse.pyx":294
 *     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 = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)));
  __Pyx_INCREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":292
 *         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":296
 *         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":297
 * 
 *     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":298
 *     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 = 298; __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 = 298; __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 = 298; __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":299
 *         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 = 299; __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 = 299; __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 = 299; __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":301
 *         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":296
 *         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":304
 * 
 *     @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":305
 *     @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 = 305; __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":304
 * 
 *     @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":307
 *         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;
  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 = 307; __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 = 307; __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 = 307; __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":318
 *             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 = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_blocs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":319
 * 
 *         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 = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_blengths = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":321
 *         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 = 321; __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 = 321; __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":322
 * 
 *         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__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __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 = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/sparse.pyx":324
 *             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":325
 * 
 *         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":326
 *         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_9 = __pyx_v_i;
      __pyx_t_5 = -1;
      if (__pyx_t_9 < 0) {
        __pyx_t_9 += __pyx_pybuffernd_blocs.diminfo[0].shape;
        if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_9 >= __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 = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = (__pyx_v_i - 1);
      __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 = 326; __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_9, __pyx_pybuffernd_blocs.diminfo[0].strides)) <= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_blocs.diminfo[0].strides))) != 0);
      if (__pyx_t_11) {

        /* "pandas/src/sparse.pyx":327
 *             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__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __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 = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pandas/src/sparse.pyx":329
 *                     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":330
 * 
 *             if i < self.nblocks - 1:
 *                 if blocs[i] + blengths[i] > blocs[i + 1]:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Block %d overlaps' % i)
 *             else:
 */
      __pyx_t_13 = __pyx_v_i;
      __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 = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_5 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_pybuffernd_blengths.diminfo[0].shape;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_14 >= __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 = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = (__pyx_v_i + 1);
      __pyx_t_5 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_pybuffernd_blocs.diminfo[0].shape;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_15 >= __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 = 330; __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_13, __pyx_pybuffernd_blocs.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blengths.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_blengths.diminfo[0].strides))) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_blocs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_blocs.diminfo[0].strides))) != 0);
      if (__pyx_t_11) {

        /* "pandas/src/sparse.pyx":331
 *             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 = 331; __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 = 331; __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 = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
        __Pyx_GIVEREF(__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 = 331; __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 = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      goto __pyx_L8;
    }
    /*else*/ {

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

        /* "pandas/src/sparse.pyx":334
 *             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 = 334; __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 = 334; __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 = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
        __Pyx_GIVEREF(__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 = 334; __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 = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }
    __pyx_L8:;

    /* "pandas/src/sparse.pyx":337
 * 
 *             # no zero-length blocks
 *             if blengths[i] == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Zero-length block %d' % i)
 * 
 */
    __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 = 337; __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_18, __pyx_pybuffernd_blengths.diminfo[0].strides)) == 0) != 0);
    if (__pyx_t_11) {

      /* "pandas/src/sparse.pyx":338
 *             # 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 = 338; __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 = 338; __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 = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__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 = 338; __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 = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }

  /* "pandas/src/sparse.pyx":307
 *         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 = 307; __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":340
 *                 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":341
 * 
 *     def equals(self, other):
 *         if not isinstance(other, BlockIndex):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, ((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "pandas/src/sparse.pyx":342
 *     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":344
 *             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":345
 * 
 *         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":347
 *             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 = 347; __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 = 347; __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 = 347; __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":348
 * 
 *         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 = 348; __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 = 348; __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 = 348; __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 = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_7) {
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blocs));
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_self->blocs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blocs));
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_3);
  __Pyx_GIVEREF(__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 = 348; __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 = 348; __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":349
 *         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 = 349; __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 = 349; __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 = 349; __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 = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self->blengths));
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, ((PyObject *)__pyx_v_self->blengths));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->blengths));
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_6);
  __Pyx_GIVEREF(__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 = 349; __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":350
 *         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 = 350; __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":340
 *                 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":352
 *         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":353
 * 
 *     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":352
 *         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":355
 *         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":357
 *     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":361
 *             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 = 361; __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 = 361; __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 = 361; __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 = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __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 = 361; __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 = 361; __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 = 361; __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 = 361; __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 = 361; __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 = 361; __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":363
 *         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":364
 * 
 *         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":366
 *             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":367
 * 
 *             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 = 367; __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":368
 *             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":370
 *                 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 = 370; __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 = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_indices));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indices));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_indices));
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __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":355
 *         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":372
 *         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 = 372; __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 = 372; __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 = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_other));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
        __Pyx_GIVEREF(((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 = 372; __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 = 372; __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":387
 *             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 = 387; __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":388
 * 
 *             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 = 388; __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":390
 *             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":393
 *             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 = 393; __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 = 393; __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 = 393; __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 = 393; __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":395
 *         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":396
 * 
 *         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__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __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 = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/sparse.pyx":398
 *             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 = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xloc = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":399
 * 
 *         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 = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xlen = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":400
 *         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 = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yloc = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":401
 *         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 = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_ylen = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":403
 *         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":405
 *         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":406
 *             # 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":409
 * 
 *             # 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 = 409; __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 = 409; __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":410
 *             # 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 = 410; __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":411
 *             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 = 411; __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 = 411; __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":413
 *                 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 = 413; __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":415
 *                 if ylen[yi] <= diff:
 *                     # have to skip this block
 *                     yi += 1             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
        __pyx_v_yi = (__pyx_v_yi + 1);

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

      /* "pandas/src/sparse.pyx":418
 *                     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 = 418; __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 = 418; __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":420
 *                 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 = 420; __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":421
 *                     # 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);
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/sparse.pyx":424
 *                 else:
 *                     # take end of x block
 *                     cur_length = xlen[xi]             # <<<<<<<<<<<<<<
 *                     xi += 1
 * 
 */
        __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 = 424; __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":425
 *                     # 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:;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pandas/src/sparse.pyx":428
 * 
 *             else: # xloc[xi] < yloc[yi]
 *                 cur_loc = yloc[yi]             # <<<<<<<<<<<<<<
 *                 diff = yloc[yi] - xloc[xi]
 * 
 */
      __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 = 428; __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":429
 *             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 = 429; __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 = 429; __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":431
 *                 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 = 431; __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":433
 *                 if xlen[xi] <= diff:
 *                     # have to skip this block
 *                     xi += 1             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
        __pyx_v_xi = (__pyx_v_xi + 1);

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

      /* "pandas/src/sparse.pyx":436
 *                     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 = 436; __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 = 436; __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":438
 *                 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 = 438; __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":439
 *                     # 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);
        goto __pyx_L13;
      }
      /*else*/ {

        /* "pandas/src/sparse.pyx":442
 *                 else:
 *                     # take end of y block
 *                     cur_length = ylen[yi]             # <<<<<<<<<<<<<<
 *                     yi += 1
 * 
 */
        __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 = 442; __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":443
 *                     # 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":445
 *                     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 = 445; __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 = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pandas/src/sparse.pyx":446
 * 
 *             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 = 446; __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 = 446; __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":448
 *             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 = 448; __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 = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_out_blocs);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_out_blocs);
  __Pyx_GIVEREF(__pyx_v_out_blocs);
  __Pyx_INCREF(__pyx_v_out_blengths);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_out_blengths);
  __Pyx_GIVEREF(__pyx_v_out_blengths);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __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":372
 *         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 = 372; __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 = 372; __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":450
 *         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 = 450; __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 = 450; __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 = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_y));
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_y));
        __Pyx_GIVEREF(((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 = 450; __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 = 450; __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":467
 *         union : BlockIndex
 *         '''
 *         return BlockUnion(self, y.to_block_index()).result             # <<<<<<<<<<<<<<
 * 
 *     cpdef 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 = 467; __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 = 467; __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 = 467; __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 = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockUnion)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __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":450
 *         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 = 450; __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 = 450; __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":469
 *         return BlockUnion(self, y.to_block_index()).result
 * 
 *     cpdef lookup(self, Py_ssize_t index):             # <<<<<<<<<<<<<<
 *         '''
 * 
 */

static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_21lookup(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static PyObject *__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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  long __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 = 469; __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_XDECREF(__pyx_r);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __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 = 469; __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 = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __Pyx_GIVEREF(__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 = 469; __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_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":478
 *             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 = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":479
 * 
 *         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 = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_lens = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":481
 *         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":482
 * 
 *         if self.nblocks == 0:
 *             return -1             # <<<<<<<<<<<<<<
 *         elif index < locs[0]:
 *             return -1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":483
 *         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 = 483; __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":484
 *             return -1
 *         elif index < locs[0]:
 *             return -1             # <<<<<<<<<<<<<<
 * 
 *         cum_len = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":486
 *             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":487
 * 
 *         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":488
 *         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 = 488; __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 = 488; __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 = 488; __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":489
 *         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_XDECREF(__pyx_r);
      __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 = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyInt_FromSsize_t(((__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)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __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":490
 *             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 = 490; __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":492
 *             cum_len += lens[i]
 * 
 *         return -1             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray reindex(self, ndarray[float64_t, ndim=1] values,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_neg_1);
  __pyx_r = __pyx_int_neg_1;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":469
 *         return BlockUnion(self, y.to_block_index()).result
 * 
 *     cpdef lookup(self, Py_ssize_t 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_AddTraceback("pandas._sparse.BlockIndex.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __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_XGIVEREF(__pyx_r);
  __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\n        Returns -1 if not found\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 = 469; __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_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 = 469; __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":494
 *         return -1
 * 
 *     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_23reindex(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 = 494; __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 = 494; __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_23reindex)) {
      __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 = 494; __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 = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_other_));
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_other_));
      __Pyx_GIVEREF(((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 = 494; __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 = 494; __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":497
 *                           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":502
 *             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 = 502; __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 = 502; __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 = 502; __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 = 502; __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":504
 *         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 = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_olocs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":505
 * 
 *         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 = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_olens = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":506
 *         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 = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_slocs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":507
 *         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 = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_slens = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":509
 *         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 = 509; __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 = 509; __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 = 509; __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 = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __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 = 509; __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 = 509; __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 = 509; __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 = 509; __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 = 509; __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 = 509; __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":511
 *         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":512
 * 
 *         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 = 512; __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":513
 *         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 = 513; __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":515
 *             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 = 515; __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 = 515; __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":516
 * 
 *             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":494
 *         return -1
 * 
 *     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_23reindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex(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 = 494; __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 = 494; __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 = 494; __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 = 495; __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 = 494; __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 = 494; __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 = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_22reindex(((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_22reindex(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 = 494; __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 = 494; __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":518
 *                 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_25put(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 = 518; __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 = 518; __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 = 518; __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_25put)) {
      __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 = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_indices));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_indices));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_indices));
      __Pyx_INCREF(__pyx_v_to_put);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_to_put);
      __Pyx_GIVEREF(__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 = 518; __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":520
 *     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":518
 *                 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_25put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_25put(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 = 518; __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 = 518; __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 = 518; __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 = 518; __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 = 518; __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 = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_24put(((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_24put(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 = 518; __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 = 518; __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 = 518; __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":522
 *         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_27take(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 = 522; __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 = 522; __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 = 522; __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_27take)) {
      __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 = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_indices));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_indices));
      __Pyx_GIVEREF(((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 = 522; __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":524
 *     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":522
 *         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_27take(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_10BlockIndex_27take(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 = 522; __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 = 522; __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 = 522; __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 = 522; __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 = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10BlockIndex_26take(((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_26take(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 = 522; __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 = 522; __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 = 522; __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":267
 *     '''
 *     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 = 267; __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 = 267; __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 = 267; __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":268
 *     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":537
 *         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 = 537; __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 = 537; __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 = 537; __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 = 537; __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 = 537; __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":538
 * 
 *     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":539
 *     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":541
 *         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":542
 * 
 *         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__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __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 = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/sparse.pyx":544
 *             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":545
 * 
 *         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":547
 *         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 = 547; __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 = 547; __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":548
 * 
 *         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 = 548; __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 = 548; __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":553
 *         # self.ylen = self.y.blengths
 * 
 *         self.xi = 0             # <<<<<<<<<<<<<<
 *         self.yi = 0
 * 
 */
  __pyx_v_self->xi = 0;

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

  /* "pandas/src/sparse.pyx":556
 *         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 = 556; __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 = 556; __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":537
 *         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":558
 *         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":559
 * 
 *     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 = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/sparse.pyx":558
 *         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":561
 *         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":562
 * 
 *     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":563
 *     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":564
 *         if mode == 0:
 *             self.xi = xi
 *             self.yi = yi             # <<<<<<<<<<<<<<
 *         else:
 *             self.xi = yi
 */
    __pyx_v_self->yi = __pyx_v_yi;
    goto __pyx_L3;
  }
  /*else*/ {

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

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

  /* "pandas/src/sparse.pyx":561
 *         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":581
 *     '''
 * 
 *     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;
  __pyx_t_5numpy_int32_t __pyx_t_8;
  __pyx_t_5numpy_int32_t __pyx_t_9;
  __pyx_t_5numpy_int32_t __pyx_t_10;
  __pyx_t_5numpy_int32_t __pyx_t_11;
  __pyx_t_5numpy_int32_t __pyx_t_12;
  __pyx_t_5numpy_int32_t __pyx_t_13;
  __pyx_t_5numpy_int32_t __pyx_t_14;
  __pyx_t_5numpy_int32_t __pyx_t_15;
  __pyx_t_5numpy_int32_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":585
 *             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 = 585; __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 = 585; __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":587
 *             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 = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xstart = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":588
 * 
 *         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 = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xend = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":589
 *         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 = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_ystart = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":590
 *         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 = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yend = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":592
 *         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":594
 *         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":595
 *             # 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":596
 *             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":598
 *             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 = 598; __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":599
 *                 # 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 = 599; __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":600
 *                 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);
      goto __pyx_L5;
    }

    /* "pandas/src/sparse.pyx":601
 *                 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":603
 *             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 = 603; __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":604
 *                 # 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 = 604; __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":605
 *                 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);
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/sparse.pyx":608
 *             else:
 *                 # find end of new block
 *                 if xstart[self.xi] < ystart[self.yi]:             # <<<<<<<<<<<<<<
 *                     nstart = xstart[self.xi]
 *                     nend = self._find_next_block_end(0)
 */
      __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 = 608; __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 = 608; __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":609
 *                 # 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 = 609; __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":610
 *                 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 = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_nend = __pyx_t_15;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "pandas/src/sparse.pyx":612
 *                     nend = self._find_next_block_end(0)
 *                 else:
 *                     nstart = ystart[self.yi]             # <<<<<<<<<<<<<<
 *                     nend = self._find_next_block_end(1)
 * 
 */
        __pyx_t_15 = __pyx_v_self->__pyx_base.yi;
        __pyx_t_2 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_pybuffernd_ystart.diminfo[0].shape;
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_2 = 0;
        } else if (unlikely(__pyx_t_15 >= __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 = 612; __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_15, __pyx_pybuffernd_ystart.diminfo[0].strides));

        /* "pandas/src/sparse.pyx":613
 *                 else:
 *                     nstart = ystart[self.yi]
 *                     nend = self._find_next_block_end(1)             # <<<<<<<<<<<<<<
 * 
 *             out_blocs.append(nstart)
 */
        __pyx_t_16 = ((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_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_v_nend = __pyx_t_16;
      }
      __pyx_L8:;
    }
    __pyx_L5:;

    /* "pandas/src/sparse.pyx":615
 *                     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 = 615; __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 = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pandas/src/sparse.pyx":616
 * 
 *             out_blocs.append(nstart)
 *             out_blengths.append(nend - nstart)             # <<<<<<<<<<<<<<
 * 
 *         return BlockIndex(self.x.length, out_blocs, out_blengths)
 */
    __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_nend - __pyx_v_nstart)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __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 = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4_break:;

  /* "pandas/src/sparse.pyx":618
 *             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 = 618; __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 = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_18);
  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_out_blocs);
  PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_v_out_blocs);
  __Pyx_GIVEREF(__pyx_v_out_blocs);
  __Pyx_INCREF(__pyx_v_out_blengths);
  PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_v_out_blengths);
  __Pyx_GIVEREF(__pyx_v_out_blengths);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)), __pyx_t_18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __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":581
 *     '''
 * 
 *     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":620
 *         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;
  __pyx_t_5numpy_int32_t __pyx_t_9;
  int __pyx_t_10;
  __pyx_t_5numpy_int32_t __pyx_t_11;
  __pyx_t_5numpy_int32_t __pyx_t_12;
  __pyx_t_5numpy_int32_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":631
 *             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":632
 * 
 *         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__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __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 = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "pandas/src/sparse.pyx":635
 * 
 *         # 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":636
 *         # 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 = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_xstart = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":637
 *         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 = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_xend = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":638
 *             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":640
 *             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 = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_ystart = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":641
 * 
 *             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 = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_yend = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":642
 *             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":643
 *             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;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pandas/src/sparse.pyx":645
 *             ynblocks = self.y.nblocks
 *         else:
 *             xstart = self.ystart             # <<<<<<<<<<<<<<
 *             xend = self.yend
 *             xi = 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_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 = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_xstart = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":646
 *         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 = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_xend = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":647
 *             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":649
 *             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 = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_ystart = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":650
 * 
 *             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 = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_yend = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pandas/src/sparse.pyx":651
 *             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":652
 *             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":654
 *             ynblocks = self.x.nblocks
 * 
 *         nend = xend[xi]             # <<<<<<<<<<<<<<
 * 
 *         # print 'here xi=%d, yi=%d, mode=%d, nend=%d' % (self.xi, self.yi,
 */
  __pyx_t_7 = __pyx_v_xi;
  __pyx_t_3 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_pybuffernd_xend.diminfo[0].shape;
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0;
  } else if (unlikely(__pyx_t_7 >= __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 = 654; __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_7, __pyx_pybuffernd_xend.diminfo[0].strides));

  /* "pandas/src/sparse.pyx":660
 * 
 *         # 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":661
 *         # 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 = 661; __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":662
 *         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":663
 *             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_9 = __pyx_v_yi;
  __pyx_t_3 = -1;
  if (__pyx_t_9 < 0) {
    __pyx_t_9 += __pyx_pybuffernd_ystart.diminfo[0].shape;
    if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0;
  } else if (unlikely(__pyx_t_9 >= __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 = 663; __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_9, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":665
 *         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 = 665; __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":666
 *             # 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;
  }
  /*else*/ {

    /* "pandas/src/sparse.pyx":668
 *             return nend
 *         else:
 *             while yi < ynblocks and nend > yend[yi]:             # <<<<<<<<<<<<<<
 *                 yi += 1
 * 
 */
    while (1) {
      __pyx_t_10 = ((__pyx_v_yi < __pyx_v_ynblocks) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_1 = __pyx_t_10;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_11 = __pyx_v_yi;
      __pyx_t_3 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_pybuffernd_yend.diminfo[0].shape;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_11 >= __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 = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_10 = ((__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))) != 0);
      __pyx_t_1 = __pyx_t_10;
      __pyx_L8_bool_binop_done:;
      if (!__pyx_t_1) break;

      /* "pandas/src/sparse.pyx":669
 *         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":671
 *                 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 = 671; __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":673
 *             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":674
 * 
 *             if yi == ynblocks:
 *                 return nend             # <<<<<<<<<<<<<<
 * 
 *             if nend < ystart[yi]:
 */
      __pyx_r = __pyx_v_nend;
      goto __pyx_L0;
    }

    /* "pandas/src/sparse.pyx":676
 *                 return nend
 * 
 *             if nend < ystart[yi]:             # <<<<<<<<<<<<<<
 *                 # we're done, return the block end
 *                 return nend
 */
    __pyx_t_12 = __pyx_v_yi;
    __pyx_t_3 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_pybuffernd_ystart.diminfo[0].shape;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_12 >= __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 = 676; __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_12, __pyx_pybuffernd_ystart.diminfo[0].strides))) != 0);
    if (__pyx_t_1) {

      /* "pandas/src/sparse.pyx":678
 *             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;
    }
    /*else*/ {

      /* "pandas/src/sparse.pyx":682
 *                 # merge blocks, continue searching
 *                 # this also catches the case where blocks
 *                 return self._find_next_block_end(1 - mode)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_13 = ((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_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = __pyx_t_13;
      goto __pyx_L0;
    }
  }

  /* "pandas/src/sparse.pyx":620
 *         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":690
 * ctypedef float64_t (* double_func)(float64_t a, float64_t b)
 * 
 * cdef inline tuple sparse_nancombine(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                                     ndarray y, SparseIndex yindex,
 *                                     double_func op):
 */

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

  /* "pandas/src/sparse.pyx":694
 *                                     double_func op):
 *     # faster to convert to IntIndex
 *     return int_nanop(x, xindex.to_int_index(),             # <<<<<<<<<<<<<<
 *                      y, yindex.to_int_index(), op)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_xindex), __pyx_n_s_to_int_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __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 = 694; __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 = 694; __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 = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/sparse.pyx":695
 *     # faster to convert to IntIndex
 *     return int_nanop(x, xindex.to_int_index(),
 *                      y, yindex.to_int_index(), op)             # <<<<<<<<<<<<<<
 * 
 *     # if isinstance(xindex, BlockIndex):
 */
  __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 = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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 = 695; __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 = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __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 = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/sparse.pyx":694
 *                                     double_func op):
 *     # faster to convert to IntIndex
 *     return int_nanop(x, xindex.to_int_index(),             # <<<<<<<<<<<<<<
 *                      y, yindex.to_int_index(), op)
 * 
 */
  __pyx_t_3 = __pyx_f_6pandas_7_sparse_int_nanop(__pyx_v_x, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_1), __pyx_v_y, ((struct __pyx_obj_6pandas_7_sparse_IntIndex *)__pyx_t_2), __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":690
 * ctypedef float64_t (* double_func)(float64_t a, float64_t b)
 * 
 * cdef inline tuple sparse_nancombine(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                                     ndarray y, SparseIndex yindex,
 *                                     double_func op):
 */

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

/* "pandas/src/sparse.pyx":705
 * 
 * 
 * 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":708
 *                                  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), ((PyObject*)__pyx_ptype_6pandas_7_sparse_BlockIndex)); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pandas/src/sparse.pyx":709
 *                                  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 = 709; __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 = 709; __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 = 709; __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 = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":710
 *     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 = 710; __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 = 710; __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 = 710; __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 = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":709
 *                                  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 = 709; __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":711
 *         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), ((PyObject*)__pyx_ptype_6pandas_7_sparse_IntIndex)); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":712
 *                         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 = 712; __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 = 712; __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 = 712; __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 = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":713
 *     elif isinstance(xindex, IntIndex):
 *         return int_op(x, xindex.to_int_index(), xfill,
 *                       y, yindex.to_int_index(), yfill, op)             # <<<<<<<<<<<<<<
 * 
 * # NaN-based arithmetic operation-- no handling of fill values
 */
    __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 = 713; __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 = 713; __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 = 713; __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 = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pandas/src/sparse.pyx":712
 *                         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 = 712; __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":705
 * 
 * 
 * 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":719
 * 
 * @cython.boundscheck(False)
 * cdef inline tuple block_nanop(ndarray x_, BlockIndex xindex,             # <<<<<<<<<<<<<<
 *                               ndarray y_, BlockIndex yindex,
 *                               double_func op):
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_block_nanop(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_BlockIndex *__pyx_v_yindex, __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;
  Py_ssize_t __pyx_v_obp;
  Py_ssize_t __pyx_v_xblock;
  Py_ssize_t __pyx_v_yblock;
  Py_ssize_t __pyx_v_outblock;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("block_nanop", 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":724
 *     cdef:
 *         BlockIndex out_index
 *         Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices             # <<<<<<<<<<<<<<
 *         Py_ssize_t xbp = 0, ybp = 0, obp = 0 # block positions
 *         Py_ssize_t xblock = 0, yblock = 0, outblock = 0 # block numbers
 */
  __pyx_v_xi = 0;
  __pyx_v_yi = 0;
  __pyx_v_out_i = 0;

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

  /* "pandas/src/sparse.pyx":726
 *         Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices
 *         Py_ssize_t xbp = 0, ybp = 0, obp = 0 # block positions
 *         Py_ssize_t xblock = 0, yblock = 0, outblock = 0 # block numbers             # <<<<<<<<<<<<<<
 * 
 *         ndarray[float64_t, ndim=1] x, y
 */
  __pyx_v_xblock = 0;
  __pyx_v_yblock = 0;
  __pyx_v_outblock = 0;

  /* "pandas/src/sparse.pyx":732
 * 
 *     # 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 = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_x_));
  __pyx_v_x = ((PyArrayObject *)__pyx_v_x_);

  /* "pandas/src/sparse.pyx":733
 *     # suppress Cython compiler warnings due to inlining
 *     x = x_
 *     y = y_             # <<<<<<<<<<<<<<
 * 
 *     out_index = xindex.intersect(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 = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_y_));
  __pyx_v_y = ((PyArrayObject *)__pyx_v_y_);

  /* "pandas/src/sparse.pyx":735
 *     y = y_
 * 
 *     out_index = xindex.intersect(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)->intersect(__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 = 735; __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":736
 * 
 *     out_index = xindex.intersect(yindex)
 *     out = np.empty(out_index.npoints, dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *     # walk the two SparseVectors, adding matched locations...
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __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 = 736; __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 = 736; __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 = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __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 = 736; __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 = 736; __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 = 736; __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 = 736; __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 = 736; __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 = 736; __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":739
 * 
 *     # walk the two SparseVectors, adding matched locations...
 *     for out_i from 0 <= out_i < out_index.npoints:             # <<<<<<<<<<<<<<
 * 
 *         # I have a feeling this is inefficient
 */
  __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":744
 * 
 *         # walk x
 *         while xindex.locbuf[xblock] + xbp < out_index.locbuf[outblock] + obp:             # <<<<<<<<<<<<<<
 *             xbp += 1
 *             xi += 1
 */
    while (1) {
      __pyx_t_12 = ((((__pyx_v_xindex->locbuf[__pyx_v_xblock]) + __pyx_v_xbp) < ((__pyx_v_out_index->locbuf[__pyx_v_outblock]) + __pyx_v_obp)) != 0);
      if (!__pyx_t_12) break;

      /* "pandas/src/sparse.pyx":745
 *         # walk x
 *         while xindex.locbuf[xblock] + xbp < out_index.locbuf[outblock] + obp:
 *             xbp += 1             # <<<<<<<<<<<<<<
 *             xi += 1
 *             if xbp == xindex.lenbuf[xblock]:
 */
      __pyx_v_xbp = (__pyx_v_xbp + 1);

      /* "pandas/src/sparse.pyx":746
 *         while xindex.locbuf[xblock] + xbp < out_index.locbuf[outblock] + obp:
 *             xbp += 1
 *             xi += 1             # <<<<<<<<<<<<<<
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 */
      __pyx_v_xi = (__pyx_v_xi + 1);

      /* "pandas/src/sparse.pyx":747
 *             xbp += 1
 *             xi += 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":748
 *             xi += 1
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1             # <<<<<<<<<<<<<<
 *                 xbp = 0
 * 
 */
        __pyx_v_xblock = (__pyx_v_xblock + 1);

        /* "pandas/src/sparse.pyx":749
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 *                 xbp = 0             # <<<<<<<<<<<<<<
 * 
 *         # walk y
 */
        __pyx_v_xbp = 0;
        goto __pyx_L7;
      }
      __pyx_L7:;
    }

    /* "pandas/src/sparse.pyx":752
 * 
 *         # walk y
 *         while yindex.locbuf[yblock] + ybp < out_index.locbuf[outblock] + obp:             # <<<<<<<<<<<<<<
 *             ybp += 1
 *             yi += 1
 */
    while (1) {
      __pyx_t_12 = ((((__pyx_v_yindex->locbuf[__pyx_v_yblock]) + __pyx_v_ybp) < ((__pyx_v_out_index->locbuf[__pyx_v_outblock]) + __pyx_v_obp)) != 0);
      if (!__pyx_t_12) break;

      /* "pandas/src/sparse.pyx":753
 *         # walk y
 *         while yindex.locbuf[yblock] + ybp < out_index.locbuf[outblock] + obp:
 *             ybp += 1             # <<<<<<<<<<<<<<
 *             yi += 1
 *             if ybp == yindex.lenbuf[yblock]:
 */
      __pyx_v_ybp = (__pyx_v_ybp + 1);

      /* "pandas/src/sparse.pyx":754
 *         while yindex.locbuf[yblock] + ybp < out_index.locbuf[outblock] + obp:
 *             ybp += 1
 *             yi += 1             # <<<<<<<<<<<<<<
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 */
      __pyx_v_yi = (__pyx_v_yi + 1);

      /* "pandas/src/sparse.pyx":755
 *             ybp += 1
 *             yi += 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":756
 *             yi += 1
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1             # <<<<<<<<<<<<<<
 *                 ybp = 0
 * 
 */
        __pyx_v_yblock = (__pyx_v_yblock + 1);

        /* "pandas/src/sparse.pyx":757
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 *                 ybp = 0             # <<<<<<<<<<<<<<
 * 
 *         out[out_i] = op(x[xi], y[yi])
 */
        __pyx_v_ybp = 0;
        goto __pyx_L10;
      }
      __pyx_L10:;
    }

    /* "pandas/src/sparse.pyx":759
 *                 ybp = 0
 * 
 *         out[out_i] = op(x[xi], y[yi])             # <<<<<<<<<<<<<<
 * 
 *         # advance. strikes me as too complicated
 */
    __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_yi;
    if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_y.diminfo[0].shape;
    __pyx_t_15 = __pyx_v_out_i;
    if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_out.diminfo[0].shape;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_out.rcbuffer->pybuffer.buf, __pyx_t_15, __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_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_y.diminfo[0].strides)));

    /* "pandas/src/sparse.pyx":762
 * 
 *         # advance. strikes me as too complicated
 *         xi += 1             # <<<<<<<<<<<<<<
 *         yi += 1
 * 
 */
    __pyx_v_xi = (__pyx_v_xi + 1);

    /* "pandas/src/sparse.pyx":763
 *         # advance. strikes me as too complicated
 *         xi += 1
 *         yi += 1             # <<<<<<<<<<<<<<
 * 
 *         xbp += 1
 */
    __pyx_v_yi = (__pyx_v_yi + 1);

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

    /* "pandas/src/sparse.pyx":766
 * 
 *         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":767
 *         xbp += 1
 *         if xbp == xindex.lenbuf[xblock]:
 *             xblock += 1             # <<<<<<<<<<<<<<
 *             xbp = 0
 * 
 */
      __pyx_v_xblock = (__pyx_v_xblock + 1);

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

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

    /* "pandas/src/sparse.pyx":771
 * 
 *         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":772
 *         ybp += 1
 *         if ybp == yindex.lenbuf[yblock]:
 *             yblock += 1             # <<<<<<<<<<<<<<
 *             ybp = 0
 * 
 */
      __pyx_v_yblock = (__pyx_v_yblock + 1);

      /* "pandas/src/sparse.pyx":773
 *         if ybp == yindex.lenbuf[yblock]:
 *             yblock += 1
 *             ybp = 0             # <<<<<<<<<<<<<<
 * 
 *         obp += 1
 */
      __pyx_v_ybp = 0;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "pandas/src/sparse.pyx":775
 *             ybp = 0
 * 
 *         obp += 1             # <<<<<<<<<<<<<<
 *         if obp == out_index.lenbuf[outblock]:
 *             outblock += 1
 */
    __pyx_v_obp = (__pyx_v_obp + 1);

    /* "pandas/src/sparse.pyx":776
 * 
 *         obp += 1
 *         if obp == out_index.lenbuf[outblock]:             # <<<<<<<<<<<<<<
 *             outblock += 1
 *             obp = 0
 */
    __pyx_t_12 = ((__pyx_v_obp == (__pyx_v_out_index->lenbuf[__pyx_v_outblock])) != 0);
    if (__pyx_t_12) {

      /* "pandas/src/sparse.pyx":777
 *         obp += 1
 *         if obp == out_index.lenbuf[outblock]:
 *             outblock += 1             # <<<<<<<<<<<<<<
 *             obp = 0
 * 
 */
      __pyx_v_outblock = (__pyx_v_outblock + 1);

      /* "pandas/src/sparse.pyx":778
 *         if obp == out_index.lenbuf[outblock]:
 *             outblock += 1
 *             obp = 0             # <<<<<<<<<<<<<<
 * 
 *     return out, out_index
 */
      __pyx_v_obp = 0;
      goto __pyx_L13;
    }
    __pyx_L13:;
  }

  /* "pandas/src/sparse.pyx":780
 *             obp = 0
 * 
 *     return out, out_index             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __Pyx_INCREF(((PyObject *)__pyx_v_out_index));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index));
  __pyx_r = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":719
 * 
 * @cython.boundscheck(False)
 * cdef inline tuple block_nanop(ndarray x_, BlockIndex xindex,             # <<<<<<<<<<<<<<
 *                               ndarray y_, BlockIndex yindex,
 *                               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_nanop", __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":783
 * 
 * @cython.boundscheck(False)
 * cdef inline tuple int_nanop(ndarray x_, IntIndex xindex,             # <<<<<<<<<<<<<<
 *                             ndarray y_, IntIndex yindex,
 *                             double_func op):
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_7_sparse_int_nanop(PyArrayObject *__pyx_v_x_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y_, struct __pyx_obj_6pandas_7_sparse_IntIndex *__pyx_v_yindex, __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;
  PyArrayObject *__pyx_v_xindices = 0;
  PyArrayObject *__pyx_v_yindices = 0;
  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;
  Py_ssize_t __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("int_nanop", 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":788
 *     cdef:
 *         IntIndex out_index
 *         Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices             # <<<<<<<<<<<<<<
 *         ndarray[int32_t, ndim=1] xindices, yindices, out_indices
 *         ndarray[float64_t, ndim=1] x, y
 */
  __pyx_v_xi = 0;
  __pyx_v_yi = 0;
  __pyx_v_out_i = 0;

  /* "pandas/src/sparse.pyx":794
 * 
 *     # 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 = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_x_));
  __pyx_v_x = ((PyArrayObject *)__pyx_v_x_);

  /* "pandas/src/sparse.pyx":795
 *     # 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 = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_y_));
  __pyx_v_y = ((PyArrayObject *)__pyx_v_y_);

  /* "pandas/src/sparse.pyx":798
 * 
 *     # need to do this first to know size of result array
 *     out_index = xindex.intersect(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)->intersect(__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 = 798; __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":799
 *     # need to do this first to know size of result array
 *     out_index = xindex.intersect(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 = 799; __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 = 799; __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 = 799; __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 = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __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 = 799; __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 = 799; __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 = 799; __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 = 799; __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 = 799; __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 = 799; __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":801
 *     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 = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xindices = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":802
 * 
 *     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 = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yindices = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":803
 *     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 = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_out_indices = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":806
 * 
 *     # walk the two SparseVectors, adding matched locations...
 *     for out_i from 0 <= out_i < out_index.npoints:             # <<<<<<<<<<<<<<
 * 
 *         # walk x
 */
  __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":809
 * 
 *         # walk x
 *         while xindices[xi] < out_indices[out_i]:             # <<<<<<<<<<<<<<
 *             xi += 1
 * 
 */
    while (1) {
      __pyx_t_12 = __pyx_v_xi;
      if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_pybuffernd_xindices.diminfo[0].shape;
      __pyx_t_13 = __pyx_v_out_i;
      if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_out_indices.diminfo[0].shape;
      __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_xindices.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_xindices.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_out_indices.diminfo[0].strides))) != 0);
      if (!__pyx_t_14) break;

      /* "pandas/src/sparse.pyx":810
 *         # walk x
 *         while xindices[xi] < out_indices[out_i]:
 *             xi += 1             # <<<<<<<<<<<<<<
 * 
 *         # walk y
 */
      __pyx_v_xi = (__pyx_v_xi + 1);
    }

    /* "pandas/src/sparse.pyx":813
 * 
 *         # walk y
 *         while yindices[yi] < out_indices[out_i]:             # <<<<<<<<<<<<<<
 *             yi += 1
 * 
 */
    while (1) {
      __pyx_t_15 = __pyx_v_yi;
      if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_yindices.diminfo[0].shape;
      __pyx_t_16 = __pyx_v_out_i;
      if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_pybuffernd_out_indices.diminfo[0].shape;
      __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_yindices.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_yindices.diminfo[0].strides)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_out_indices.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_out_indices.diminfo[0].strides))) != 0);
      if (!__pyx_t_14) break;

      /* "pandas/src/sparse.pyx":814
 *         # walk y
 *         while yindices[yi] < out_indices[out_i]:
 *             yi += 1             # <<<<<<<<<<<<<<
 * 
 *         out[out_i] = op(x[xi], y[yi])
 */
      __pyx_v_yi = (__pyx_v_yi + 1);
    }

    /* "pandas/src/sparse.pyx":816
 *             yi += 1
 * 
 *         out[out_i] = op(x[xi], y[yi])             # <<<<<<<<<<<<<<
 * 
 *         # advance
 */
    __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":819
 * 
 *         # advance
 *         xi += 1             # <<<<<<<<<<<<<<
 *         yi += 1
 * 
 */
    __pyx_v_xi = (__pyx_v_xi + 1);

    /* "pandas/src/sparse.pyx":820
 *         # advance
 *         xi += 1
 *         yi += 1             # <<<<<<<<<<<<<<
 * 
 *     return out, out_index
 */
    __pyx_v_yi = (__pyx_v_yi + 1);
  }

  /* "pandas/src/sparse.pyx":822
 *         yi += 1
 * 
 *     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 = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __Pyx_INCREF(((PyObject *)__pyx_v_out_index));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index));
  __pyx_r = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":783
 * 
 * @cython.boundscheck(False)
 * cdef inline tuple int_nanop(ndarray x_, IntIndex xindex,             # <<<<<<<<<<<<<<
 *                             ndarray y_, IntIndex yindex,
 *                             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_nanop", __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":826
 * 
 * @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":835
 *     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":836
 *         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":838
 *         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":844
 * 
 *     # 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 = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_x_));
  __pyx_v_x = ((PyArrayObject *)__pyx_v_x_);

  /* "pandas/src/sparse.pyx":845
 *     # 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 = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_y_));
  __pyx_v_y = ((PyArrayObject *)__pyx_v_y_);

  /* "pandas/src/sparse.pyx":847
 *     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 = 847; __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":848
 * 
 *     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 = 848; __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 = 848; __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 = 848; __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 = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __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 = 848; __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 = 848; __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 = 848; __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 = 848; __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 = 848; __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 = 848; __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":853
 * 
 *     # 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":854
 *     # 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":856
 *         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":857
 *             # 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":860
 * 
 *             # advance x location
 *             xbp += 1             # <<<<<<<<<<<<<<
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 */
      __pyx_v_xbp = (__pyx_v_xbp + 1);

      /* "pandas/src/sparse.pyx":861
 *             # 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":862
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1             # <<<<<<<<<<<<<<
 *                 xbp = 0
 *             continue
 */
        __pyx_v_xblock = (__pyx_v_xblock + 1);

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

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

    /* "pandas/src/sparse.pyx":866
 *             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":868
 *         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":869
 *             # 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":872
 * 
 *             # advance y location
 *             ybp += 1             # <<<<<<<<<<<<<<
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 */
      __pyx_v_ybp = (__pyx_v_ybp + 1);

      /* "pandas/src/sparse.pyx":873
 *             # 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":874
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1             # <<<<<<<<<<<<<<
 *                 ybp = 0
 *             continue
 */
        __pyx_v_yblock = (__pyx_v_yblock + 1);

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

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

    /* "pandas/src/sparse.pyx":878
 *             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":879
 * 
 *         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":882
 * 
 *         # 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":883
 *         # 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":884
 *         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":885
 *             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":888
 * 
 *             # advance both locations
 *             xbp += 1             # <<<<<<<<<<<<<<
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 */
      __pyx_v_xbp = (__pyx_v_xbp + 1);

      /* "pandas/src/sparse.pyx":889
 *             # 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":890
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1             # <<<<<<<<<<<<<<
 *                 xbp = 0
 * 
 */
        __pyx_v_xblock = (__pyx_v_xblock + 1);

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

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

      /* "pandas/src/sparse.pyx":894
 * 
 *             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":895
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1             # <<<<<<<<<<<<<<
 *                 ybp = 0
 * 
 */
        __pyx_v_yblock = (__pyx_v_yblock + 1);

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

    /* "pandas/src/sparse.pyx":898
 *                 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":900
 *         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":901
 *             # 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":904
 * 
 *             # advance x location
 *             xbp += 1             # <<<<<<<<<<<<<<
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 */
      __pyx_v_xbp = (__pyx_v_xbp + 1);

      /* "pandas/src/sparse.pyx":905
 *             # 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":906
 *             xbp += 1
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1             # <<<<<<<<<<<<<<
 *                 xbp = 0
 *         else:
 */
        __pyx_v_xblock = (__pyx_v_xblock + 1);

        /* "pandas/src/sparse.pyx":907
 *             if xbp == xindex.lenbuf[xblock]:
 *                 xblock += 1
 *                 xbp = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # use x fill value
 */
        __pyx_v_xbp = 0;
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pandas/src/sparse.pyx":910
 *         else:
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])             # <<<<<<<<<<<<<<
 *             yi += 1
 * 
 */
      __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":911
 *             # 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":914
 * 
 *             # advance y location
 *             ybp += 1             # <<<<<<<<<<<<<<
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 */
      __pyx_v_ybp = (__pyx_v_ybp + 1);

      /* "pandas/src/sparse.pyx":915
 *             # 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":916
 *             ybp += 1
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1             # <<<<<<<<<<<<<<
 *                 ybp = 0
 * 
 */
        __pyx_v_yblock = (__pyx_v_yblock + 1);

        /* "pandas/src/sparse.pyx":917
 *             if ybp == yindex.lenbuf[yblock]:
 *                 yblock += 1
 *                 ybp = 0             # <<<<<<<<<<<<<<
 * 
 *     return out, out_index
 */
        __pyx_v_ybp = 0;
        goto __pyx_L13;
      }
      __pyx_L13:;
    }
    __pyx_L9:;
    __pyx_L3_continue:;
  }

  /* "pandas/src/sparse.pyx":919
 *                 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 = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __Pyx_INCREF(((PyObject *)__pyx_v_out_index));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index));
  __pyx_r = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":826
 * 
 * @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":923
 * 
 * @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":928
 *     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":935
 * 
 *     # 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 = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_x_));
  __pyx_v_x = ((PyArrayObject *)__pyx_v_x_);

  /* "pandas/src/sparse.pyx":936
 *     # 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 = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_y_));
  __pyx_v_y = ((PyArrayObject *)__pyx_v_y_);

  /* "pandas/src/sparse.pyx":939
 * 
 *     # 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 = 939; __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":940
 *     # 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 = 940; __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 = 940; __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 = 940; __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 = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __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 = 940; __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 = 940; __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 = 940; __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 = 940; __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 = 940; __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 = 940; __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":942
 *     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 = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xindices = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":943
 * 
 *     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 = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_yindices = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":944
 *     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 = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_out_indices = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "pandas/src/sparse.pyx":947
 * 
 *     # 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":948
 *     # 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":950
 *         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":951
 *             # 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":952
 *             out[out_i] = op(xfill, y[yi])
 *             yi += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         if yi == yindex.npoints:
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/sparse.pyx":954
 *             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":956
 *         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":957
 *             # 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":958
 *             out[out_i] = op(x[xi], yfill)
 *             xi += 1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         xloc = xindices[xi]
 */
      goto __pyx_L3_continue;
    }

    /* "pandas/src/sparse.pyx":960
 *             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":961
 * 
 *         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":964
 * 
 *         # 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":965
 *         # 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":966
 *         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":967
 *             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);
      goto __pyx_L7;
    }

    /* "pandas/src/sparse.pyx":968
 *             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":970
 *         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":971
 *             # 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);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/sparse.pyx":974
 *         else:
 *             # use x fill value
 *             out[out_i] = op(xfill, y[yi])             # <<<<<<<<<<<<<<
 *             yi += 1
 * 
 */
      __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":975
 *             # 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":977
 *             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 = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __Pyx_INCREF(((PyObject *)__pyx_v_out_index));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_out_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out_index));
  __pyx_r = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":923
 * 
 * @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":979
 *     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":980
 * 
 * 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":979
 *     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":982
 *     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":983
 * 
 * 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":982
 *     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":985
 *     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":986
 * 
 * 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":985
 *     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":988
 *     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":989
 * 
 * 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":990
 * 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":991
 *     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":992
 *         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":993
 *             return INF
 *         elif a < 0:
 *             return -INF             # <<<<<<<<<<<<<<
 *         else:
 *             return NaN
 */
      __pyx_r = (-__pyx_v_6pandas_7_sparse_INF);
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/sparse.pyx":995
 *             return -INF
 *         else:
 *             return NaN             # <<<<<<<<<<<<<<
 *     else:
 *         return a / b
 */
      __pyx_r = __pyx_v_6pandas_7_sparse_NaN;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/sparse.pyx":997
 *             return NaN
 *     else:
 *         return a / b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __rdiv(float64_t a, float64_t b):
 */
    if (unlikely(__pyx_v_b == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_r = (__pyx_v_a / __pyx_v_b);
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":988
 *     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);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":999
 *         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":1000
 * 
 * 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":999
 *         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":1002
 *     return __div(b, a)
 * 
 * cdef inline float64_t __floordiv(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___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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__floordiv", 0);

  /* "pandas/src/sparse.pyx":1003
 * 
 * cdef inline float64_t __floordiv(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":1004
 * cdef inline float64_t __floordiv(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":1005
 *     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":1006
 *         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":1007
 *             return INF
 *         elif a < 0:
 *             return -INF             # <<<<<<<<<<<<<<
 *         else:
 *             return NaN
 */
      __pyx_r = (-__pyx_v_6pandas_7_sparse_INF);
      goto __pyx_L0;
    }
    /*else*/ {

      /* "pandas/src/sparse.pyx":1009
 *             return -INF
 *         else:
 *             return NaN             # <<<<<<<<<<<<<<
 *     else:
 *         return a // b
 */
      __pyx_r = __pyx_v_6pandas_7_sparse_NaN;
      goto __pyx_L0;
    }
  }
  /*else*/ {

    /* "pandas/src/sparse.pyx":1011
 *             return NaN
 *     else:
 *         return a // b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __rfloordiv(float64_t a, float64_t b):
 */
    if (unlikely(__pyx_v_b == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_r = floor(__pyx_v_a / __pyx_v_b);
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":1002
 *     return __div(b, a)
 * 
 * cdef inline float64_t __floordiv(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     if b == 0:
 *         if a > 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pandas._sparse.__floordiv", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1013
 *         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":1014
 * 
 * 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":1013
 *         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":1016
 *     return __floordiv(b, a)
 * 
 * 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):
 */

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":1017
 * 
 * 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):
 *     return a == b
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1016
 *     return __floordiv(b, a)
 * 
 * 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):
 */

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

/* "pandas/src/sparse.pyx":1018
 * 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):             # <<<<<<<<<<<<<<
 *     return a == b
 * cdef inline float64_t __ne(float64_t a, float64_t 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":1019
 *     return a * b
 * 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):
 *     return a != b
 */
  __pyx_r = (__pyx_v_a == __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1018
 * 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):             # <<<<<<<<<<<<<<
 *     return a == b
 * cdef inline float64_t __ne(float64_t a, float64_t b):
 */

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

/* "pandas/src/sparse.pyx":1020
 * 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):             # <<<<<<<<<<<<<<
 *     return a != b
 * cdef inline float64_t __lt(float64_t a, float64_t 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":1021
 *     return a == b
 * 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):
 *     return a < b
 */
  __pyx_r = (__pyx_v_a != __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1020
 * 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):             # <<<<<<<<<<<<<<
 *     return a != b
 * cdef inline float64_t __lt(float64_t a, float64_t b):
 */

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

/* "pandas/src/sparse.pyx":1022
 * 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):             # <<<<<<<<<<<<<<
 *     return a < b
 * cdef inline float64_t __gt(float64_t a, float64_t 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":1023
 *     return a != b
 * 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):
 *     return a > b
 */
  __pyx_r = (__pyx_v_a < __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1022
 * 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):             # <<<<<<<<<<<<<<
 *     return a < b
 * cdef inline float64_t __gt(float64_t a, float64_t b):
 */

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

/* "pandas/src/sparse.pyx":1024
 * 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):             # <<<<<<<<<<<<<<
 *     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":1025
 *     return a < b
 * cdef inline float64_t __gt(float64_t a, float64_t b):
 *     return a > b             # <<<<<<<<<<<<<<
 * 
 * cdef inline float64_t __pow(float64_t a, float64_t b):
 */
  __pyx_r = (__pyx_v_a > __pyx_v_b);
  goto __pyx_L0;

  /* "pandas/src/sparse.pyx":1024
 * 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):             # <<<<<<<<<<<<<<
 *     return a > b
 * 
 */

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

/* "pandas/src/sparse.pyx":1027
 *     return a > b
 * 
 * cdef inline float64_t __pow(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     # NaN
 *     if a != a or b != 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
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__pow", 0);

  /* "pandas/src/sparse.pyx":1029
 * cdef inline float64_t __pow(float64_t a, float64_t b):
 *     # NaN
 *     if a != a or b != b:             # <<<<<<<<<<<<<<
 *         return NaN
 *     return a ** b
 */
  __pyx_t_2 = ((__pyx_v_a != __pyx_v_a) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_b != __pyx_v_b) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pandas/src/sparse.pyx":1030
 *     # NaN
 *     if a != a or b != b:
 *         return NaN             # <<<<<<<<<<<<<<
 *     return a ** b
 * 
 */
    __pyx_r = __pyx_v_6pandas_7_sparse_NaN;
    goto __pyx_L0;
  }

  /* "pandas/src/sparse.pyx":1031
 *     if a != a or b != b:
 *         return NaN
 *     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":1027
 *     return a > b
 * 
 * cdef inline float64_t __pow(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 *     # NaN
 *     if a != a or b != b:
 */

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

/* "pandas/src/sparse.pyx":1033
 *     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":1034
 * 
 * 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":1033
 *     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":1040
 * # TODO: quantify performance boost to "templating"
 * 
 * cpdef sparse_nanadd(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __add)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_nanadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanadd(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nanadd", 0);

  /* "pandas/src/sparse.pyx":1042
 * cpdef sparse_nanadd(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __add)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_nansub(ndarray x, SparseIndex xindex,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __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":1040
 * # TODO: quantify performance boost to "templating"
 * 
 * cpdef sparse_nanadd(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __add)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nanadd", __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_nanadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_3sparse_nanadd(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nanadd (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nanadd", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __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_nanadd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nanadd", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_nanadd", __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 = 1040; __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 = 1040; __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 = 1041; __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 = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_2sparse_nanadd(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nanadd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nanadd", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanadd(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __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_nanadd", __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
 *     return sparse_nancombine(x, xindex, y, yindex, __add)
 * 
 * cpdef sparse_nansub(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __sub)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_nansub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nansub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nansub", 0);

  /* "pandas/src/sparse.pyx":1046
 * cpdef sparse_nansub(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __sub)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___sub); 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
 *     return sparse_nancombine(x, xindex, y, yindex, __add)
 * 
 * cpdef sparse_nansub(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __sub)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nansub", __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_nansub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_5sparse_nansub(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nansub (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nansub", 1, 4, 4, 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_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, 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_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, 3); {__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_nansub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nansub", 1, 4, 4, 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_nansub", __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_4sparse_nansub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nansub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nansub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nansub(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 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_nansub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1048
 *     return sparse_nancombine(x, xindex, y, yindex, __sub)
 * 
 * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rsub)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_nanrsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrsub(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nanrsub", 0);

  /* "pandas/src/sparse.pyx":1050
 * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rsub)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_nanmul(ndarray x, SparseIndex xindex,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rsub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __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":1048
 *     return sparse_nancombine(x, xindex, y, yindex, __sub)
 * 
 * cpdef sparse_nanrsub(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rsub)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nanrsub", __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_nanrsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_7sparse_nanrsub(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nanrsub (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nanrsub", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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_nanrsub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nanrsub", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_nanrsub", __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 = 1048; __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 = 1048; __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 = 1049; __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 = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_6sparse_nanrsub(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nanrsub(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nanrsub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrsub(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __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_nanrsub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1052
 *     return sparse_nancombine(x, xindex, y, yindex, __rsub)
 * 
 * cpdef sparse_nanmul(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __mul)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_nanmul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanmul(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nanmul", 0);

  /* "pandas/src/sparse.pyx":1054
 * cpdef sparse_nanmul(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __mul)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_nandiv(ndarray x, SparseIndex xindex,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___mul); 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;

  /* "pandas/src/sparse.pyx":1052
 *     return sparse_nancombine(x, xindex, y, yindex, __rsub)
 * 
 * cpdef sparse_nanmul(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __mul)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nanmul", __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_nanmul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_9sparse_nanmul(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nanmul (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nanmul", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __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_nanmul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nanmul", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_nanmul", __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 = 1052; __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 = 1052; __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 = 1053; __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 = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_8sparse_nanmul(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nanmul(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nanmul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanmul(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __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_nanmul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1056
 *     return sparse_nancombine(x, xindex, y, yindex, __mul)
 * 
 * cpdef sparse_nandiv(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __div)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_nandiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nandiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nandiv", 0);

  /* "pandas/src/sparse.pyx":1058
 * cpdef sparse_nandiv(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __div)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __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":1056
 *     return sparse_nancombine(x, xindex, y, yindex, __mul)
 * 
 * cpdef sparse_nandiv(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __div)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nandiv", __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_nandiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_11sparse_nandiv(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nandiv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nandiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __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_nandiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nandiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_nandiv", __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 = 1056; __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 = 1056; __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 = 1057; __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 = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_10sparse_nandiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nandiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nandiv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nandiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); 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;

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

/* "pandas/src/sparse.pyx":1060
 *     return sparse_nancombine(x, xindex, y, yindex, __div)
 * 
 * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rdiv)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrdiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nanrdiv", 0);

  /* "pandas/src/sparse.pyx":1062
 * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rdiv)             # <<<<<<<<<<<<<<
 * 
 * sparse_nantruediv = sparse_nandiv
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __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":1060
 *     return sparse_nancombine(x, xindex, y, yindex, __div)
 * 
 * cpdef sparse_nanrdiv(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rdiv)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nanrdiv", __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_nanrdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nanrdiv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nanrdiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __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_nanrdiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nanrdiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_nanrdiv", __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 = 1060; __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 = 1060; __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 = 1061; __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 = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_12sparse_nanrdiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nanrdiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nanrdiv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrdiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __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_nanrdiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1067
 * sparse_nanrtruediv = sparse_nanrdiv
 * 
 * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __floordiv)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanfloordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nanfloordiv", 0);

  /* "pandas/src/sparse.pyx":1069
 * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __floordiv)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___floordiv); 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;

  /* "pandas/src/sparse.pyx":1067
 * sparse_nanrtruediv = sparse_nanrdiv
 * 
 * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __floordiv)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nanfloordiv", __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_nanfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nanfloordiv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nanfloordiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __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_nanfloordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nanfloordiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_nanfloordiv", __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 = 1067; __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 = 1067; __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 = 1068; __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 = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_14sparse_nanfloordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nanfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nanfloordiv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanfloordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __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_nanfloordiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1071
 *     return sparse_nancombine(x, xindex, y, yindex, __floordiv)
 * 
 * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rfloordiv)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrfloordiv(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nanrfloordiv", 0);

  /* "pandas/src/sparse.pyx":1073
 * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rfloordiv)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_nanpow(ndarray x, SparseIndex xindex,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rfloordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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":1071
 *     return sparse_nancombine(x, xindex, y, yindex, __floordiv)
 * 
 * cpdef sparse_nanrfloordiv(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rfloordiv)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nanrfloordiv", __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_nanrfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nanrfloordiv (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nanrfloordiv", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __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_nanrfloordiv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nanrfloordiv", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_nanrfloordiv", __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 = 1071; __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 = 1071; __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 = 1072; __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 = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_16sparse_nanrfloordiv(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nanrfloordiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nanrfloordiv", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrfloordiv(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); 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;

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

/* "pandas/src/sparse.pyx":1075
 *     return sparse_nancombine(x, xindex, y, yindex, __rfloordiv)
 * 
 * cpdef sparse_nanpow(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __pow)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_nanpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanpow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nanpow", 0);

  /* "pandas/src/sparse.pyx":1077
 * cpdef sparse_nanpow(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __pow)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___pow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __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":1075
 *     return sparse_nancombine(x, xindex, y, yindex, __rfloordiv)
 * 
 * cpdef sparse_nanpow(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __pow)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nanpow", __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_nanpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_19sparse_nanpow(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nanpow (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nanpow", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __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_nanpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nanpow", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_nanpow", __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 = 1075; __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 = 1075; __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 = 1076; __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 = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_18sparse_nanpow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nanpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nanpow", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanpow(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __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_nanpow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1079
 *     return sparse_nancombine(x, xindex, y, yindex, __pow)
 * 
 * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rpow)
 */

static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_nanrpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_7_sparse_sparse_nanrpow(PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex, 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_nanrpow", 0);

  /* "pandas/src/sparse.pyx":1081
 * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex,
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rpow)             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_add(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nancombine(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, __pyx_f_6pandas_7_sparse___rpow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __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":1079
 *     return sparse_nancombine(x, xindex, y, yindex, __pow)
 * 
 * cpdef sparse_nanrpow(ndarray x, SparseIndex xindex,             # <<<<<<<<<<<<<<
 *                     ndarray y, SparseIndex yindex):
 *     return sparse_nancombine(x, xindex, y, yindex, __rpow)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas._sparse.sparse_nanrpow", __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_nanrpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_21sparse_nanrpow(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;
  PyArrayObject *__pyx_v_y = 0;
  struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sparse_nanrpow (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xindex,&__pyx_n_s_y,&__pyx_n_s_yindex,0};
    PyObject* values[4] = {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  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_nanrpow", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __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_nanrpow") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = ((PyArrayObject *)values[0]);
    __pyx_v_xindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[1]);
    __pyx_v_y = ((PyArrayObject *)values[2]);
    __pyx_v_yindex = ((struct __pyx_obj_6pandas_7_sparse_SparseIndex *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sparse_nanrpow", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas._sparse.sparse_nanrpow", __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 = 1079; __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 = 1079; __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 = 1080; __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 = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_20sparse_nanrpow(__pyx_self, __pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex);

  /* 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_nanrpow(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_xindex, PyArrayObject *__pyx_v_y, struct __pyx_obj_6pandas_7_sparse_SparseIndex *__pyx_v_yindex) {
  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_nanrpow", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_7_sparse_sparse_nanrpow(__pyx_v_x, __pyx_v_xindex, __pyx_v_y, __pyx_v_yindex, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __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_nanrpow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/sparse.pyx":1083
 *     return sparse_nancombine(x, xindex, y, yindex, __rpow)
 * 
 * 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_23sparse_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":1085
 * 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":1086
 *                  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 = 1085; __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":1083
 *     return sparse_nancombine(x, xindex, y, yindex, __rpow)
 * 
 * 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_23sparse_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_23sparse_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 = 1083; __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 = 1083; __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 = 1083; __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 = 1083; __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 = 1083; __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 = 1083; __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 = 1083; __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 = 1084; __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 = 1083; __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 = 1083; __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 = 1083; __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 = 1084; __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 = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_22sparse_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_22sparse_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 = 1083; __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":1088
 *                              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_25sparse_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":1090
 * 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":1091
 *                  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 = 1090; __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":1088
 *                              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_25sparse_sub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_25sparse_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 = 1088; __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 = 1088; __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 = 1088; __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 = 1088; __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 = 1088; __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 = 1088; __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 = 1088; __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 = 1089; __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 = 1088; __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 = 1088; __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 = 1088; __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 = 1089; __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 = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_24sparse_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_24sparse_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 = 1088; __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":1093
 *                              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_27sparse_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":1095
 * 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":1096
 *                  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 = 1095; __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":1093
 *                              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_27sparse_rsub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_27sparse_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 = 1093; __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 = 1093; __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 = 1093; __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 = 1093; __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 = 1093; __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 = 1093; __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 = 1093; __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 = 1094; __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 = 1093; __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 = 1093; __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 = 1093; __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 = 1094; __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 = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_26sparse_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_26sparse_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 = 1093; __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":1098
 *                              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_29sparse_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":1100
 * 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":1101
 *                  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 = 1100; __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":1098
 *                              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_29sparse_mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_29sparse_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 = 1098; __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 = 1098; __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 = 1098; __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 = 1098; __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 = 1098; __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 = 1098; __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 = 1098; __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 = 1099; __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 = 1098; __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 = 1098; __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 = 1098; __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 = 1099; __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 = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_28sparse_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_28sparse_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 = 1098; __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":1103
 *                              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_31sparse_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":1105
 * 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":1106
 *                  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 = 1105; __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":1103
 *                              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_31sparse_div(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_31sparse_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 = 1103; __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 = 1103; __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 = 1103; __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 = 1103; __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 = 1103; __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 = 1103; __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 = 1103; __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 = 1104; __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 = 1103; __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 = 1103; __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 = 1103; __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 = 1104; __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 = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_30sparse_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_30sparse_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 = 1103; __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":1108
 *                              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_33sparse_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":1110
 * 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":1111
 *                  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 = 1110; __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":1108
 *                              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_33sparse_rdiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_33sparse_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 = 1108; __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 = 1108; __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 = 1108; __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 = 1108; __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 = 1108; __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 = 1108; __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 = 1108; __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 = 1109; __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 = 1108; __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 = 1108; __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 = 1108; __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 = 1109; __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 = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_32sparse_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_32sparse_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 = 1108; __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":1116
 * 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_35sparse_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":1118
 * 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":1119
 *                  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 = 1118; __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":1116
 * 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_35sparse_floordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_35sparse_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 = 1116; __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 = 1116; __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 = 1116; __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 = 1116; __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 = 1116; __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 = 1116; __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 = 1116; __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 = 1117; __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 = 1116; __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 = 1116; __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 = 1116; __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 = 1117; __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 = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_34sparse_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_34sparse_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 = 1116; __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":1121
 *                              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_37sparse_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":1123
 * 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":1124
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                              y, yindex, yfill, __rfloordiv)             # <<<<<<<<<<<<<<
 * 
 * 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___rfloordiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __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":1121
 *                              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_37sparse_rfloordiv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_37sparse_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 = 1121; __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 = 1121; __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 = 1121; __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 = 1121; __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 = 1121; __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 = 1121; __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 = 1121; __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 = 1122; __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 = 1121; __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 = 1121; __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 = 1121; __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 = 1122; __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 = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_36sparse_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_36sparse_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 = 1121; __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":1126
 *                              y, yindex, yfill, __rfloordiv)
 * 
 * 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_39sparse_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":1128
 * 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":1129
 *                  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 = 1128; __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":1126
 *                              y, yindex, yfill, __rfloordiv)
 * 
 * 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_39sparse_pow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_39sparse_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 = 1126; __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 = 1126; __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 = 1126; __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 = 1126; __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 = 1126; __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 = 1126; __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 = 1126; __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 = 1127; __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 = 1126; __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 = 1126; __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 = 1126; __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 = 1127; __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 = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_38sparse_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_38sparse_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 = 1126; __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":1131
 *                              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_41sparse_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":1133
 * 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":1134
 *                  ndarray y, SparseIndex yindex, float64_t yfill):
 *     return sparse_combine(x, xindex, xfill,
 *                              y, yindex, yfill, __rpow)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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 = 1133; __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":1131
 *                              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_41sparse_rpow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6pandas_7_sparse_41sparse_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 = 1131; __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 = 1131; __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 = 1131; __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 = 1131; __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 = 1131; __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 = 1131; __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 = 1131; __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 = 1132; __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 = 1131; __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 = 1131; __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 = 1131; __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 = 1132; __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 = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_40sparse_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_40sparse_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 = 1131; __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":1140
 * # 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_43get_reindexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_7_sparse_43get_reindexer = {"get_reindexer", (PyCFunction)__pyx_pw_6pandas_7_sparse_43get_reindexer, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_7_sparse_43get_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 = 1140; __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 = 1140; __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 = 1140; __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 = 1140; __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 = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_42get_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_42get_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 = 1140; __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":1143
 *     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 = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_new_length = __pyx_t_1;

  /* "pandas/src/sparse.pyx":1146
 *     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 = 1146; __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 = 1146; __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 = 1146; __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 = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __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 = 1146; __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 = 1146; __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 = 1146; __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 = 1146; __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 = 1146; __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 = 1146; __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":1148
 *     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":1149
 * 
 *     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 = 1149; __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":1150
 *     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 = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = (__Pyx_PyDict_Contains(__pyx_v_idx, __pyx_v_index_map, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = (__pyx_t_14 != 0);
    if (__pyx_t_15) {

      /* "pandas/src/sparse.pyx":1151
 *         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 = 1151; __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 = 1151; __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 = 1151; __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 = 1151; __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;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pandas/src/sparse.pyx":1153
 *             indexer[i] = index_map[idx]
 *         else:
 *             indexer[i] = -1             # <<<<<<<<<<<<<<
 * 
 *     return indexer
 */
      __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 = 1153; __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":1155
 *             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":1140
 * # 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":1187
 * 
 * 
 * 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_45reindex_integer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_7_sparse_45reindex_integer = {"reindex_integer", (PyCFunction)__pyx_pw_6pandas_7_sparse_45reindex_integer, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6pandas_7_sparse_45reindex_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 = 1187; __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 = 1187; __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 = 1187; __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 = 1187; __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 = 1187; __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 = 1188; __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 = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6pandas_7_sparse_44reindex_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_44reindex_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 = 1187; __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 = 1187; __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;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "numpy.pxd":213
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __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:;
  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__8, 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":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:;
  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__9, 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":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]);
    }
    goto __pyx_L11;
  }
  /*else*/ {

    /* "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
 */
    __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;
    goto __pyx_L14;
  }
  /*else*/ {

    /* "numpy.pxd":253
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __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:;
    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__10, 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":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)
 */
    switch (__pyx_v_t) {

      /* "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"
 */
      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);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __Pyx_GIVEREF(__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;
  }
  /*else*/ {

    /* "numpy.pxd":282
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "numpy.pxd":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 + 255), (&__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);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "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);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "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;}
    #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__11, 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":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:;
    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__12, 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":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]) = 120;

      /* "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__13, 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":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 = PyInt_FromLong(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 = PyInt_FromLong(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 = PyInt_FromLong(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]) = 104;
        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 = PyInt_FromLong(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 = PyInt_FromLong(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]) = 105;
        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 = PyInt_FromLong(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 = PyInt_FromLong(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]) = 108;
        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 = PyInt_FromLong(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 = PyInt_FromLong(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]) = 113;
        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 = PyInt_FromLong(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 = PyInt_FromLong(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]) = 102;
        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 = PyInt_FromLong(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]) = 100;
        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 = PyInt_FromLong(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]) = 103;
        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 = PyInt_FromLong(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]) = 102;
        __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 = PyInt_FromLong(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]) = 100;
        __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 = PyInt_FromLong(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]) = 103;
        __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 = PyInt_FromLong(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;
      }
      /*else*/ {

        /* "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:
 */
        __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);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
        __Pyx_GIVEREF(__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);
      goto __pyx_L13;
    }
    /*else*/ {

      /* "numpy.pxd":853
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __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;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":975
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
    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;
  }
  /*else*/ {

    /* "numpy.pxd":984
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
    __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*/
  #else
  0, /*reserved*/
  #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, 0},
  {"reindex", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_23reindex, METH_VARARGS|METH_KEYWORDS, 0},
  {"put", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_25put, METH_VARARGS|METH_KEYWORDS, 0},
  {"take", (PyCFunction)__pyx_pw_6pandas_7_sparse_8IntIndex_27take, 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*/
  #else
  0, /*reserved*/
  #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},
  {"reindex", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_23reindex, METH_VARARGS|METH_KEYWORDS, 0},
  {"put", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_25put, METH_VARARGS|METH_KEYWORDS, 0},
  {"take", (PyCFunction)__pyx_pw_6pandas_7_sparse_10BlockIndex_27take, 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*/
  #else
  0, /*reserved*/
  #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*/
  #else
  0, /*reserved*/
  #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*/
  #else
  0, /*reserved*/
  #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*/
  #else
  0, /*reserved*/
  #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_nanadd", (PyCFunction)__pyx_pw_6pandas_7_sparse_3sparse_nanadd, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_nansub", (PyCFunction)__pyx_pw_6pandas_7_sparse_5sparse_nansub, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_nanrsub", (PyCFunction)__pyx_pw_6pandas_7_sparse_7sparse_nanrsub, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_nanmul", (PyCFunction)__pyx_pw_6pandas_7_sparse_9sparse_nanmul, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_nandiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_11sparse_nandiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_nanrdiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_13sparse_nanrdiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_nanfloordiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_15sparse_nanfloordiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_nanrfloordiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_17sparse_nanrfloordiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_nanpow", (PyCFunction)__pyx_pw_6pandas_7_sparse_19sparse_nanpow, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_nanrpow", (PyCFunction)__pyx_pw_6pandas_7_sparse_21sparse_nanrpow, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_add", (PyCFunction)__pyx_pw_6pandas_7_sparse_23sparse_add, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_sub", (PyCFunction)__pyx_pw_6pandas_7_sparse_25sparse_sub, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_rsub", (PyCFunction)__pyx_pw_6pandas_7_sparse_27sparse_rsub, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_mul", (PyCFunction)__pyx_pw_6pandas_7_sparse_29sparse_mul, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_div", (PyCFunction)__pyx_pw_6pandas_7_sparse_31sparse_div, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_rdiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_33sparse_rdiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_floordiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_35sparse_floordiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_rfloordiv", (PyCFunction)__pyx_pw_6pandas_7_sparse_37sparse_rfloordiv, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_pow", (PyCFunction)__pyx_pw_6pandas_7_sparse_39sparse_pow, METH_VARARGS|METH_KEYWORDS, 0},
  {"sparse_rpow", (PyCFunction)__pyx_pw_6pandas_7_sparse_41sparse_rpow, 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_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_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_kp_s_Users_jreback_pandas_pandas_src, __pyx_k_Users_jreback_pandas_pandas_src, sizeof(__pyx_k_Users_jreback_pandas_pandas_src), 0, 0, 1, 0},
  {&__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_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_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_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_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_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_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_nandiv, __pyx_k_sparse_nandiv, sizeof(__pyx_k_sparse_nandiv), 0, 0, 1, 1},
  {&__pyx_n_s_sparse_nanrdiv, __pyx_k_sparse_nanrdiv, sizeof(__pyx_k_sparse_nanrdiv), 0, 0, 1, 1},
  {&__pyx_n_s_sparse_nanrtruediv, __pyx_k_sparse_nanrtruediv, sizeof(__pyx_k_sparse_nanrtruediv), 0, 0, 1, 1},
  {&__pyx_n_s_sparse_nantruediv, __pyx_k_sparse_nantruediv, sizeof(__pyx_k_sparse_nantruediv), 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_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_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 = 79; __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 = 30; __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 = 102; __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 = 322; __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 = 1148; __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":102
 * 
 *         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 = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "pandas/src/sparse.pyx":136
 * 
 *         if self.length != y.length:
 *             raise Exception('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         xindices = self.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 = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "pandas/src/sparse.pyx":322
 * 
 *         if len(blocs) != len(blengths):
 *             raise ValueError('block bound arrays must be same length')             # <<<<<<<<<<<<<<
 * 
 *         for i from 0 <= i < self.nblocks:
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_block_bound_arrays_must_be_same); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "pandas/src/sparse.pyx":327
 *             if i > 0:
 *                 if blocs[i] <= blocs[i-1]:
 *                     raise ValueError('Locations not in ascending order')             # <<<<<<<<<<<<<<
 * 
 *             if i < self.nblocks - 1:
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Locations_not_in_ascending_order); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "pandas/src/sparse.pyx":396
 * 
 *         if self.length != y.length:
 *             raise Exception('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         xloc = self.blocs
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_reference_same_unde); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "pandas/src/sparse.pyx":542
 * 
 *         if x.length != y.length:
 *             raise Exception('Indices must reference same underlying length')             # <<<<<<<<<<<<<<
 * 
 *         self.xstart = self.x.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 = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "pandas/src/sparse.pyx":632
 * 
 *         if mode != 0 and mode != 1:
 *             raise Exception('Mode must be 0 or 1')             # <<<<<<<<<<<<<<
 * 
 *         # so symmetric code will work
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Mode_must_be_0_or_1); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "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__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "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__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "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__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "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__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "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__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 = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "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__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "pandas/src/sparse.pyx":1140
 * # Indexing operations
 * 
 * def get_reindexer(ndarray[object, ndim=1] values, dict index_map):             # <<<<<<<<<<<<<<
 *     cdef object idx
 *     cdef Py_ssize_t i
 */
  __pyx_tuple__14 = 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__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_src, __pyx_n_s_get_reindexer, 1140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/sparse.pyx":1187
 * 
 * 
 * def reindex_integer(ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                     IntIndex sparse_index,
 *                     ndarray[int32_t, ndim=1] indexer):
 */
  __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_values, __pyx_n_s_sparse_index, __pyx_n_s_indexer); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_jreback_pandas_pandas_src, __pyx_n_s_reindex_integer, 1187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __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_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;
  __pyx_t_5numpy_float64_t __pyx_t_3;
  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_Generator_USED
  if (__pyx_Generator_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 (unlikely(__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 (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__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 = 25; __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 = 25; __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 = (PyObject *(*)(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.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 = 33; __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 = 33; __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 = 33; __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 = (PyObject *(*)(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.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 = 259; __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 = 259; __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 = 259; __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 = 527; __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 = 527; __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 = 527; __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 = 569; __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 = 569; __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 = 569; __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 = 575; __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 = 575; __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 = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_7_sparse_BlockUnion = &__pyx_type_6pandas_7_sparse_BlockUnion;
  /*--- Type import code ---*/
  __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 ---*/

  /* "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             # <<<<<<<<<<<<<<
 * 
 * np.import_array()
 */
  __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
 * 
 * np.import_array()             # <<<<<<<<<<<<<<
 * np.import_ufunc()
 * 
 */
  import_array();

  /* "pandas/src/sparse.pyx":11
 * 
 * np.import_array()
 * np.import_ufunc()             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  import_ufunc();

  /* "pandas/src/sparse.pyx":16
 * # Preamble stuff
 * 
 * cdef float64_t NaN = <float64_t> np.NaN             # <<<<<<<<<<<<<<
 * cdef float64_t INF = <float64_t> np.inf
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NaN); 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_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_7_sparse_NaN = ((__pyx_t_5numpy_float64_t)__pyx_t_3);

  /* "pandas/src/sparse.pyx":17
 * 
 * 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); 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_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_7_sparse_INF = ((__pyx_t_5numpy_float64_t)__pyx_t_3);

  /* "pandas/src/sparse.pyx":80
 * 
 *     @property
 *     def ngaps(self):             # <<<<<<<<<<<<<<
 *         return self.length - self.npoints
 * 
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex, __pyx_n_s_ngaps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pandas/src/sparse.pyx":79
 *         return same_length and same_indices
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ngaps(self):
 *         return self.length - self.npoints
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_7_sparse_IntIndex->tp_dict, __pyx_n_s_ngaps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pandas_7_sparse_IntIndex);

  /* "pandas/src/sparse.pyx":304
 * 
 *     @property
 *     def ngaps(self):             # <<<<<<<<<<<<<<
 *         return self.length - self.npoints
 * 
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex, __pyx_n_s_ngaps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pandas/src/sparse.pyx":303
 *         return output
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ngaps(self):
 *         return self.length - self.npoints
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6pandas_7_sparse_BlockIndex->tp_dict, __pyx_n_s_ngaps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6pandas_7_sparse_BlockIndex);

  /* "pandas/src/sparse.pyx":1064
 *     return sparse_nancombine(x, xindex, y, yindex, __rdiv)
 * 
 * sparse_nantruediv = sparse_nandiv             # <<<<<<<<<<<<<<
 * sparse_nanrtruediv = sparse_nanrdiv
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_nandiv); 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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_nantruediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":1065
 * 
 * sparse_nantruediv = sparse_nandiv
 * sparse_nanrtruediv = sparse_nanrdiv             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_nanfloordiv(ndarray x, SparseIndex xindex,
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_nanrdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_nanrtruediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":1113
 *                              y, yindex, yfill, __rdiv)
 * 
 * sparse_truediv = sparse_div             # <<<<<<<<<<<<<<
 * sparse_rtruediv = sparse_rdiv
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_truediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":1114
 * 
 * sparse_truediv = sparse_div
 * sparse_rtruediv = sparse_rdiv             # <<<<<<<<<<<<<<
 * 
 * cpdef sparse_floordiv(ndarray x, SparseIndex xindex, float64_t xfill,
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sparse_rdiv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparse_rtruediv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":1140
 * # Indexing operations
 * 
 * def get_reindexer(ndarray[object, ndim=1] values, dict index_map):             # <<<<<<<<<<<<<<
 *     cdef object idx
 *     cdef Py_ssize_t i
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7_sparse_43get_reindexer, NULL, __pyx_n_s_pandas__sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reindexer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":1187
 * 
 * 
 * def reindex_integer(ndarray[float64_t, ndim=1] values,             # <<<<<<<<<<<<<<
 *                     IntIndex sparse_index,
 *                     ndarray[int32_t, ndim=1] indexer):
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7_sparse_45reindex_integer, NULL, __pyx_n_s_pandas__sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reindex_integer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/sparse.pyx":1
 * from numpy cimport ndarray, int32_t, float64_t             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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);
  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) {
                if (PyObject_IsSubclass(instance_class, type)) {
                    type = instance_class;
                } else {
                    instance_class = NULL;
                }
            }
        }
        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* args = PyTuple_Pack(1, arg);
    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
}
#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) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __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);
    }
}

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_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) / 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 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 CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
    const npy_int32 neg_one = (npy_int32) -1, const_zero = 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 long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(npy_int32) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int32) <= sizeof(long long)) {
            return PyLong_FromLongLong((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);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = 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 long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(long long)) {
            return PyLong_FromLongLong((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);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
    {                                                                     \
        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 (is_unsigned && unlikely(value < zero))                \
                    goto raise_neg_overflow;                              \
                else                                                      \
                    goto raise_overflow;                                  \
            }                                                             \
        }                                                                 \
        return (target_type) value;                                       \
    }

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif

static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
    const npy_int32 neg_one = (npy_int32) -1, const_zero = 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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(npy_int32) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(npy_int32,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(npy_int32) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong(x))
            } else if (sizeof(npy_int32) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(npy_int32, 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 int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = 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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, 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_ptrdiff_t(ptrdiff_t value) {
    const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = 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 long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(ptrdiff_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(ptrdiff_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((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_long(long value) {
    const long neg_one = (long) -1, const_zero = 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 long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((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 = 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_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, 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 __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
    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 Py_INCREF(x), 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)))
      return PyInt_AS_LONG(b);
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
     #if CYTHON_USE_PYLONG_INTERNALS
       switch (Py_SIZE(b)) {
       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
       case  0: return 0;
       case  1: return ((PyLongObject*)b)->ob_digit[0];
       }
     #endif
    #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 */
